Solved

Custom Event related to a custom field

  • 17 March 2022
  • 5 replies
  • 634 views

Userlevel 5
Badge +9

Hi,

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!

icon

Best answer by ludovic.rougean 30 May 2022, 17:48

View original

This topic has been closed for comments

5 replies

Userlevel 7
Badge +18

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.

Please refer the below community thread as well.
How to get current user in IFS to a custom field? | IFS Community

current user Ifs | IFS Community

Userlevel 5
Badge +9

Hi Kelum,

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. 

Userlevel 3
Badge +5

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

Userlevel 5
Badge +9

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.

 

Userlevel 5
Badge +9

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.