RE: Restricting Total on Receivings Transaction Entry screen
Hi Megan,
Please find the below sample script that may help you to resolve this.
Startup script:
l_result = Trigger_RegisterFocus(anonymous('Post Button' of window POP_Receivings_Entry of form POP_Receivings_Entry), TRIGGER_FOCUS_PRE, TRIGGER_AFTER_ORIGINAL, script Validation);
if l_result <> SY_NOERR then
warning "Focus trigger registration failed for POP_Receivings_Entry.";
end if;
Validation Script:
local currency Total;
Total = (Subtotal of window POP_Receivings_Entry of form POP_Receivings_Entry) - ('Trade Discount Amount' of window POP_Receivings_Entry of form POP_Receivings_Entry)
+ ('Freight Amount' of window POP_Receivings_Entry of form POP_Receivings_Entry) + ('Misc Amount' of window POP_Receivings_Entry of form POP_Receivings_Entry)
+ ('Tax Amount' of window POP_Receivings_Entry of form POP_Receivings_Entry);
if (Total > 500.00) then
disable 'Post Button' of window POP_Receivings_Entry of form POP_Receivings_Entry;
lock 'Post Button' of window POP_Receivings_Entry of form POP_Receivings_Entry;
end if;