Skip to main content
Solved

How to use general parameters in event action

  • August 20, 2026
  • 2 replies
  • 48 views

Link
Superhero (Customer)
Forum|alt.badge.img+23
  • Superhero (Customer)

Dear developers,

I'm having a problem when I create an event action of the SQL type.

I want to use general parameters such as:

#PERSON_NAME#

#TODAY#

etc.

How can I use them in PL/SQL code?

‘#PERSON_NAME#’ gives me #PERSON_NAME#

‘PERSON_NAME#’ gives me &IFS Application Owner

 

Thank you in advance.

Best answer by ashen_malaka_ranasinghe

Hi ​@Link,

There are two distinct substitution systems, and they live in different layers:

Type Syntax Intended for
Event parameters (event-specific) &PARAM_NAME Message, subject, and SQL command text
General / Context Substitution Variables #PARAM_NAME# Message and subject text fields only

 

The docs explicitly state:

It is not possible to use Context Substitution Variables as arguments to Custom Attributes. Fnd_User_API.Get_Description(#USER_ID#) is not allowed.

 

Refer to Manage Event Actions (26R1) for more information.

This is not limited to Custom Attribute definitions. The same restriction carries into Execute Online SQL PL/SQL code. The #...# variables are processed as plain text substitution in message/subject fields but are not reliably resolved when embedded inside PL/SQL code in the SQL command block.

This explains exactly what you're seeing:

  • '#PERSON_NAME#' → #PERSON_NAME# - the #...# marker is not substituted in the SQL code context, so it survives as a literal string.
  • 'PERSON_NAME#' → appears to resolve to &IFS Application Owner - the trailing # without the leading one causes the event variable processor to pick up PERSON_NAME as an event &-prefixed parameter (if one exists on that event), and the Application Owner identity is what it holds in that context.

For PL/SQL code inside an Execute Online SQL action, call the IFS framework APIs directly instead of relying on #...# general parameters:

DECLARE
v_person_name VARCHAR2(200);
v_today DATE;
v_user VARCHAR2(30);
BEGIN
-- Current IFS user login
v_user := Fnd_Session_API.Get_Fnd_User;

-- Full person/display name for that user
v_person_name := Fnd_User_API.Get_Description(Fnd_Session_API.Get_Fnd_User);

-- Today's date
v_today := TRUNC(SYSDATE);

-- Use them normally in your logic
My_Package_API.Do_Something(v_person_name, v_today);
END;

If you need an event-specific parameter (e.g., ORDER_NO from the triggering event), the & substitution does work in the SQL command text:

BEGIN
My_Package_API.Process('&ORDER_NO', '&CUSTOMER_NO');
END;

Those &PARAM_NAME tokens are replaced with their values before Oracle sees the SQL.

To find all available variables navigate to:

Solution Manager → User Interface → Context Substitution Variables

This window contains all available variables (#TODAY#, #PERSON_ID#, #USER_ID#, etc.) and the PL/SQL function each one executes.

In short: For Execute Online SQL event actions, use the #VARIABLE# syntax directly in the SQL statement. For PL/SQL code, use the underlying function that the context substitution variable maps to.

Refer to What are #today# #Person_ID# etc? Is there a complete list? | IFS Community for more information.

2 replies

ashen_malaka_ranasinghe
Superhero (Employee)
Forum|alt.badge.img+14

Hi ​@Link,

There are two distinct substitution systems, and they live in different layers:

Type Syntax Intended for
Event parameters (event-specific) &PARAM_NAME Message, subject, and SQL command text
General / Context Substitution Variables #PARAM_NAME# Message and subject text fields only

 

The docs explicitly state:

It is not possible to use Context Substitution Variables as arguments to Custom Attributes. Fnd_User_API.Get_Description(#USER_ID#) is not allowed.

 

Refer to Manage Event Actions (26R1) for more information.

This is not limited to Custom Attribute definitions. The same restriction carries into Execute Online SQL PL/SQL code. The #...# variables are processed as plain text substitution in message/subject fields but are not reliably resolved when embedded inside PL/SQL code in the SQL command block.

This explains exactly what you're seeing:

  • '#PERSON_NAME#' → #PERSON_NAME# - the #...# marker is not substituted in the SQL code context, so it survives as a literal string.
  • 'PERSON_NAME#' → appears to resolve to &IFS Application Owner - the trailing # without the leading one causes the event variable processor to pick up PERSON_NAME as an event &-prefixed parameter (if one exists on that event), and the Application Owner identity is what it holds in that context.

For PL/SQL code inside an Execute Online SQL action, call the IFS framework APIs directly instead of relying on #...# general parameters:

DECLARE
v_person_name VARCHAR2(200);
v_today DATE;
v_user VARCHAR2(30);
BEGIN
-- Current IFS user login
v_user := Fnd_Session_API.Get_Fnd_User;

-- Full person/display name for that user
v_person_name := Fnd_User_API.Get_Description(Fnd_Session_API.Get_Fnd_User);

-- Today's date
v_today := TRUNC(SYSDATE);

-- Use them normally in your logic
My_Package_API.Do_Something(v_person_name, v_today);
END;

If you need an event-specific parameter (e.g., ORDER_NO from the triggering event), the & substitution does work in the SQL command text:

BEGIN
My_Package_API.Process('&ORDER_NO', '&CUSTOMER_NO');
END;

Those &PARAM_NAME tokens are replaced with their values before Oracle sees the SQL.

To find all available variables navigate to:

Solution Manager → User Interface → Context Substitution Variables

This window contains all available variables (#TODAY#, #PERSON_ID#, #USER_ID#, etc.) and the PL/SQL function each one executes.

In short: For Execute Online SQL event actions, use the #VARIABLE# syntax directly in the SQL statement. For PL/SQL code, use the underlying function that the context substitution variable maps to.

Refer to What are #today# #Person_ID# etc? Is there a complete list? | IFS Community for more information.


Link
Superhero (Customer)
Forum|alt.badge.img+23
  • Author
  • Superhero (Customer)
  • August 21, 2026

Hello ​@ashen_malaka_ranasinghe 

thank you very much for clarifying.

This time, I solved it as follows:

For ‘#PERSON_NAME#’  I used API Person_Info_API.Get_Name(Fnd_Session_API.Get_Fnd_User)

For ‘#NOW#’ I used SYSDATE