SysOerationFrameWork Part 3

Using Sys Operation Service Controller Class
I am listing two here:
  • DateOfBirth value should be defaulted to system date +1
  • Query field should be defaulted to ’3002′
So the idea is simple,If we want to make the values of the field to default/field is populated upon initializing of the form.we can perform this task using SysOperationServiceController class
Now  i have created a class called AsimServiceController and extend it to SysOperationSerivceController class.To make my class work as a service controller class.
ServiceOperationController
Now,declaring variables
VariableInitalize
Basically to initalize AsimServiceController which require three paramters, className,methodName and executionMode variables need to be iniliazed as well.So intialized with parseServiceInfo and then passed it to AsimServiceController contructor.
class
Here,initializing the dataContract variable to the existing Data Contract class
getDataContract
Now,initializing query with the existing query ‘VendAccount’  in AOT  then setting the value to ‘3002,as this is our requirement.Also note one thing here,is that i have encode the query and the packed the query to send it to the parmQuery to dataContract class.
query
Also our second requirement was to set the date of birth to current date + 1 so, here i am doing
parmDateOfBorth
Lastly i am starting the operation using start Operation.Note also the method called queryChanged() which basically show the value on the field,when dialog opens.
startOperation
Finally again we would be generating an IL and open a menu item.We would have like
last

Comments

Popular posts from this blog

Write/ Read to Excel Sheet

Table Methods in Ax 2012

Financial Dimensions in AX 2012