cancel
Showing results for 
Search instead for 
Did you mean: 

Voiding multiple items in a Sales Order

tjandra_afandi2
Participant
0 Kudos

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.

Accepted Solutions (1)

Accepted Solutions (1)

former_member185682
Active Contributor
0 Kudos

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

tjandra_afandi2
Participant
0 Kudos

Ah yes you're right... Turns out the problem was that I can't combine update and delete lines. I'll mark this as answered, and I'll open up a new thread for that.

Thanks.

Answers (0)