Skip to Content
0
Sep 22, 2020 at 06:40 AM

Sales order stored procedure

101 Views Last edit Dec 10, 2020 at 07:13 AM 3 rev

Hi Experts,

I need to validate the sales order through SP.

If i choosing a sales order BP code as 'C137680' then i need to select my UDF field U_Material as 'Inside' option is mandatory. I am not suppose to choose other options.

I have created the below SP its adding without blocking(If i create other UDF options also)

IF @transaction_type in(N'A', N'U') AND @object_type = '17'
BEGIN
if exists (Select CardCode from ORDR T0 where t0.CardCode='C137680' and
t0.U_Materials = ('INSIDE')
and t0.DocEntry=@list_of_cols_val_tab_del )
begin
SET @error = 10
SET @error_message = N'Inside is mandatory'
end
END

Thanks

Vinoth