Dear Code experts,
Currently we have granted all sites access to our spare part users in order to see the available stock in each site.
I have a requirement from business that this authorization must be controlled as below;
we have to divide all stock Clerk into 2 groups;
Group 1 : they can only maintain their default site’s inventory
Group 2 : They can maintain their default site’s inventory + other sites inventory
In order to achieve this, I created a custom event on Inventory_part_in_stock_tab,
below is the code and it works for group 1. but for group 2 event doesn’t allowed to do transaction.
I am not a developer so Am I missing something in below code ?
DECLARE
DEF_ VARCHAR2(10);
MULTI_ VARCHAR2(100);
CURSOR C_ALLOW_multi_ IS SELECT CONTRACT from USER_ALLOWED_SITE_CFV where userid = '&FND_USER' AND CF$_ALLOW_MULTI_SITE_DB = 'Y';
BEGIN
OPEN C_ALLOW_multi_;
FETCH C_ALLOW_multi_ INTO MULTI_;
CLOSE C_ALLOW_multi_;
IF ( '&NEW:CONTRACT' <> '&DEF_USER' ) OR ( '&NEW:CONTRACT' in 'MULTI_') THEN
ERROR_SYS.RECORD_GENERAL('INVPART','PART: You are not allowed to do transactions for this business site');
END IF;
END;
I have added a custom field to Site per user window in order to get group 2 users available sites