Mapping field from record producer to another table via Script Include

Komaldeep
Tera Contributor

Hello Everyone,

Thank you in advance for the help.

I have the scenario for mapping 2 fields from the record producer variable to another table in the backend.

I have used this script in record producer scripting part - 

new sn_hr_core.script().funcname(producer.u_position_number,producer.eff);

and this code in the script include but not able to map the field - 

 ProjectDetailsCreation: function(pos,eff) {

var position = pos;

var effective = eff;

  var projDetail = new GlideRecord('tablename');

projDetail.initialize();

projDetail.u_position = position;

projDetail.u_eff = effective;

projDetail.insert();
            },

 

Can you suggest me the right solution?

 

1 ACCEPTED SOLUTION

anubhavritolia
Giga Sage

Hi Komaldeep,

I don't think Script Include is required.

You can directly GlideRecord your table in Record Producer script:

var projDetail = new GlideRecord('tablename');

projDetail.initialize();

projDetail.u_position = producer.u_position_number;

projDetail.u_eff = producer.eff;

projDetail.insert();

Please mark this as correct answer and helpful if it resolved, or mark this helpful if this help you to reach towards solution.

 

View solution in original post

5 REPLIES 5

Ankur Bawiskar
Tera Patron

Hi,

you can record producer script directly for this

Script shared by Anubhav should work fine

Do share us the updates.

Regards
Ankur