cancel
Showing results for 
Search instead for 
Did you mean: 

Item Master Data Notification

ramco1917
Participant
0 Kudos

Hi

I want only user with User Id 4 should be able to Add/Update Item if Item Group Code is 102

Thanks

Accepted Solutions (1)

Accepted Solutions (1)

davidalexandre
Discoverer
0 Kudos

Olá, veja se ajuda!

IF (:object_type = '4' AND (:transaction_type = 'A' OR :transaction_type = 'U'))

	THEN 

		DECLARE OITM_ItmsGrpCod INT;
		DECLARE OITM_ItmsGrpNam NVARCHAR(100);
		DECLARE OITM_UserSign INT;
		DECLARE OITM_UserSign2 INT;
		
		DECLARE CURSOR Currs FOR
		
		SELECT 
		B."ItmsGrpCod", 
		B."ItmsGrpNam",
		A."UserSign",
		A."UserSign2"
		FROM OITM A 
		INNER JOIN OITB B ON A."ItmsGrpCod" = B."ItmsGrpCod" 
		WHERE A."ItemCode" = :list_of_cols_val_tab_del; 
		
		BEGIN	
		OPEN Currs;
		FETCH Currs 
		INTO OITM_ItmsGrpCod, OITM_ItmsGrpNam, OITM_UserSign, OITM_UserSign2;
		WHILE NOT Currs::NOTFOUND DO
		
		IF (:OITM_ItmsGrpCod = 102 AND (:OITM_UserSign <> 4 OR :OITM_UserSign2 <> 4)) 
			THEN
				error := 99;
				error_message := 'Somente o usuário (ID 4) pode realizar alterar/criar produto(s) do grupo de itens [' || :OITM_ItmsGrpNam || '].';
		END IF;
		
		FETCH Currs 
		INTO OITM_ItmsGrpCod, OITM_ItmsGrpNam, OITM_UserSign, OITM_UserSign2;
		END WHILE;
		CLOSE Currs;
		END;
END IF;
ramco1917
Participant
0 Kudos

Hi David

If i want notification in case of Update only then what needs to be changed.

Thanks

davidalexandre
Discoverer
0 Kudos

Hi, R S.

Just leave it like that

IF (:object_type = '4' AND transaction_type = 'U')

Answers (1)

Answers (1)

rasmuswulff_jensen
Active Contributor
0 Kudos

If you do not wish to write the code yourself an Add-on like B1 Usability Package have the option to create such rules