on validating quantity in sales line a error message should be pop if the item is blocked on item card
on validating quantity in sales line a error message should be pop if the item is blocked on item card
Hi,
As Amit mentioned please go with Event Subscriber in that case, if its not working, but it strange, how its possible, its working in my system with same code, can you please check if you anyother code related this.
Hi,
Use the below link for reference for doing the above activity.
https://erpconsultors.com/call-number-field-onvalidate-trigger-via-eventsubscriber/
Regards
Amit Sharma
Hi Nitin Verma I followed exact same steps. I added the code on page extension for sales line and I blocked a item in the item card and tried to add the same blocked item to the sales line still no any error messages .
Hi, I don't think this needs to be customized, the standard system has some controls about the Blocked item.
More details: How to block items (Block, Sales Blocked, and Purchasing Blocked)
Hope this helps.
Thanks.
ZHU
Hi,
I am getting the error while using the same code, please brief me your steps.
Nitin Verma Hi, still it is the same . no changes
Then please move your code into Page extension
pageextension 50104 MyExtension extends "Sales Order Subform"
{
layout
{
modify(Quantity)
{
trigger OnAfterValidate()
var
ItemS: Record Item;
TEXT2: Label 'This item is blocked %1 ';
begin
IF rec.Type = Enum::"Sales Line Type"::Item then
if ItemS.Get(rec."No.") then
if ItemS.Blocked then
Error(TEXT2, ItemS."No.");
end;
}
// Add changes to page layout here
}
}
Hi Nitin Verma thanks for the replies
IN CASE: if I block a item in item card ex: 0001 and if I tried to add 0001 item in the sales line. and on validating quantity a error should be shown but mentioned code doesnot give any error . am i missing something??
As soon as you enter the Item No. it automatically validate the Quantity field, is it working my side
Thanks.
Nitin Verma the above table extended code has no effect is there any solution?
André Arnaud de Cal... 291,711 Super User 2024 Season 2
Martin Dráb 230,458 Most Valuable Professional
nmaenpaa 101,156