display format in edit box query

Author: lalitpct@gmail.com (lalitpct)

In and editbox , I am getting below values , I want to run a command like
$replace(values,1,$syntax("&*/"),"", -1) which replaces "/a/b/c/d/" with ""
Not sure whether we can define in the display format ? does anyone have idea about it ?

value on screen


  1. NO, there is no way to apply a display format to a STRING removing characters, all you can do is adding characters in between.

    See QRG.PDF(Version 8.4.06) page 7-1:

    For string fields with data type String or Special String, the valid display
    format codes are:

    ? Character from data element.
    %? One question mark.
    %% One percent symbol.
    Any ASCII character That ASCII character as a constant.


    P.S: haven't we discussed a similar issue on "using replace one in tricky way" ?

    Author: ulrich-merkel (ulrichmerkel@web.de)
  2. Hi Uli ,

     We did discuss that , but here requirement was in dispaly format and not exactly replacing it , anyways thanks for the information .

    handling it in display would have been very simple ..by coding in the form i know , but I though this can be implemented in display format .

    Now I know it ,





    Author: lalitpct (lalitpct@gmail.com)
  3. If the "to ignore characters" are only on the front of the value, than one can use this code:



         string v_ORG

    If there is a more complex "rule", just put other code into FORMAT/DEFORMAT-Trigger


    If you wan't to have this code reusable, then declare two global functions
     FORMAT:   $format=GF_FMT_<some_type_name>($format,"")
     DEFORMAT: $format=GF_DFMT_<some_type_name>($format,"")


     FORMAT:   call GP_FMT_<some_type_name>("")

     DEFORMAT: call GP_DFMT_<some_type_name>("")

    [Where the last argument are for further parameters in UIL format]

    As $format and $fieldname a availble in the globale procedure context, there is no need to pass them by parameter

    Next step is to put this code into the FORMAT/DEFORAMT-trigger in model so all components have this code inside without further programming






    Author: istiller (i2stiller@gmx.de)