How to create record in another table by business rule?

Shraddha desai
Tera Contributor

Hello 

we have two table "Entities" and "Assessment"

We want  record should be generated in "Assessment" table when we submit a form in "Entities" table .So how to do it from business rule?

 

Thanks & Regards

Shraddha Desai

3 REPLIES 3

Aman Kumar S
Kilo Patron

You can simply create an After Insert Business rule on Entities table.

Now in the script, you can GlideRecord the Assessment table and insert the information that you want.

Sample code:

var gr= new GlideRecord('u_test');// assessment table name

gr.initialize();

gr.field_one= value1;

gr.field_two=value2;

gr.insert();

 

Feel free to mark correct, If I answered your query.

Will be helpful for future visitors looking for similar questions 🙂

Best Regards
Aman Kumar

gr_fieldone and gr_fieldtwo are the values from assesment tables ??
and what is value defiend for 

 

Hayo Lubbers
Kilo Sage

It sounds like GRC. You want a new assessment? Or an assessment instance based on the entity where you are?

In case of an assessment, you can make use of the GRCAssessment utils. Something like :

new global.AssessmentUtils().checkRecord(current, current.attestation);
var total = new sn_grc.GRCAssessmentUtils().assessItem(current);

 

See also BR : Attest control after PER is closed