Friday, March 7, 2014

Simulating FieldChange Execution in a Transferred Page

 
  • Create a function (usually in the FieldFormula event) with the code that is currently in the FieldChange.
  • Remove the FieldChange code, and instead of it, add a call to the created funtion: 

    Declare Function funcion PeopleCode workrecord.flag FieldFormula;
    
    function();

  • Add a flag field in a work record, and add this field as hidden in the target page.
  • In the source page, add the transfer funtion call and send in it an instance of the work record with the flag field value = "Y": 

    &MYREC = CreateRecord(Record.record); 
    
    record.flag="Y";
    
    &MYREC.Field1.value = record.field1;
    
    &MYREC.Flag.value =record.flag;
    
    Transfer( False, MenuName.menu, BarName.barname, ItemName.nombreitem, Page.page, "U", &MYREC, True);

  • Finally, in the target page activate code, add a if clause that evaluates the flag field, and in case that its equal to 'Y' call the previously declared function: 

    Declare Function funcion PeopleCode workrecord.flag FieldFormula;
    
    If  workrecord.flag="Y" then
    
    function();
    
    end-if;

No comments:

Post a Comment