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.