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 :
Finance | Project Operations, Human Resources, ...
Answered

Sales order not invoiced for Foreign customers x++

(0) ShareShare
ReportReport
Posted on by 1,104

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,104 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
    Microsoft Employee 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,104 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

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

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

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 509 Super User 2026 Season 1

#2
Giorgio Bonacorsi Profile Picture

Giorgio Bonacorsi 375

#3
Adis Profile Picture

Adis 268 Super User 2026 Season 1

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans