0129 with the chance of a label instead of the fieldname

Author: ulrichmerkel@web.de (ulrich-merkel)

Mi (german) message "0129" reads:

[0129] Feld %%ret_fieldlabel($fieldname,$entname)%%% ist Pflichtfeld!

And it uses a "function" i placed in the LPMX

entry ret_fieldlabel
returns string
params
   string p_fieldname : in
   string p_entname : in
endparams
variables
    string v_return
endvariables
    v_return = $concat("<$componentname>-",p_fieldname,"-",p_entname)
return(v_return)

 

so at the very end violating the you have to fill the PK of UFORM, I get the message:

[0129] Feld MyForm-ULABEL-UFORM ist Pflichtfeld!

120601: And hopefully after the next Iteration we will see:

[0129] Feld "Component Name" ist Pflichtfeld!

7 Comments

  1. But you could just define the field as

    [0129] Feld %%$componentname%%%-%%$fieldname%%%-%%$entname%%% ist Pflichtfeld!

    and then you don't need the LPMX.


    Author: Iain Sharp (i.sharp@pcisystems.co.uk)
  2. Hi Iain,

    it is just a demonstration that one can use self-written functions in error messages.

    In this case ret_fieldlabel

    This function will deliver the text of the fieldlabel  with the next iteration of this study.
    As we now, this is a not too easy quest to get the thing the user has in front of the field.

    If you or others have some time to find a way to make this happen, feel free to join the band.


    Author: ulrich-merkel (ulrichmerkel@web.de)
  3. $item("TEXT",$labelproperties($fieldname))


    Author: Iain Sharp (i.sharp@pcisystems.co.uk)
  4. thanks for the tip, it even returns the "default" of the field.

    Think when I experimented with $labelproperties, this was not the case


    Author: ulrich-merkel (ulrichmerkel@web.de)
  5. So we have our message as:

    [0129] Field %%$item("TEXT",$labelproperties($fieldname))%%% is mandatory!

    let's check what happens w/o an associated label painted etc.


    Author: ulrich-merkel (ulrichmerkel@web.de)
  6. Ah, that's where $labelproperties falls over. The label has to be painted, and the form has to be 'show'n, 'edit'ed or 'display'ed.

    You might write a global proc cp_isnull
    returns string
    params
    string p_string1 : IN
    string p_string2 : IN
    endparams

    if(p_string1 = "")
    return p_string2
    else
    return p_string1
    end

    and then use %%cp_isnull($item("TEXT",$labelproperties($fieldname)),"%%$fieldname%%%.%%$entname%%%")%%%

    which would return the label if it knew it and the field name otherwise.


    Author: Iain Sharp (i.sharp@pcisystems.co.uk)
  7. ... and may be enriched by a function which returns the "standard" label text which may be specified as part of the UXFIELD or UCFIELD.

    Once again a task for the dITo reflection project to make these infos available at compile time so they become part of the FRM (and SVC, RPT, ...).


    Author: ulrich-merkel (ulrichmerkel@web.de)