Populate fields in record producer and update them in the table

Kevin Paul
Mega Guru

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?

1 ACCEPTED SOLUTION

Vamshi dhar
Kilo Guru

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

View solution in original post

30 REPLIES 30

@Kevin Paul 

syntax issue in how you are calling GlideAjax

client script line 4 should be having sysparm_name and not sysparam_name

So update as below

ga.addParam('sysparm_name', 'GetAssignedAsset');

Regards
Ankur

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

@Kevin Paul 

Hope you are doing good.

Let me know if I have answered your question.

If so, please mark appropriate response as correct & helpful so that this thread can be closed and others can be benefited by this.

Regards
Ankur

 

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

@Kevin Paul 

Hope you are doing good.

Let me know if I have answered your question.

If so, please mark appropriate response as correct & helpful so that this thread can be closed and others can be benefited by this.

Regards
Ankur

 

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

@Kevin Paul 

Let me know if I have answered your question.

If so, please mark appropriate response as correct & helpful so that this thread can be closed and others can be benefited by this.

Regards
Ankur

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

@Kevin Paul 

Let me know if I have answered your question.

If so, please mark appropriate response as correct & helpful so that this thread can be closed and others can be benefited by this.

Regards
Ankur

 

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader