We have a need to prevent users from cancelling lines that are reserved in customer orders.
I thought we had the solution but are stuck with one issue.
We created the following Event -
We then created the corresponding Event Action that throws and error when a Customer Order line is cancelled with 1 of our 2 reasons or no reason. This works exactly as intended on a custom order.
The issue that we are running into is if a user RMBs on an order line, selects Manual Reservations and tries to undo the manual reservation before cancelling they get stopped by the error that is meant to block the cancellation of an order line with status of Reserved on the customer order.
I believe the issue is centered around the the ROWSTATE changing out of reserved. I cannot figure out why the event action is firing when a condition of the event action is a NEW:CANCEL_REASON.
We are on IFS 9 updt 10.
Any help is appreciated.
Thank you,
Page 1 / 1
I assume that the Cancel_Reason field always exists on the record regardless, and is presumably empty since no cancellation has actually been done.
Since your event is triggered and running the action whenever the state was Reserved and there is no Cancel_Reason set it makes sense that this is running… I suspect that if you remove the empty condition for the Cancel_Reason (just as a test) this would not trigger when reversing out the reservation like you are trying.
To fix it I would look for another field in the record that you can leverage (e.g. a cancellation date) that you can add to your logic - in addition to the old Rowstate and new Cancel_reason - that will be set (or not set) only in a true cancellation scenario.
Nick
@NickPorter
Before I reply let me ask this...Does an event action have to meet all the conditions or just one of the conditions to fire?
Since your event is triggered and running the action whenever the state was Reserved and there is no Cancel_Reason set it makes sense that this is running… I suspect that if you remove the empty condition for the Cancel_Reason (just as a test) this would not trigger when reversing out the reservation like you are trying.
If I am following correctly, yes, when you remove the “empty” condition the event action does not fire and you can cancel the line. This “empty” condition was put in to take effect when a user does not fill in the Cancellation Reason and just clicks OK.
I thought I may have had the answer when I was able to discover the field Reserved Qty attribute on the Customer Order Line Tab is QTY_ASSIGNED.
I then modified my event action as such
This did prevent users from being able to cancel a line with a Reserved Qty > 0, however it prevents you from reserving or un-reserving inventory.
The goal is to allow users to reserve and un-reserve as necessary but blocking any attempts to cancel a line with a Reserved Qty > 0.
Thanks,
It should meet all of the conditions defined.
I understand the reason for having the empty check in the logic, but that is what was likely triggering the event when not wanted when users were trying to undo the manual reservation that you noted.
By adding the extra condition, in this case the Reserved Qty, you are heading in the direction I was trying to get at, i.e. add more logic that will only be true when canceling and not when trying to undo a manual reservation… as you noted that is not working. Could you not just use the Rowstate again but check to see if the new Rowstate is ‘Cancelled’?
Hi @zconverse ,
You could add that empty check in PLSQL logic in the body and remove from conditions.
That might help.
Hello @NickPorter
You were correct in that the check for the blank entry was causing the issue.
We are going to remove the blank option and force users to select a cancellation reason.
Thank you and @EntNadeeL for replying and the assistance.