web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

How to create a purchase invoice based on a purchase order with AIF?

(0) ShareShare
ReportReport
Posted on by 205

Hi all,

I have a purchase order that was created in AX and downloaded to a WMS system via AIF. Once the PO is received in the warehouse i would like to create a purchase invoice based on this purchase order.
In order to do that i have set up an adapter in AIF to receive the XML document that represent the invoice, however when the batch job is running and try to get the message i receive an error saying the XML is malformatted and its schema is incorrect.
Where can i find the correct schema files for AX documents? Are there any explanations regarding posting invoices (sales and purchase) and their relations to the base document (PO, sales order, etc.)

Thanks,

Udi

*This post is locked for comments

I have the same question (0)
  • 640579632b5c4e6780a624c4771b6f93 Profile Picture
    4,730 on at

    Can you paste the XML want you are passing ?

    Also , check the excpetion log from Dynamics to see detail errror ?

    you can find the expected schema from AifService form in AOT

  • Udi Shamla Profile Picture
    205 on at

    Thanks for the quick reply. sure, attached is the XML i am trying to post, however i am looking for something more generic, some kind of explanation about the schema, such as mandatory fields etc.

    regarding the exception log - where can i find it? i saw the error from the queue manager screen but as you can figure it is not detailed at all.

    here is the XML i am trying to post:

     <?xml version="1.0" encoding="utf-8" ?>

    - <Envelope xmlns="schemas.microsoft.com/.../Message">

    - <Header>

     <SourceEndpointUser>accpac\system</SourceEndpointUser>

     <SourceEndpoint>Default</SourceEndpoint>

     <DestinationEndpoint>PJMEndpoint</DestinationEndpoint>

     <Action>schemas.microsoft.com/.../Action>

     </Header>

    - <Body xmlns="schemas.microsoft.com/.../Message">

    - <PurchaseInvoice xmlns="schemas.microsoft.com/.../PurchaseInvoice">

     <DocPurpose>Original</DocPurpose>

    - <LedgerJournalTable action="create" class="entity">

     <DocumentNum>12345</DocumentNum>

    - <LedgerJournalTrans class="entity" action="create">

     <AccountNum>ABELGA</AccountNum>

     <AccountType>Cust</AccountType>

     <Company>ABELGA</Company>

     <CurrencyCode>USD</CurrencyCode>

     <DocumentDate>2011-08-25</DocumentDate>

     <DocumentNum>00000073_068</DocumentNum>

     <Invoice>OP/1000155</Invoice>

     <Qty>1</Qty>

     </LedgerJournalTrans>

     </LedgerJournalTable>

     </PurchaseInvoice>

     </Body>

     </Envelope>

  • 640579632b5c4e6780a624c4771b6f93 Profile Picture
    4,730 on at

    Seems like it is service for AX 2009 and I dont have an environment with that currently to test.

    you debug the service using

    www.wcfstorm.com/.../download-wcfstorm-lite.aspx

    from AIFservice form you can see the schema which will give you information about fields, datatype and mandatoty

  • Udi Shamla Profile Picture
    205 on at

    how do i get to the AIFservice form? i found it but it under the AOT but there isnt any information regarding the XML schema of documents..

    thanks,

    udi

  • 640579632b5c4e6780a624c4771b6f93 Profile Picture
    4,730 on at

    AIFservice -> service operation -> parameter schema

  • Udi Shamla Profile Picture
    205 on at

    Thanks a lot.

  • Verified answer
    640579632b5c4e6780a624c4771b6f93 Profile Picture
    4,730 on at

    please mark it as a verified answer.

  • akuehn Profile Picture
    1,995 on at

    Well, just a little question on this.

    You are talking about invoices for PO's, right?

    As far as i understand you, you will import an PO invoice with aif into AX.

    And AX should do the same as when you do a click on the invoice button on the purchase oder form, right?

    If so, first you have to write your own purchase order invoice aif service because the one provided by the AX standard create the records in the LedgerJournalTrans and not in the VendInvoiceTrans table.

    This means taht the Standard AIF service for purchase invoices will adress the invoice pool ( ajournal) not the invoice for an purchase order...

  • Udi Shamla Profile Picture
    205 on at

    Thanks  Akuehn, although its kind of bad news since i expected it to work a bit differently.

    Can you point me out to a starters manual for doing this task.

  • Udi Shamla Profile Picture
    205 on at

    Can it be done by using the .Net business connector - i mean using the appropriate objects from a .net program instead of writing a new service in x++?

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Joris dG Profile Picture

Joris dG 5

#2
Alexey Lekanov Profile Picture

Alexey Lekanov 2

#2
Henrik Nordlöf Profile Picture

Henrik Nordlöf 2 User Group Leader

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans