At the previous post I already show how to customize Response Value list in AIF Document standard service, today we will talk about response in Custom AIF service class.
We already know for Custom AIF service we actually need 2 classes, one is contract for data input and one is service to process a logic. With Response class, it’s literally same with contract class. They both hold parm value.
contract class gets parametters.
Response class sets return values.
I want to get HcmPersonnelNumberId and HcmWorkerName of current userID on C#.NET application.
We normally use NETTCP adapter for .NET system, It going to very easy to consume by.
As my experience, if we use NETTCP adapter for consuming by Java system, we will need add some extension or 3rd party due to binding and mismatch schema and of course client doesn’t want to do that either me.
So, my solution is creating HTTP adapter for Java, you can also use .NET system to consume HTTP adapter without any problems
For this demonstration, I use AIF service to create Sales order with SalesSalesOrderService and I gonna consume AIF using C#.NET.
Normally, in consume service application we handle return value by using EntityKeyList, EntityKey, KeyData.Value. And for Sales Order It will return Created SalesID.
Let’s take a look on AxdSalesOrder class. More about Axd class please prefer this.
Then go to createList method, this method will handle response value
So, how about customer wants another meaning value beside SalesID likes InventTransId information in SalesLine table or another tables base on your requirement. To do that, we need to customize this method.
Main requirements is Using batch to find and block vendor base on last transaction condition and notify for them by emails.
Set up E-mail parameters
For set up email, we need Go to AX System administrator > Setup > E-mail parameters
Vendor emails locate on LogisticsElectronicAddress.Locator, partyTable.PrimaryContactEmail, partyLocation.Location, please take a look on this job to find how to update Vendor emails and you also could see the relations more clearly.
Main logic here is find Vend accounts are not exist in VendTrans table with condition endTrans.TransDate >= beginDate, and beginDate count from today systemDateGet().
Get the date before 6 months from today
Initializes a new instance of the Batch class.
Gets description of the dialog.
Find the vendor without transaction and disable, then send email to vendor
Provides an enter point for the Batch class.
From here you can run class and set up recurrence for batch job.