Hi,
try this SPTN for sales order. For all other documents just change the object code.
IF
@transaction_typeIN('A')AND
(
@Object_type='17')
BEGIN
If
EXISTS(SELECTT0.docentry
FROM
RDR1T0
WHERE
T0.docentry=@list_of_cols_val_tab_deland
T0.[OwnerCode]ISNULL)
Begin
SET
@error= 1
SET
@error_message='Please enter Owner Code'
End
END
Hope helpful.
Thanks & Regards,
Nagarajan