Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Unanswered

Document service on outbound port produces XML file missing a field

(0) ShareShare
ReportReport
Posted on by 30

Hi,

I have modified document query AxdPurchaseRequisition to include the name of the person that placed the order. I added the section in red, as shown below.

UsingDirPerson.png

This query is used by an outbound port to produce an XML file.

After I made the modifications, I updated the related document service, refreshed AIF services, generated incremental CIL, and configured the document data policy on the outbound port to include the new field in the generated XML file.

DataPolicy.PNG

But when I test the outbound port it produces an XML file that does not contain the required Name field. It also doesn't contain any <HcmWorker> nor <DirPerson> elements.

To verify whether the query actually works, I created a job with some test code. Below is the job code.

For this test I am using the same purchase order as used when testing the outbound port. 

    AxdPurchaseRequisition axdPR;
    Query q = new Query(queryStr(AxdPurchaseRequisition));
    QueryRun qr;
    Common vpoj;
    Common ptav;
    Common hw;
    DirPerson dp;

    QueryBuildDataSource qbds_vpoj;
    QueryBuildRange qbr_vpoj_purchid;

    qbds_vpoj = q.dataSourceName("VendPurchOrderJour");
    qbr_vpoj_purchid = qbds_vpoj.addRange(fieldNum(VendPurchOrderJour, PurchId));
    qbr_vpoj_purchid.value(queryValue("2100002142"));

    qr = new QueryRun(q);

    while (qr.next())
    {
        vpoj = qr.get(tableNum(VendPurchOrderJour));
        ptav = qr.get(tableNum(PurchTableAllVersions));
        hw = qr.get(tableNum(HcmWorker));
        dp = qr.get(tableNum(DirPerson));

        info(strFmt("vpoj recid = %1 > ptav recid = %2 > hw recid = %3 > dp recid = %4 (%5)", vpoj.RecId, ptav.RecId, hw.RecId, dp.RecId, dp.Name));
    }

This is an example of a line that is logged by the info method.

vpoj recid = 5637646205 > ptav recid = 5637693916 > hw recid = 5637167875 > dp recid = 5637203889 (John Doe)

Thus, the query actually returns a DirPerson record, which includes the Name field.

Would there be anything left to configure on the outbound port to make this work? The query seems to work properly when executing it from my test code, so I'm inclined to think nothing needs to change about the query.

Any advice or thoughts on this?

Thanks,

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,888 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,772 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156 Moderator

Leaderboard

Product updates

Dynamics 365 release plans