Microsoft Dynamics AX 2012:Simple Use of SysOperation Framework:Part 3:SysOperationServiceController class

Hi Guys,Hope you all are fine.

Lets start with the part 3 of this series part 2 is here ,

I have list down the requirements at the start of my first part1,

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

 

Do let me know guys for any queries! thanks

Advertisements

11 responses to “Microsoft Dynamics AX 2012:Simple Use of SysOperation Framework:Part 3:SysOperationServiceController class

  1. Hello Asim, Do you have a XPO of this? I would like to have a close picture on this. I am currently trying to do something similiar based on SrsReportRunController. I mean I would like to init query before SSRS run and still no chance.

    Thank you

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s