on 05-26-2014 6:53 AM
Dear Expert,
I want to create a transaction notification for my user defined form. I have a matrix on my form which has a field as 'Code'. I want that this field (On Row Level) should have unique values all the time while adding or updating the form.
Object Type: MaterialMaster
Table Name: MaterialDetails
FieldName: U_Code
Plz help me to get this notification.
Regards
Hi Amit,
Please check below query.
IF @object_type = 'MaterialMaster' AND @transaction_type IN('A','U') and @error = 0
BEGIN
IF ( SELECT COUNT(*)
FROM MaterialDetails A
WHERE A.U_Code IN (SELECT U_Code FROM MaterialDetails WHERE U_Code = @list_of_cols_val_tab_del)
GROUP BY A.U_Code
HAVING COUNT(*) > 1
) >1
BEGIN
set @error = -10
set @error_message = 'You can not Add Dublicate Code'
END
End
Hope this help
--
--
Regards::::
Atul Chakraborty
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Dear All,
Plz reply to my question. It is very important.
Regards
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I have tried this. but it is not working for me. Plz help me:
IF @transaction_type IN ('A','U') AND @object_type = 'MaterialMaster'
BEGIN
IF EXISTS
(
select T0.U_Code from [@MaterialDetails] T0 where
T0.U_Code = @list_of_cols_val_tab_del
)
BEGIN
SELECT @Error = -1, @error_message = 'Number already exist.'
END
END
Regards
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
102 | |
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.