Skip to main content
Solved

Custom Event related to a custom field


Forum|alt.badge.img+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!

Best answer by ludovic.rougean

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.

View original
Did this topic help you find an answer to your question?
This topic has been closed for comments

5 replies

Kelum Pradeep Kumara
Superhero (Employee)
Forum|alt.badge.img+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


Forum|alt.badge.img+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. 


EntShehaM
Hero (Partner)
Forum|alt.badge.img+5
  • Hero (Partner)
  • 30 replies
  • March 18, 2022

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


Forum|alt.badge.img+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.

 


Forum|alt.badge.img+9
  • Author
  • Hero (Customer)
  • 54 replies
  • Answer
  • May 30, 2022

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.


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings