Tuesday, June 29, 2010

Form Personalization - Sales Order Form Auto Split Remainder

Once upon a time I received a very strange request of doing a "small" change in the Sales Order form.  For some reasons our staff needs to split sales order lines very often so that the Discoverer report can be accurate.  For example, an order line with 3400 units of an item. Once this item is in the warehouse (in limited supply), this line is splitted into 800 and 2600 units, and then the promise date for 2600 unit is changed to next week. The line for 800 unit will be shipped in the next day.  The staff needs to do adjustment for ALL sales orders with this item and distribute appropriately to different customers.


In Sales Order form, when you split a line, the actions are
  • select the target line
  • click the "Actions" button, and select "Split Line"
  • Enter the amount in the first line, then press "down"
  • Enter the remaining amount, then click "Split"
What I was asked to do is to make the "remaining amount" coming out automatically so that the staff do not need to calculate what it's supposed to be.



Forms to be Personalized
Sales Order, Sales Organizer, Quick Sales Order, Quick Sales Organizer

CONDITION
Trigger Event
WHEN-NEW-ITEM-INSTANCE
Trigger Object
SPLIT_LINE.ORDERED_QUANTITY
Condition
NVL(:SPLIT_LINE_CONTROL.TOTAL_SHIPMENT_QUANTITY, 0) > 0 AND
:SPLIT_LINE.ORDERED_QUANTITY IS NULL AND
(:SPLIT_LINE_CONTROL.ORIG_ORDERED_QUANTITY - :SPLIT_LINE_CONTROL.TOTAL_SHIPMENT_QUANTITY) >= 0

ACTION
Type
Property
Object Type
Item
Target Object
SPLIT_LINE.ORDERED_QUANTITY
Property Name
VALUE
Value
= (:SPLIT_LINE_CONTROL.ORIG_ORDERED_QUANTITY - :SPLIT_LINE_CONTROL.TOTAL_SHIPMENT_QUANTITY)

No comments :