cancel
Showing results for 
Search instead for 
Did you mean: 

Validate cardcode before add Sales Order

Former Member
0 Kudos

Hi Experts,

Can anyone guide me on how I can add a validation in my SP_TransactionNotification?

Everytime before I add a Sales Order, I will like to check that my ORDR.CardCode does not begin with a "L", if it begins with an "L" then do not allow to add the Sales Order.

Much Thanks in Advance!

Warmest Regards,

Chinho

Accepted Solutions (1)

Accepted Solutions (1)

former_member204969
Active Contributor
0 Kudos

Insert this in your SBO_SP_TransactionNotification stored procedure after the line

-- ADD YOUR CODE HERE

IF @transaction_type = 'A' AND @object_type = '17' 
BEGIN
If exists 
(Select t.CardCode From ORDR t
Where substring(t.CardCode,1,1)='L' 
  and t.DocEntry=@list_of_cols_val_tab_del)
begin
SET @error = 1 
SET @error_message = N'Forbidden partner !'
end
END

Former Member
0 Kudos

Works like a charm! Thanks!!

Answers (0)