Transform map Error Code -100
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-21-2017 09:41 AM
Hello All,
I am trying to import a data via excel using transform map. while inserting i m getting a error stating - rejected by reference field and error code is 100. But i can see the data value which i am trying to import is already present in the reference table. What might be the issue, any sort of help will be much appreciated?
Thanks,
Alad.
- Labels:
-
Enterprise Asset Management
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-21-2017 07:52 PM
Hi Anto,
If your choice action is working for insert and not reject, then it is not able to see a match between the source field and target field. If you were to go to field map of the reference field for the target table, there would be an element called Reference field value. Hope you have referenced the right target column there. Alternatively, you can use source script and try logging the source value and the typeof the source value to see what it is printing in the logs for further troubleshooting.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-21-2017 08:27 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-24-2017 09:58 AM
Hi Anto,
Would like to try an alternative here:-
Inside your transform map for this field, click the source script option and add the following script:
answer = (function transformEntry(source) {
return new CostCenterTransform().lookupSysId(source);
})(source);
Also create a script include with the following code:
// Please replace column name
var CostCenterTransform = Class.create();
CostCenterTransform.prototype = {
initialize: function() {
},
lookupSysId : function(source) {
var gr = new GlideRecord("cmn_cost_center")
// Please change the COLUMN_NAME to the column name in import set // table having the sys id of the cost center
gr.addQuery("sys_id", source.COLUMN_NAME.toString());
gr.query();
if(gr.getRowCount()) {
gs.log("Error in the mapping of values");
}
if(gr.next()) {
return gr.getUniqueValue();
}
return -1;
// This will try to create a new record which you would be rejecting by using choice action
},
type: 'CostCenterTransform'
};