Values Not getting Inserted. Please help

Lucky1
Tera Guru

Hello all,

 

I have written on before Transform Script and the logs are giving the values but not setting the values into the record created. Any idea why they are not inserting?

 

Lucky1_0-1752467663072.png

 

I tried with the commented lines as well.

 

 

 

Regards,

Lucky

 

4 REPLIES 4

G Ponsekar
Mega Guru

Hi @Lucky1 ,

 

have u checked the table identification rule whether that is preventing insertion.

And alternatively you can try same script in onAfter transform script and verify

 

Please mark helpful if it works for you

 

Thanks, GP

Hi ,

 

Thanks for your reply.

 

Yes, I checked in the CI class manager, there are no rules defined on this table.

Lucky1_0-1752472437759.png

 

 

 

One more thing is, I tried inserting a record using background scripts, but it is creating empty record but without values.

What could be the reason?

 

 

Regards,

Lucky

 

Hi @Lucky1 ,

 

I tried with below code and it created record in business application table from background script.

setWorkflow(false) is optional. you can try once. 

 

var gr = new GlideRecord('cmdb_ci_business_app');
gr.initialize();
gr.name = 'Test1';
gr.short_description = 'desc test';
gr.setWorkflow(false);
gr.insert();
 

If I could help you with your Query then, please hit the Thumb Icon and mark as Correct !!

 

Thanks, GP

Ankur Bawiskar
Tera Patron
Tera Patron

@Lucky1 

this is onBefore or onAfter transform script?

which logs came?

If my response helped please mark it correct and close the thread so that it benefits future readers.

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