cancel
Showing results for 
Search instead for 
Did you mean: 

Stored Procedure Notification

Former Member
0 Kudos

Hi

   I have created some UDF fields (U_field1,U_field2,U_field3,U_field4) at Header Level . I want when user closes Purchase Order none of the blank fields should be blank. One field data type is Date

Thanks

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi,

This notification throw error msg, even if any one of those 4 UDF is null.

I think this helps you.

If @object_type = 22 and @transaction_type = 'L'

Begin

If exists (Select T0.DocEntry from OPOR T0 where (T0.UDF is null OR T0.UDF2 IS NULL OR T0.UDF3 IS NULL OR  T0.UDF4 IS NULL) AND T0.DocEntry =@list_of_cols_val_tab_del)

Begin 

select @error=2,@error_message  = 'Field is missing' 

 

End

End

Regards

Pravin Jebadoss.

former_member325312
Active Contributor
0 Kudos

HI fine the SP below

If(@object_type = '22' and (@transaction_type = 'A' or @transaction_type = 'U'))

Begin

IF EXISTs (SELECT T0.DocEntry

FROM OPOR T0

WHERE T0.DocEntry = @list_of_cols_val_tab_del and  (T0.U_UDf1 Is Null OR

T0.U_UDf2  Is Null  OR T0.U_UDf3 Is Null OR T0.U_UDf4 Is Null)

Begin

SET @error = 109

SET @error_message = N'Please check the four Udfs '

End

END

Former Member
0 Kudos

Hi

Try this:

IF (@transaction_type='L') AND @Object_type = '22

begin

IF exists (select  t0.docentry from OPOR t0 where (U_field1 is null and U_field2 is null and U_field3 is null and U_field4 is null) and t0.docentry=@list_of_cols_val_tab_del )

     begin

          SET @error = 86

          SET @error_message = 'Please enter udf1,udf2,udf3,udf4'

     end

end