Skip to main content

Notifications

Announcements

No record found.

Finance | Project Operations, Human Resources, ...
Unanswered

Apply Check while creating a sales order with EDI

Posted on by 115

Hi all, 

          We have a class which processes sales orders with EDI.  We are tasked with applying a check that if the ordered quantity is less than three, the journal should be converted into sales order and sales order will be cancelled. 

I want to count the total quantity of all the lines of a sales order. Then, compare this quantity with a field in a division/override form.

If the sales order total quantity is exceeding this field's quantity, it should proceed to create the order, else it should convert the journal into sales order which will subsequently be cancelled. How can I do this entire operation ?

  • Jeson Profile Picture
    Jeson 120 on at
    RE: Apply Check while creating a sales order with EDI

    Lets assume you are using salestable as a data source on the other form.  As what i have understand base on your given info, you can make a class that will calculate the entire quantity of a certain sales order then campare it to the MinQty and place it on the insert or modified field method. Because u want to trigger by qyt righ?

  • Jeson Profile Picture
    Jeson 120 on at
    RE: Apply Check while creating a sales order with EDI

    In that case, u can place the code on the insert method on the salesline table and also place it on the modified method, if ever ever the quantity will be change to <=3. Just create a class that will update the sales order status.

  • 00030000036294D5 Profile Picture
    00030000036294D5 115 on at
    RE: Apply Check while creating a sales order with EDI

    One thing more, when the sales order is cancelled, it should be cancelled with a trackable cancellation code. ??

  • 00030000036294D5 Profile Picture
    00030000036294D5 115 on at
    RE: Apply Check while creating a sales order with EDI

    Suppose we have a sales order named SO-001 with status Journal. It has two lines with each line having quantity 1. I would like to have a sum of quantity of all the lines of this sales order. It will sum as 2 since we have 1 quantity in each line. Now, there is a form which has a table as its datasource. There is a field in that table called MinQty with value as 3.

    I would like to compare my salesorder quantity with this field, and since my sales order quantity is lesser than this field value, I would like to have my sales order cancelled.

  • RE: Apply Check while creating a sales order with EDI

    If total ordered qty of entire sales order needs to be checked then, the order lines will be created first and then the check should be performed. Is this what you are exactly looking for?

  • 00030000036294D5 Profile Picture
    00030000036294D5 115 on at
    RE: Apply Check while creating a sales order with EDI

    Trigger by sales line quantity. If sales line quantity is less than or equal to three, the sales order should be cancelled.

  • Jeson Profile Picture
    Jeson 120 on at
    RE: Apply Check while creating a sales order with EDI

    When it will be cancelled? After closing the form? Or at the end of the day? Or trigger by sales line qty?

  • 00030000036294D5 Profile Picture
    00030000036294D5 115 on at
    RE: Apply Check while creating a sales order with EDI

    Please help. I want x++ code for counting sum of quantities of all lines of a sales order. Then, I need to compare this value with the value of a field in another table. If sales order quantity exceeds, it will continue to create the order else sales order will be cancelled. Please help...

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,235 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans