Question

Condition Field

  • 1 February 2024
  • 5 replies
  • 156 views

Userlevel 1
Badge +3

Hello everyone, 

I’m trying to make a field editable only to precise user

 

 

Is that possible? if so what kind of condition should i use? like #UserID = username or something like that.


5 replies

Userlevel 5
Badge +11

As far as I am concerned the Editable option for a field only takes true or false in Page Designer.

 

There are a few approaches.

  1. Use 2 different contexts, one that allows editing of the field and the other doesn’t.  Might be overkill as you have 2 contexts to maintain with the obvious difference being the editable field.
  2. Use a custom event triggered on insert and update of that specific field, and have a workflow or plsql code to raise an error based on the logged in user. 
Userlevel 6
Badge +15

@IFSRUNINNOVAL as @Technical Outlaws also specified, when I had to work on such a requirement I was going on the ‘2 different contexts’ route.

Userlevel 5
Badge +12

@IFSRUNINNOVAL looks like you’re ifs IFS Cloud 22R2 or prior.

On 23R1 and newer versions, there is a new Conditional Fields capability that does this although the syntax is slightly different. See the 23R1 documentation here: https://docs.ifs.com/techdocs/23r1/040_tailoring/225_configuration/200_client_configurations/310_conditional_fields/#showhide_fields_conditionally

With this approach, you wouldn’t need to fiddle with multiple contexts. Time to start planning an upgrade, perhaps? ;-)

Best regards,

Rukmal

Userlevel 1
Badge +3

@Rukmal Fernando we have the 23R1 SU7 version but we cant figure out how to get dynmicly the userid

 

What type of commande can i type to be able to retrieve the userid ?

All i can find are some commande to get values from records such as record.Field or parent.record….etc

 

Thank’s in advance

Userlevel 5
Badge +12

@IFSRUNINNOVAL as far as I know, you cannot use the User ID  in a conditional expression.

If you must differentiate based on user ID, I think @Technical Outlaws’s first solution of using two different configuration contexts is practical, where one has your field always editable and the other has it readonly. Configuration context can then be defined based on your user ID (e.g.: https://docs.ifs.com/techdocs/23r2/040_tailoring/225_configuration/260_context_based_configuration/#map_a_custom_context_to_a_user_or_a_group_of_users)

Reply