Recently I worked on integrating payroll information from workday to dynamics 365 for operations. I used recurring integrations to create journals with in Dynamics 365 for finance and operations. Data management package API and recurring integration can be useful in such a scenarios .
I used duplicate of LedgerJournalEntity for this purpose as I wanted to change some logic in the entity. Remember one thing while using this entity , it does set based operations and allocates different journal numbers while inserting data in to staging . So suppose if you have 1000 lines coming in a request from third party application thousand different journals are created but you might not want to do that . To overcome this issue, small piece of code is needed. That can be done in postGetStagingData method of the entity , where you can generate journal number and update staging.
First step is to create endpoint. To create endpoint import data projects needs to be created , which can be done from data management . Once you create data project , you can create recurring data job from there. Process is well described in the recurring integration article .
My Endpoint looks like this :
Company parameter is needed when you want to create journals in different companies . When you set up recurring data job there is an option to run your request in specific company.
I will demonstrate this process using postman here , as I don’t have workday studio to simulate the process.
Below step shows how to acquire token. You can automate the same thing in postman while executing actual request as well.
Here is request looks like . Token generated in first step is used for authorization .
I used XML in this example . Here is sample XML
<?xml version="1.0" encoding="utf-8"?> <Document> <caaLedgerJournalEntity> <JOURNALBATCHNUMBER/> <LINENUMBER>1.0000000000000000</LINENUMBER> <ACCOUNTTYPE>Bank</ACCOUNTTYPE> <ACCOUNTDISPLAYVALUE>CAA-Pay</ACCOUNTDISPLAYVALUE> <BOOKINGLINENUM>0</BOOKINGLINENUM> <BOOKINGNUMBER>0</BOOKINGNUMBER> <CASHDISCOUNT/> <CASHDISCOUNTAMOUNT>0.000000</CASHDISCOUNTAMOUNT> <CASHDISCOUNTDATE>1900-01-01T00:00:00</CASHDISCOUNTDATE> <CREDITAMOUNT>3806941.16</CREDITAMOUNT> <CURRENCYCODE>USD</CURRENCYCODE> <DEBITAMOUNT/> <DEFAULTDIMENSIONDISPLAYVALUE/> <DESCRIPTION>08/16/2019-08/31/2019 (Exempt 08/30/2019)</DESCRIPTION> <DOCUMENTNUM/> <DUEDATE>1900-01-01T00:00:00</DUEDATE> <EXCHANGERATE>100</EXCHANGERATE> <EXCHANGERATESECONDARY>0.0000000000000000</EXCHANGERATESECONDARY> <INVOICE/> <ISPOSTED>No</ISPOSTED> <ITEMSALESTAXGROUP/> <JOURNALNAME>Payroll</JOURNALNAME> <OFFSETACCOUNTDISPLAYVALUE/> <OFFSETACCOUNTTYPE>Ledger</OFFSETACCOUNTTYPE> <OFFSETDEFAULTDIMENSIONDISPLAYVALUE/> <OFFSETTEXT/> <ONOFFCYCLEJOURNALDESC>Yes</ONOFFCYCLEJOURNALDESC> <PAYMENTID/> <PAYMENTMETHOD/> <PAYMENTREFERENCE/> <POSTINGLAYER>Current</POSTINGLAYER> <POSTINGPROFILE/> <QUANTITY>0.000000</QUANTITY> <REVERSEDATE>1900-01-01T00:00:00</REVERSEDATE> <REVERSEENTRY>No</REVERSEENTRY> <SALESTAXCODE/> <SALESTAXGROUP/> <TAXEXEMPTNUMBER/> <TEXT>08/16/2019-08/31/2019 (Exempt 08/30/2019)</TEXT> <TRANSDATE>2019-08-30T00:00:00</TRANSDATE> <VOUCHER>caaEXMPT615ON20190830</VOUCHER> <COMPANY>caa</COMPANY> </caaLedgerJournalEntity> </Document>
Once the request is sent, its queued in messages queue which will be processed by batch job.Batch job recurrence can be set up while creating recurring data job.
Once message is processed , you can see execution history from the message itself.
Here is journal created after processing of the message
If you have any questions feel free to comment.