Transform map Error Code -100

aladpereira
Mega Expert

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.

7 REPLIES 7

venkatiyer1
Giga Guru

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.


find_real_file.png


If i try to change the choice action to create, the record is inserted but the data value is not saved in that field and i tried putting a log in the field-map script and its getting the correct data value into the staging table.


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'


};