- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-09-2020 12:13 AM
I have a requirement to create a record producer to update the user table. When the record producer is opened, the person who is logged in, all his data from the user table are automatically populated in their related variables of the record producer, then the user can update the values and on submit , the existing record in the user tables gets updated without creating a new record. Can someone help me on this? On how to start?
Solved! Go to Solution.
- Labels:
-
Personal Developer Instance
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-09-2020 12:24 AM
Hi Kevin,
Please follow the below steps, your requirement will be fulfilled:
1. First, create a record producer and create all the necessary variables in the record producer.
2. Create an onload script, to update all the logged-in user details in the Record Producer.
3. Write Record Producer script, such that first if should query the User table to check the record exists for the Logged-in user or not. If exist simply update the fields what he has updated in Record producer, If the record doesn't exist then simply create a record in User Table.
Please Feel free, to ping me if you stuck somewhere.
Please mark it as Correct/Helpful if it fulfills your requirement
Thanks
Vamshidhar

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-09-2020 01:48 AM
Fine, then you can check for variables that are pre-populated in the script.
Suppose, email address of User is pre-populated then you can simply use
var emailis=producer.variable_name_of_email

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-09-2020 05:26 AM
Hi Kevin,
Did you try approach as above? Tested in my PDI & it works.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-09-2020 12:24 AM
Hi Kevin,
Please follow the below steps, your requirement will be fulfilled:
1. First, create a record producer and create all the necessary variables in the record producer.
2. Create an onload script, to update all the logged-in user details in the Record Producer.
3. Write Record Producer script, such that first if should query the User table to check the record exists for the Logged-in user or not. If exist simply update the fields what he has updated in Record producer, If the record doesn't exist then simply create a record in User Table.
Please Feel free, to ping me if you stuck somewhere.
Please mark it as Correct/Helpful if it fulfills your requirement
Thanks
Vamshidhar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-09-2020 01:04 AM
to update all the logged-in user details in the Record Producer, is script include and glide ajax needed?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-09-2020 01:16 AM
You can use getReference(), to populate all logged-in User details in Record Producer. If you want to add this Record Producer in Service Portal it's not a best practice to use getReference().
In Simple Words Kevin, If it's in Service Portal go with Glide Ajax and Script include. If not portal then you can make use of getReference()in onload Client script.
Let me know if you need a code snippet