info(“modifiedfield”)

The info(“modifiedfield”) function returns the name of the field that was just modified.


Description

The info(“modifiedfield”) function returns the name of the field that was just modified. This function is designed for use in the .ModifyRecord procedure. The modified field is not always the same as the current field (see info(“fieldname”)) - for example if a checkbox or radio button is clicked this function will return the name of the field associated with the checkbox or radio button.

The .ModifyRecord procedure below keeps an audit trail of all single cell modifications that are made to the database, and by whom. This example assumes that the database contains a field name Journal to hold the audit trail.

local  cellValue,jline
if info("modifiedfield")="Journal" rtn  endif 
    cellValue= fieldvalue("",info("modifiedfield"))
    jline="«"+info("modifiedfield")+"»="+
        constantvalue( "cellValue") +"  // by "+ info("unixusername") +
        " on "+ datepattern( today(),"YYYY-MM-DD")+
        " @ "+timepattern(  now( ),"hh:mm:ss")
    Journal=jline+ sandwich(  cr( ),Journal,"")

The .ModifyFill procedure keeps an audit trail of all the mass changes that are made to the database (fill, total, etc.), and by whom. This example assumes that the database contains a field name Journal to hold the audit trail.

local wasField,jprefix,jsuffix
wasField = info("fieldname") 
jprefix="«"+info("modifiedfield")+"»="
jsuffix="  // by "+ info("unixusername") +
    " on "+ datepattern(  today( ),"YYYY-MM-DD")+" @ "+ timepattern(  now( ),"hh:mm:ss")
field  Journal
if datatype( info("modifiedfield"))="Text"
    formulafill  jprefix+
        quoted(  fieldvalue( "",info("modifiedfield")))+
        jsuffix+ sandwich(  cr( ),Journal,"")
else 
    formulafill  jprefix+
        str(  fieldvalue( "",info("modifiedfield")))+
        jsuffix+ sandwich(  cr( ),Journal,"")
endif 
field (wasField)

See Also


History

VersionStatusNotes
10.0No ChangeCarried over from Panorama 6.0.