populating unexpected value (question mark symbol ?) in string value

sunil maddheshi
Tera Guru

Hi everyone

 

We have a string field highlighted in screenshot where we are populating some value based on calculation, but for few records it is showing question mark(?) symbol in that field. What could be the reason..Please see screenshotissue.png

4 REPLIES 4

Ankur Bawiskar
Tera Patron
Tera Patron

@sunil maddheshi 

is this happening with only this string field? is this an OOB field or custom one?

I think some random characters i.e. non-ascii one is getting populated and some script is overriding it with correct value expected in string field

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Hi Ankur

this is custom string field, I checked other scripts and can not see anywhere overridden

Hi @Ankur Bawiskar  

This business rule running on u_imt_incident table in servicenow (function executeRule(current, previous /*null when async*/ ) {
// Add your code here
// if (current.parent_incident) {
var query = 'parent_incident=' + current.parent_incident.sys_id + '^ORsys_idSTARTSWITH' + current.parent_incident;
var parentIMT = new GlideRecord('u_imt_incident');
if (parentIMT.get(current.parent_incident)) {
// initialize total amount.
var totalAdjustment = 0;
//Query all child IMT incidents for parent
var childIMT = new GlideAggregate('u_imt_incident');
//childIMT.addQuery('parent_incident',parentIMT.sys_id);
childIMT.addEncodedQuery(query);
childIMT.setGroup(false);
childIMT.addAggregate('SUM', 'u_finance_adjustment_processed');
childIMT.query();
while (childIMT.next()) {
totalAdjustment = childIMT.getAggregate('SUM', 'u_finance_adjustment_processed');
gs.info("totalAdjustment "+totalAdjustment);
}
var test = sn_i18n.NumberFormatter.format(parseFloat(totalAdjustment).toFixed(2));
gs.info("finalLog "+sn_i18n.NumberFormatter.format(Number(parseFloat(totalAdjustment).toFixed(2))));
parentIMT.u_trend_theme_3_other = sn_i18n.NumberFormatter.format(Number(parseFloat(totalAdjustment).toFixed(2)));
parentIMT.update();
}
// }


})(current, previous); but � is getting populated in u_trend_theme_3_other field

Hi @Ankur Bawiskar This is the only Business rule running on insert/update on that custom field, but no sure if this causing the issue

(function executeRule(current, previous /*null when async*/ ) {
    // Add your code here
  //  if (current.parent_incident) {
        var query = 'parent_incident=' + current.parent_incident.sys_id + '^ORsys_idSTARTSWITH' + current.parent_incident;
        var parentIMT = new GlideRecord('u_imt_incident');
        if (parentIMT.get(current.parent_incident)) {
            // initialize total amount.
            var totalAdjustment = 0;
            //Query all child IMT incidents for parent 
            var childIMT = new GlideAggregate('u_imt_incident');
            //childIMT.addQuery('parent_incident',parentIMT.sys_id);
            childIMT.addEncodedQuery(query);
            childIMT.setGroup(false);
            childIMT.addAggregate('SUM', 'u_finance_adjustment_processed');
            childIMT.query();
            while (childIMT.next()) {
                totalAdjustment = childIMT.getAggregate('SUM', 'u_finance_adjustment_processed');
                gs.info("totalAdjustment "+totalAdjustment);
            }
            var test = sn_i18n.NumberFormatter.format(parseFloat(totalAdjustment).toFixed(2));
            gs.info("finalLog "+sn_i18n.NumberFormatter.format(Number(parseFloat(totalAdjustment).toFixed(2))));
            parentIMT.u_trend_theme_3_other = sn_i18n.NumberFormatter.format(Number(parseFloat(totalAdjustment).toFixed(2)));
            parentIMT.update();
        }
 //   }


})(current, previous);