on 01-13-2015 6:24 AM
Hi Dear,
How can I add control on stored procedure to block delete specific type of Draft Document, for example AR Invoice draft.
Following code not working, is there anyway to block it?
IF @object_type = '112'
BEGIN
IF @TRANSACTION_TYPE = 'D'
BEGIN
SELECT @error = -1, @error_message = 'Remove AR Invoice draft is not allowed'
FROM ODRF T0
WHERE T0.ObjType='13' AND T0.DocEntry = @list_of_cols_val_tab_del
END
END
Please Help
Thanks in advance
Daisuki
Hi,
Try:
IF @object_type = '112'
BEGIN
IF @TRANSACTION_TYPE = 'U'
BEGIN
SELECT @error = -1, @error_message = 'Remove AR Invoice draft is not allowed'
FROM ODRF T0
WHERE T0.ObjType='13' AND T0.DocEntry = @list_of_cols_val_tab_del
END
END
Thanks & Regards,
Nagarajan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you Nagarajan,
but I intended to block for selected type of draft to reserve the running number, therefore, I cant use authority management function for all kind of drafts,
Anyway I'd found a way to solve it,
I created a [ADRF] table to store DraftKey(int) and ObjType(nvarchar) whenever draft is added.
IF @object_type = '112'
BEGIN
IF @TRANSACTION_TYPE = 'D'
BEGIN
SELECT @error = -1, @error_message = 'Remove AR Invoice draft is not allowed'
FROM ADRF T0 -- Check ADRF instead of ODRF
WHERE T0.ObjType='13' AND T0.DraftKey= @list_of_cols_val_tab_del
END
END
Thank you once again
User | Count |
---|---|
88 | |
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.