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

from contract table


First elevate your role to security admin.


find_real_file.png


Hi kaur,


Do you have assessment admin role. In that table write operation for those role only, based on acl only we can access the data.


even try one more,


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);


var sysId= gr.insert();


gs.addInfoMessage('AssignGrp:'+gr.assessment_record+' ,category:'+gr.category+' ,sys_id:'+sysId); // check it shows sys_id or not


if not try to trigger same business rule with, assessment_admin role user by impersonating some one.


please let me know what are all the results do you get.




you mentioned only create and read acl on that table. If there is read acl defined means all users having read access.


Tied the above record,output : Vendor:99ee8bcedb262e00077f7111cf96194bcatEnterprise Data Centersysid7d78b7dadba26e00077f7111cf961933


Do you have this role "assessment_admin"?