- My View
I have a table Security Incidents and a Third party refrence table. In the third party, I created a refrence field to Security incidents.
I am importing data from excel which has both the fields of security incidents and third party reference,
To insert data into third party reference and add a relationship between 2 tables, I created an Onafter transform script.
var sftInst = new GlideRecord('x_169104_security_third_party_system_invoved');
sftInst.ip = source.u_ip;
sftInst.third_party_new = target.sys_id;
log.info('target.sys_id=' + target.sys_id);
log.info('Number = ' + target.incident_title);
log.info("third party reference = "+ sftInst.third_party_new );
I see that sys_id is correct and is populating into third party reference field in the logs but I do not see any record created for Third Party table and no reference is working. what did I miss here.
Can you tell me which is you source table and target table.
Because i see that your script wont work.
Because you are creating a record in target table right?
is third_party_new a reference field referencing Target table?
Thanks for your help. I figured out that the reason it is not working because, I have defined my transform script in global scope.
Once I changed my scope of the application, I see that is working.