Hello everyone!
I`m new in AX (just around 2 month).
I`m currently learning SysOperation framework and my task is to create a dialog for creating sales order using this framework.
First of all Ive already done it on RunBaseBatch and now Im stuck with SysOperation.
On my RBB dialog I used custom form with grid and temp table as datasource to add items, quantity and dimensions for the order as well as choosing customer account on another tab.
I used getFromDialog() method to get all input data for running main job in batch.
It looks like next (link to imgur)
the code is
public boolean getFromDialog()
{
SEDYSsalesLineTemp sEDYSsalesLineTemprecord;
InventDim inventDim;
FormRun formRun;
FormDataSource ds, dimDs;
custAccount = custAccountField.value();
formRun = dialog.dialogForm().formRun();
ds = formRun.dataSource();
dimDs = formRun.dataSource("InventDim");
sEDYSsalesLineTemprecord = ds.getFirst();
inventDim = dimDs.getFirst();
while(sEDYSsalesLineTemprecord)
{
inventDim = InventDim::findOrCreate(inventDim);
sEDYSsalesLineTemprecord.InventDimId = inventDim.inventDimId;
itemList.addEnd(sEDYSsalesLineTemprecord);
sEDYSsalesLineTemprecord = ds.getNext();
inventDim = dimDs.getNext();
}
conItemList = itemList.pack();
}
Then i run main logic which creates sales order header and lines.
Now I have to do same thing with sysOperation. I have created my custom form from SysOperationTemplateForm, added same grid and data sources.
And the problem is I don`t understand how to get data from my dialog.
I understand that generally I need to pass that ‘conItemList’ container to some parm method on a contract class and simply unpack it in service class and use. But where do I have to put my packing method and how to get access to the form`s dataSource?
I figured out that method getFromDialog() on AutomaticUIBuilder gets data for contract members, and that is the way i get my custAccount from form. But still I cant figure out how to get data from forms datasource and pack it to container.
Of course Im not sure that I am thinking in right direction, so Ill be glad on any suggestions. But the main thing is that I have to use this form (not a standard template), and I must have ability to add as many items to order as necessary .
Looking forward on any suggestions and thanks for attention!