on 09-22-2020 7:40 AM
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
Hi,
Your stored procedure is working if you change condition <> 'INSIDE'. Make sure, you have added above stored procedure in correct company.
Regards,
Nagarajan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello
You want use ti select inside if customer code is 'C137680' if this is the case then you need to have condition in query where t0.CardCode='C137680' and t0.U_Materials <> ('INSIDE') then your query returns values in transaction procedure and system will stop.
Try the below code
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hola buen día,
también puedes usarlo a través del case
CASE WHEN T0.CardCode = 'C137680' AND T0.U_Materials <> 'INSIDE'
THEN 'ESCRIBIR MENSAJE DE ERROR' END
¿Esta validación solo aplicara para el cliente 'C137680', o podría haber mas clientes?
Te recomiendo que agregues un UDF en la OCRD, el cual te sirva para indicar si quieres que aplique o no la validación, de esta manera lo haces mas configurable.
Saludos.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
7 | |
6 | |
4 | |
3 | |
3 | |
3 | |
3 | |
3 | |
2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.