
Description = Check Parent BOM Item For Cannibalization1
Trigger Event = WHEN-NEW-ITEM-INSTANCE
Trigger Object = TOMAI_MAIN_LINES_BLK.QUANTITY
Condition = :TOMAI_MAIN_LINES_BLK.INVENTORY_ITEM IS NOT NULL

Seq = 10
Type = Property
Description = Check Parent BOM Item For Cannibalization1
Language = ALL
Object Type = Global Variable
Target Object = G_ITEM_VALUE
Property Name = VALUE
VALUE = =(SELECT COUNT(1)
FROM BOM_BILL_OF_MATERIALS
WHERE ASSEMBLY_ITEM_ID = (SELECT DISTINCT INVENTORY_ITEM_ID
FROM MTL_SYSTEM_ITEMS_B
WHERE SEGMENT1 = :TOMAI_MAIN_LINES_BLK.INVENTORY_ITEM)
AND ORGANIZATION_ID=FND_PROFILE.VALUE('MFG_ORGANIZATION_ID'))

Description = Restrict Assembly Items – QUANTITY
Trigger Event = WHEN-NEW-ITEM-INSTANCE
Trigger Object = TOMAI_MAIN_LINES_BLK.QUANTITY
Condition = :GLOBAL.G_ITEM_VALUE != 0 and :TOMAI_MAIN_LINES_BLK.INVENTORY_ITEM IS NOT NULL

Seq = 20
Type = Message
Message Type = Warn
Message Text = Note : This is Parent BOM Item; User cannot do transaction with this item.
Only after Cannibalization this transaction is possible

Seq = 25
Type = Property
Object Type = Global Variable
Target Object = G_ITEM_VALUE
Property Name = VALUE
Value = NULL

seq = 30
Type = Builtin
Builtin Type = GO_ITEM
Argument = TOMAI_MAIN_LINES_BLK.INVENTORY_ITEM

Seq = 40
Type = Property
Object Type = Item
Target Object = TOMAI_MAIN_LINES_BLK.QUANTITY
Property Name = ALTERABLE_PLUS
Value = FALSE

seq = 50
Type = Builtin
Builtin Type = Raise FORM_TRIGGER_FAILURE
Nice Article sathish :)
ReplyDelete