Skip to main content
Question

Custom Field with #USER_ID# as the Context Substitution Variable

  • January 18, 2023
  • 4 replies
  • 545 views

Forum|alt.badge.img+2

I have created a custom page with page type ‘Table Window’.  One of the fields is Entered_By using the context substitution variable of #USER_ID#.  When a record is duplicated, the value in Entered_By is copied from the duplicated record instead of populating with the user id of who is adding the record.  Is there any way around this issue?

4 replies

Forum|alt.badge.img+10
  • Hero (Customer)
  • 61 replies
  • January 19, 2023

Hi, how or where did you set up the value by default with #USER_ID# ?


Charith Epitawatta
Ultimate Hero (Employee)
Forum|alt.badge.img+31
  • Ultimate Hero (Employee)
  • 1094 replies
  • January 19, 2023

Hi @cbilodeau,

I do not think there is a way around this. This is how duplicate function normally works. It will try to copy all the values from the duplicating record. The user would have to manually change any of the values as necessary before saving the record.

Hope this helps!


Forum|alt.badge.img+10
  • Hero (Customer)
  • 61 replies
  • January 19, 2023

I think it is possible if you create an event that runs in the background because it will force recalculating the value every time you insert a new line.

There is an article on this subject if you understand a bit PL/SQL:

https://dsj23.me/2021/08/27/tips-to-avoid-mutating-table-error-in-ifs-event-actions/


Forum|alt.badge.img+2
  • Author
  • Do Gooder (Customer)
  • 3 replies
  • January 20, 2023

When creating the custom field, there is an option on the Properties to select a default value; I used the Context Substitution Variable to select #USER_ID#.

Unfortunately, the custom field is set to Read Only so that a new record can’t be entered with someone else’s user id.

I’ll take a look at the article for future reference.  For this instance, I set up an event action that will not allow saving the record if the user adding the record is not the user in the custom field.  If so, they are instructed via the event action to manually enter the record instead of duplicating.