How to write a Edit Method in D365

 -> A D365 Edit method, tied to a form control,lets us run code on both what the user inputs and what is displayed back to the user.


-> Edit methods do allow a user to enter in a value into the control. 


-> Edit methods are very similar to x++ methods. However there are a few required pieces that make a method an edit method.


-> Edit methods must use the keyword ‘edit‘ in the method definition.


-> The method must take a first parameter that is of type boolean. The parameter should be named _set as a best practice.


-> If the Edit method is defined on a table, then the second parameter of the method will be populated with the value the user entered into the form control. Therefore it needs to use an Extended Data Type that matches the one used on the form control. There will be no third parameter.


-> If the Edit method is defined on a form Data Source, then the second parameter will be a table buffer that matches that of the form Data Source. And there will be third parameters that will be populated with the value the user entered into the form control. Therefore the third parameter needs to use an Extended Data Type that matches the one used on the form control.


-> The method must return a value that can be displayed in the form control. Therefore the return type should match the type used on the form control.

Comments

Popular posts from this blog

How to Create a wizard in x++ d365

X++ code to CREATE AND POST A TRADE AGREEMENT IN MICROSOFT DYNAMICS 365 in D365 F & O

x++ code to submit and approve and reject the invent movement workflow in d365 F&O