Hi, when creating a new contact record I want to assign values for Department and Location based on the group of the current user.The retrieval of departmentId and locationId for a specific user based on his/her group was easy.
Now I want to assign these values (client-side) to the Department and Location lookups when creating a record.I use the setFieldValue api to do so, but the value is not set in the lookup field.
How can I accomplish this?
You can achieve this by following way
1) Create a relationship between contact and user object
2) You get a user lookup field added to contact object, Edit User lookup field you will see checkbox stating " By default attach the current user to newly created Contact" just enable this checkbox.
3) Go to Contact pages and edit New Record page of Contact -> Edit -> Page Designer and make user lookup field as hidden
4) Now whenever new Contact object is created you can see Location, Department and Function will be selected with Group value attached to current user
For more details check this documentation page documentation.progress.com/.../
Please let me know if this helps.
In my previous post I asked you to make User lookup field as hidden from Page Designer, I think you can remove it from New Record page itself still you will see Location, Department and Function associated with Current User group will be pre-populated on respective lookup fields in New Record page just make sure you follow first two steps.