Skip to main content

Notifications

Announcements

No record found.

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"));

  • Sridhar Narayanan Profile Picture
    Sridhar Narayanan 1,027 on at
    RE: Sales order not invoiced for Foreign customers x++

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

    Yes, I could post the invoice manually.

  • Ludwig Reinhard Profile Picture
    Ludwig Reinhard Microsoft Employee on at
    RE: Sales order not invoiced for Foreign customers x++

    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

  • Verified answer
    RE: Sales order not invoiced for Foreign customers x++

    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

  • Sridhar Narayanan Profile Picture
    Sridhar Narayanan 1,027 on at
    RE: Sales order not invoiced for Foreign customers x++

    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

  • nmaenpaa Profile Picture
    nmaenpaa 101,156 on at
    RE: Sales order not invoiced for Foreign customers x++

    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!

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

Congratulations 2024 Spotlight Honorees

Kudos to all of our 2024 community stars! 🎉

Meet the Top 10 leaders for December

Congratulations to our December super stars! 🥳

Start Your Super User Journey

Join the ranks of our community heros! 🦹

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,735 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,466 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans