on 08-17-2015 7:37 AM
Hello Everyone,
im doing a draft Goods Issue.
this is my requirement. i want to prevent adding draft Goods Issue when my UDF called "U_HEQUIPT" is null and Values must be VALID base on my UDT called "@HEQUIPT". currently this my SP_TransactionNotification code, but it only block adding the draft Goods Issue if UDF "U_HEQUIPT" is EMPTY but it does not check if it is Valid Values base on my UDT "@HEQUIPT". please see image attached
IF (@object_type = '112') and (@transaction_type IN (N'A', N'U'))
BEGIN
IF EXISTS (SELECT T0.Docentry from ODRF T0 Inner Join DRF1 T1 ON T0.Docentry=T1.Docentry where
T1.DocEntry = @list_of_cols_val_tab_del and (T1.U_HEQUIPT is null or T1.U_HEQUIPT ='' ) and T0.[ObjType] = '60')
BEGIN
Select @error = 10, @error_message = N'Pls. Fill-up Assetcode'
END
END
here is my second code but still cannot get the result i want.
IF (@object_type = '112') and (@transaction_type IN (N'A', N'U'))
BEGIN
IF EXISTS (SELECT T0.Docentry from ODRF T0 Inner Join DRF1 T1 ON T0.Docentry=T1.Docentry where
T1.DocEntry = @list_of_cols_val_tab_del and (T1.U_HEQUIPT Not In(SELECT T3.[Code] FROM [dbo].[@HEQUIPT] T3)) and T0.[ObjType] = '60')
BEGIN
Select @error = 10, @error_message = N'Pls. Fill-up AssetCode'
END
END
Please help.
thank you.
Fidel
Message was edited by: Avelino Fidel
Try this
IF (@object_type = '112') and (@transaction_type IN (N'A', N'U'))
BEGIN
IF EXISTS (SELECT T0.Docentry from ODRF T0 Inner Join DRF1 T1 ON T0.Docentry=T1.Docentry where
T1.DocEntry = @list_of_cols_val_tab_del and isnull(T1.U_HEQUIPT,'')='' ) and T0.[ObjType] = '60')
BEGIN
Select @error = 10, @error_message = N'Pls. Fill-up Assetcode'
END
END
Regards
Kennedy
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Kennedy,
thanks for the response.
the script you had given will only block to add draft if my UDF "U_HEQUIPT" is null, but it does not evaluate if the given value in UDF "U_HEQUIPT" is valid based on "@HEQUIPT" UDT.... that is my problem, i can only trap if the field is empty or null but i cannot trap if the user had entered a valid value in the field....
please help with my requirement, every input is highly appreciated.
thank you..
Fidel
Try this
User | Count |
---|---|
107 | |
12 | |
11 | |
6 | |
5 | |
4 | |
4 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.