I want to create a custom event related to a custom field. So whenever this custom field is modified, it will send me an email.
In this email i need data contained in the main table attached to this custom field (ex: PERS_TAB), so I want to create an Attribute to get the PERSON_ID.
In the table PERS_CFT, i see only 2 columns: ROWKEY and MYCUSTOMFIELD. All the get method in PERS_API requires the person_ID … and apparetnly I cannot use a SELECT statement for the attibute, so how can I get my employee name and ID when my custom field is modified?
Thanks!
Page 1 / 1
Hi @ludovic.rougean As I understand you need to get the user who modified the record. If so, could you please try fnd_session_api.get_fnd_user() to get the modified user.
First of all, thanks for the tip as I will need this information as well, however my issue on a more global approach was to know how we get data from the _TAB table when the event is linked to the _CFT table.
Both tables are linked through ROWKEY ID. But ROWKEY is not a parameter we can use in a Get method. For exemple the GET_Name method required the Person_ID which is not available in the _CFT table. So i guess there is a trick somewhere.
Hi, you may have to white a cursor get the required data by passing the PERS_CFT table ROWKEY. Basically the custom table rowkey = standard view objkey. Find below example how you can use,
SELECT person_id FROM PERS WHERE OBJKEY = '&NEW:ROWKEY';
Furthermore, if you required to get the user who did the changes you can use below method,
Fnd_Session_API.Get_Fnd_User;
Hope this gives you an idea of what you required.
Thanks, Br, Shehan
Good morning and thanks again, that seemed to be a very idea !
However I get the following error message.
It seems that select statement is not accepted inside method and honestly i never saw any pre-existing exemples.
Hi, I finally found a solution to this problem !
It’s more a hack than a clean solution but that works pretty well. Actually I created another custom field retrieving the Person_Id and thus it created a Get value in the custom API that retrieves the person ID, and now I can use it in another Get method to get the name or whatever.