The CreatorCon Call for Content is officially open! Get started here.

Insert new record

charanpreet
Kilo Expert

I am trying to insert a new record to another table.

Issue is the record gets inserted but with the blank values.

var gr = new GlideRecord('asmt_m2m_category_assessment');

gr.initialize();

gr.assessment_record = current.vendor;

gr.category = current.u_it_resource_subtower;

                              gs.addInfoMessage(gr.assessment_record);

                              gs.addInfoMessage(gr.category);

gr.insert();

Output : for assessable record : sysid

gr.category : correct value

But the record created in the table does not have any value for any of the two columns.

1 ACCEPTED SOLUTION

I used getDisplayValue() and setDisplayValue and it worked.


View solution in original post

14 REPLIES 14

I have admin role


if you have admin role and you have access to see all the data.


is there already data present in the table or empty?


What is the field type of the assessment and category?


try with


gr.assessment_record = current.vendor.getDisplayValue();


gr.category = current.u_it_resource_subtower.getDisplayValue();


I used getDisplayValue() and setDisplayValue and it worked.


Please mark my response as correct so that it gets removed from unanswered list and will help others to find the answer quickly.



If you are viewing this from the community inbox you will not see the correct answer button. You need to open the thread directly and you will see a correct answer button with red star.     Please review this How To Mark Answers Correct From Community Inbox