Issue with System Property Count Update from Catalog Process Using Script Include

ashokakumar
Tera Contributor

Hi Team,

I am facing an issue with updating the system property count through a catalog-triggered process.

We already have a daily scheduled job which calls the same Script Include, and in that scenario the system property count gets updated correctly without any issues.

However, I am now using the same Script Include from a Catalog Item flow/process, and although the script executes successfully, the system property value/count is not getting updated.

Below is the code snippet being used:


try {

var durationMs = endTime.getNumericValue() - startTime.getNumericValue();

var machineTime = parseFloat((durationMs / 60000).toFixed(1));

if (machineTime <= 0) {
machineTime = 0.1;
}

var AutomationName = "Rebar Retrigger";

automationUtils.sendData(
AutomationName,
AutomationID,
Beneficiary,
executionDateTime,
machineTime,
humanTime
);

} catch (e) {

gs.info('Error in Asset Retrigger: ' + e.message);
}

The variables are declared correctly, and no errors are being logged. The same Script Include works perfectly from the scheduled job, but not from the catalog process.

Could anyone please help me understand:

* whether there are transaction/context differences between Scheduled Jobs and Catalog executions
* if system property updates behave differently in catalog transactions
* or if additional permissions/commit/update logic is required in this case

Any guidance would be greatly appreciated.

Thanks in advance!

2 REPLIES 2

GlideFather
Tera Patron

Ahoy @ashokakumar,

 

I have two ideas:

 

1) your script include is global or scoped app?

If scoped, then ensure it's accessible from all application scopes, eventually re-create in another scope to satisfy this (highlgted box on the right)

 

2) is it Client/Ajax callable? 

there's a checkbox called "Glide Ajax enabled" (used to be called "Client callable" in older versions), check this is set true. (Left box)

 

GlideFather_0-1779283604227.png

 

Let me know what you have in these 2 boxes of your script inlucde

 

_____
Answers generated by GlideFather. Check for accuracy.

Ankur Bawiskar
Tera Patron

@ashokakumar 

how are you calling it from your flow?

what debugging did you do from flow?

what error it throws

screenshots please

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