Looks like this automated adaptation needs improvementsAs 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
DoDefault()
IF PCOUNT() > 0
vEMp_id = (m.iEMP)
thisForm.wViewParmSet('employee_id',"vEMP_ID",m.vEMp_id,.T.)
thisform.refresh()
ENDIF
This.Get_data()
ENDIF