Skip to Content

Voiding multiple items in a Sales Order

Hi, we're using 2007.

When I need to close multiple item lines in a Sales Order, I'll need to do this:

  1. For each line to be deleted:
    1. Call GetByKey()
    2. Call SetCurrentLine()
    3. set LineStatus = bost_Close
    4. Call Update()

So I just want to confirm if this is the only way to do it? (if I don't call Update() in the loop, it will error out)

And secondly, do I need to call GetByKey() in the loop? Or I can do it first before entering the loop?

Please advise.

Thanks.

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • Best Answer
    Posted on Sep 12, 2015 at 03:16 PM

    Hi Tjandra,

    I'm using 9.0, but I believe that work equals.

    You need this:

    1 Call GetByKey

    Foreach line to be deleted

    Call SetCurrentLine()

    set LineStatus = bost_Close

    End Forecah

    2 Call Update()

    You just need call GetByKey to load your document one time, and after you change the status of your lines, you just call Update() one time too.

    Regards,

    Diego

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.