Solved

Streams message for group of users

  • 9 October 2023
  • 8 replies
  • 172 views

Badge +2

hello; 

 

is there a way to send notifcation to group of users (i dont mean multiple users i mean the object user group ) and not for only one user;

 

thank you in advance for ur help

icon

Best answer by Link 9 October 2023, 15:00

View original

8 replies

Userlevel 7
Badge +22

Hi @mohamed_akrouh 

if you make your own sql code it should be possible but not in standard.

Badge +2

hello,

thank you for you answer 

but what is the function i can use in my sql to do that? 

 

thank you again

Userlevel 5
Badge +14

hello,

thank you for you answer 

but what is the function i can use in my sql to do that? 

 

thank you again

@mohamed_akrouh Hi,

You use the code below.

DECLARE
attr_ VARCHAR2(2000);
info_ VARCHAR2(2000);
objid_ VARCHAR2(20);
objversion_ VARCHAR2(100);

CURSOR openoracleusers IS
SELECT username FROM ifsapp.oracle_account t WHERE account_status = 'OPEN' AND t.username in ('HASANYUCEL','USER1','USER2');

BEGIN
FOR rec_ IN openoracleusers
LOOP
ifsapp.client_sys.clear_attr(attr_);
ifsapp.client_sys.add_to_attr('FROM_USER', 'IFSAPP', attr_);
ifsapp.client_sys.add_to_attr('TO_USER', rec_.username, attr_);
ifsapp.client_sys.add_to_attr('HEADER', 'TEST', attr_);
ifsapp.client_sys.add_to_attr('MESSAGE', 'Whats up man!', attr_);
ifsapp.client_sys.add_to_attr('STREAM_TYPE_DB', 'GENERAL', attr_);
ifsapp.client_sys.add_to_attr('VISIBLE', ifsapp.fnd_boolean_api.decode('TRUE'), attr_);
ifsapp.client_sys.add_to_attr('READ', ifsapp.fnd_boolean_api.decode('FALSE'), attr_);
ifsapp.fnd_stream_api.new__(info_, objid_, objversion_, attr_, 'DO');
--COMMIT;
END LOOP;
END;


 

 

Userlevel 5
Badge +14

For a group, you can use User Groups. Just find the usernames of group members in a User Group.

Userlevel 7
Badge +22

It is a good sql code @hhy38 and it should work.

Thank you for sharing. 👍🏼

Badge +2

thank you so much @Link  and @hhy38  i  will test this and i will let you know 

Badge +2

hello,

thank you for you answer 

but what is the function i can use in my sql to do that? 

 

thank you again

@mohamed_akrouh Hi,

You use the code below.

DECLARE
attr_ VARCHAR2(2000);
info_ VARCHAR2(2000);
objid_ VARCHAR2(20);
objversion_ VARCHAR2(100);

CURSOR openoracleusers IS
SELECT username FROM ifsapp.oracle_account t WHERE account_status = 'OPEN' AND t.username in ('HASANYUCEL','USER1','USER2');

BEGIN
FOR rec_ IN openoracleusers
LOOP
ifsapp.client_sys.clear_attr(attr_);
ifsapp.client_sys.add_to_attr('FROM_USER', 'IFSAPP', attr_);
ifsapp.client_sys.add_to_attr('TO_USER', rec_.username, attr_);
ifsapp.client_sys.add_to_attr('HEADER', 'TEST', attr_);
ifsapp.client_sys.add_to_attr('MESSAGE', 'Whats up man!', attr_);
ifsapp.client_sys.add_to_attr('STREAM_TYPE_DB', 'GENERAL', attr_);
ifsapp.client_sys.add_to_attr('VISIBLE', ifsapp.fnd_boolean_api.decode('TRUE'), attr_);
ifsapp.client_sys.add_to_attr('READ', ifsapp.fnd_boolean_api.decode('FALSE'), attr_);
ifsapp.fnd_stream_api.new__(info_, objid_, objversion_, attr_, 'DO');
--COMMIT;
END LOOP;
END;


 

 

it works :D merci beaucoup

Userlevel 5
Badge +14

@mohamed_akrouh You are welcome :)

Reply