Skip to main content

Hello,
I am trying to send a Stream Notifications in PL / SQL with an event.
Is it possible ? If so, what should I call in my code to send a message to a user?

I don't want to use the "Streams message" action type because this message is sent according to the conditions in the PL / SQL code.

Thank you in advance !

Hi @TheoB,

Given below is a code example on how to use the FND_STREAM_API, with some place holder values.
 

DECLARE
  stream_ fnd_stream_tab%ROWTYPE;
BEGIN
  stream_.from_user := 'FROM_FND_USER';
  stream_.to_user := 'TO_FND_USER';
  stream_.header := 'MESSAGE_TITLE';
  stream_.message := 'MESSAGE_TEXT/BODY';
  stream_.url := 'URL_TO_NAVIGATE_TO';
  stream_.stream_type := Fnd_Stream_Type_API.DB_GENERAL; -- Please use this type
  stream_.lu_name := 'LU_CREATING_THE_STREAM';
   
  Fnd_Stream_API.New_Stream_Item(stream_);
--Might need a commit in some cases
END;


Things to consider:

  • Do not over use this functionality. It could flood the Streams panel, and make it unusable for general use.
  • Please set the stream_type to Fnd_Stream_Type_API.DB_GENERAL. Do not set it to any other type. (Stream types are color coded and could cause confusion to the users. The type General will be shown as Event Messages in the client. )
  • Allow the stream message to be commited together with the main transaction/process (transaction which is doing the actual data change). No separate commit is required.
  • There can be only one "TO" user, and one "FROM" user for a given streams message (From and To can be the same user). If you need to send information to multiple users, then call this method multiple times.
  • Try to keep the Title to a maximum of 50-75 characters, and message to maximum 200. The actual database limits are larger.
  • URL will be the URL to navigate when the click on the navigate button inside the individual Stream message.
  • Streams messages are not translatable.

Hope this helps!