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

Notifications

Announcements

Community site session details

Community site session details

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

Sales order not invoiced for Foreign customers x++

(0) ShareShare
ReportReport
Posted on by 1,027

Hi,

Below is code written in a runnable class to post an invoice. This code works fine and the sales order is invoiced if the customer is not a foreign customer.

However, the code is not working and status remains "Delivered" if the customer is a foreign customer. If I post the invoice from the sales order form, it is getting invoiced.

Foreign customer: "Foreign customer" field in "General" section of "Tax Information" tab in customer form

Any guidance please.

//Invoicing the sales order
        SalesFormLetter formLetterObj;
        formLetterObj = SalesFormLetter::construct(DocumentStatus::Invoice);
        formLetterObj.update(SalesTable::find("XXXX-000092"));

I have the same question (0)
  • nmaenpaa Profile Picture
    101,166 Moderator on at

    Do you get any error messages or warnings when running the class? If yes, please share them with us.

    Did you already debug it to see where it fails? If not, please do. And then please share the results with us.

    Thanks!

  • Sridhar Narayanan Profile Picture
    1,027 on at

    Hi Nikolaos,

    Thank you for your input. System is not throwing any error and at the same time it is not invoicing the SO.  

    Regards,

    N.Sridhar

  • Verified answer
    jannawangD365 Profile Picture
    on at

    Hi Sridhar,

    I saw this issue was post duplicated as below.  Will Wu will help you on the below thread. for the current one, I would suggest to close it to avoid duplication.

    community.dynamics.com/.../sales-order-not-invoiced-for-foreign-customers-x

  • Ludwig Reinhard Profile Picture
    Microsoft Employee on at

    Hello Sridhar,

    Can you define "foreign customer"?

    What is a foreign customer, exactly? Is such a customer identified by the field you mentioned or by something else?

    Can you post the invoice for such a customer manually?

    Best regards,

    Ludwig

  • Sridhar Narayanan Profile Picture
    1,027 on at

    Hi Ludwig, Yes, A foreign customer is identified by the field I mentioned.

    Yes, I could post the invoice manually.

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

News and Announcements

Season of Giving Solutions is Here!

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Abhilash Warrier Profile Picture

Abhilash Warrier 843 Super User 2025 Season 2

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 423 Super User 2025 Season 2

#3
Martin Dráb Profile Picture

Martin Dráb 342 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans