I test for PCOUNT to determine what needs to be loaded on Init. I am not sure what the best way for FAA to handle the adaption but I will be aware of it so I can adjust for the forms where a parameter is not always sent.
Thanks,
Patrick
I test for PCOUNT to determine what needs to be loaded on Init. I am not sure what the best way for FAA to handle the adaption but I will be aware of it so I can adjust for the forms where a parameter is not always sent.
Thanks,
Patrick
As Tuvia explained,
.Init() 'naturally' executes without parameters when form instantiates (FAS keeps an internal reference to each form, shared by all users),
Then FAS executes .init() with your parameter(s)
In most cases, your .init() code needs be executed only at this last stage;
so you may keep everything within
IF pcount() > 0
ENDIF
unless your .Init() method can functionnally be called without parameters
I adapted a form and in the init this is what FIC did. The This.Get_data() no longer runs if no parameter is sent. I can move this line outside the Pcount IF/ENDIF to fix. Thought I would put this out there in case this is not by design.
LPARAMETERS iEmp IF Pcount() > 0 && Added by FoxInCloud Adaptation Assistant version 1.25 (source mode) on 06/19/2012 09:00:32 AM DoDefault() && Added by FoxInCloud Adaptation Assistant version 1.25 (source mode) on 06/19/2012 09:00:32 AM IF PCOUNT() > 0 vEMp_id = (m.iEMP) thisForm.wViewParmSet('employee_id',"vEMP_ID",m.vEMp_id,.T.) thisform.refresh() ENDIF This.Get_data() ENDIF && Added by FoxInCloud Adaptation Assistant version 1.25 (source mode) on 06/19/2012 09:00:32 AM