Hello,
I have a requirement to add a button on a custom form which will open the SalesCreateOrder form (to create a new sales order).
There is a custom customer account (TSTCustAccount) setup in CustParameters which the form needs to automatically initialize with.
I have added a new boolean parm method in the class extension of SalesTableForm.
I have added a new button in my custom form and added the following codes in the clicked method :
SalesTableForm salesTableForm = SalesTableForm::construct(SalesTableFormId::None, null);
salesTableForm.tstParmTest(true);
salesTableForm.create();
I have then added a logic in the post init of the SalesCreateOrder form extension:
if (salesTableForm.tstParmTest())
{
CustParameters tstCustParameters = CustParameters::find();
if (tstCustParameters.TSTCustAccount)
{
SalesTable.CustAccount(tstCustParameters.TSTCustAccount);
SalesTable.modifiedField(fieldNum(SalesTable, CustAccount));
}
}
However, the customer account field is still empty.
I have tried doing in the SalesTable_DS.initValue, but it is still empty.
Is there another way to do this particular requirement?