Trying To Do a Mass Cancel of Sales Order Lines

I have a new form in a new application for a simple select of sales order lines by Customer PO # or Sales Order #, then a button to cancel all the selected rows.

The cancel button calls a HC that has event rules to do the cancel function. I am cancelling via Begin Doc, Edit Line, Edit Doc and End Doc. I took code that worked in a UBE for this. What happens is I get the first line cancelled and ignores all other rows.

Did anyone ever write a successful mass Sales Order line cancellation screen application and what is the trick here? Thank You.

Denis
E910
 

priya_jde

Member
Hi Denis

Do you have a code written to execute all the grid rows on the Cancel Button, either repeat for grid line should be ON or use system functions to get all selected rows and then call HC that does this stuff?

Regards
Priya
 
Thank you Priya,

In my HC event rules, I have Option - Repeat for Grid - checked. If I just change the color of the line with no other action, I see those lines that are checked change color.
When I start putting begin doc, edit line, etc. (in the HC itself, not in button calling it) only the first checked line is cancelled. Strange...
 

Chan Rana

Legendary Poster
This would be tricky and might need lot of design and testing if you have multiple sales order lines selected for cancel you might need to clear cache and check if earlier order went thru before starting on next block/order.
If you tested it for one order then your code is not running thru all of the grid lines or the process just works and close first line and might have error for rest of the lines.

Thanks,
Chan
 

jileto

Well Known Member
I have a new form in a new application for a simple select of sales order lines by Customer PO # or Sales Order #, then a button to cancel all the selected rows.

The cancel button calls a HC that has event rules to do the cancel function. I am cancelling via Begin Doc, Edit Line, Edit Doc and End Doc. I took code that worked in a UBE for this. What happens is I get the first line cancelled and ignores all other rows.

Did anyone ever write a successful mass Sales Order line cancellation screen application and what is the trick here? Thank You.

Denis
E910

Try using the EDI functionality - R47011.

Create an EDI batch by populating the EDI tables R47011 uses for processing with the Order #, line numbers, and "Cancel" activity code. Run R47011 against the batch to cancel the lines. And later, there's another R47 UBE you can run to clear the batch records you created.
 
Top