on 11-19-2016 6:28 AM
Hi Experts
My users should only allow to add AR Invoice (Service Type) using GL code from . OACT.GroupMask = 4.
If any of the users try to add AR Invoice (Service Type) by selecting GL code which does not belongs to Group Mask = 4 , then they should be blocked by SPT
This in need to be applicable only for Service type AR invoice
pls help me with SPT, to solve this issue
Regrads
Hi Shahan
For achieve what you need use this:
IF (@Object_Type='13') AND (@transaction_type in ('A', 'U')) BEGIN
--Do your validation here
-- To validate if is a Service Type document, look the field DocType = 'S'
END
Kind Regards,
Diego Lother
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi lother
I try like this way, but not Blocking,pls help me
IF @transaction_type IN ('A','U') AND @Object_type = '13'
BEGIN
/*Generate error IF WITHOUT COST CENTER */
IF EXISTS (SELECT INV1.[DocEntry] FROM INV1 INNER JOIN OINV ON INV1.[DocEntry] = OINV.[DocEntry]
Inner join OACT on INV1.acctcode = OACT.AcctCode
WHERE OACT.GroupMask = 4
AND OINV.DocType = 'S' and
INV1.DocEntry = @list_of_cols_val_tab_del)
BEGIN
SELECT @Error = 13, @error_message = 'You had selected Wrong GL CODE, Select The GL Code from Turnover Drawer, For any Clarification Pls contact Finance Department'
END
end
Hi Shahan,
There is a small mistake in your validation.
IF @transaction_type IN ('A','U') AND @Object_type = '13'
BEGIN
/*Generate error IF WITHOUT COST CENTER */
IF EXISTS (SELECT T0.DocEntry FROM INV1 T0 INNER JOIN OINV T1 ON T1.DocEntry = T1.DocEntry
INNER JOIN OACT T2 ON T0.acctcode = T2.AcctCode
WHERE T2.GroupMask <> 4 AND T1.DocType = 'S' and
T0.DocEntry = @list_of_cols_val_tab_del)
BEGIN
SET @error = 13
SET @error_message = 'You had selected Wrong GL CODE, Select The GL Code from Turnover Drawer, For any Clarification Pls contact Finance Department'
END
END
For your purpose in where clause you should use GroupMask <> 4.
Kind Regards,
Diego Lother
User | Count |
---|---|
95 | |
11 | |
11 | |
6 | |
6 | |
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.