How to pass the form level data into the Sysoperation default contract parameter in D365 FO

Hello All,

How to pass the form level data into sysoperation contract parameter

this is batch process, need to add the button in form level, that button should perform in batch.(sysoperation framework)

if we click the button, form level data should populate in parameter

please help me if any body is having reference

This is work for a controller class. You get a reference to form data in _args parameter of controller’s main() method, fetch what you need and modify the contract.

For example, look at AssetPackingSlipController.preRunModifyContract(). It gets a packing slip ID from Args.parm(), fetch some extra details based on it and pass them to the contract objects obtained by this.parmReportContract().parmRdpContract().

Thank you for reply,

it is working , for getting the parameter.

How to lock the range for the sys operation contract parameter, with out change the user for that parameter

Could you elaborate your question, please?

Thanks for your reply,

once we click the batch button in form level, it should populate form level data as a parameter, ( i.e parameter is coming fine now)

after that user can not chnage the value in parameter, it should be disabled mode.

need to give option only , user can choose the batch processing and batch group only

One option is not showing the value at all. If you want to show it in read-only mode, I think you’ll have to implement a UI builder class and do it there.

(You mentioned a range once, but then you keep talking about a parameter, therefore I assume you mean a member of a data contract class.)

Thank you for reply again,

user should not change the value.

I want to show read only mode, can you please tell me the reference code for ui builder class

It seems you should learn basics of the framework before continuing. For instance, try this tutorial. UI builder classes are covered in the third part and there is a concrete example of disabling dialogFieldTransDate (in your case, you’ll simply use enabled(false)).

If you want to look at existing UI builder classes, either go to SysOperationAutomaticUIBuilder class and use Find references, or filter Application Explorer by type:class UIBuilder$.