Brazil upgrade: Standard change templates missing due to invalid category

Nathan Billing
Tera Contributor

Another issue we came across while working through our Zurich to Brazil upgrade. Sharing in case it saves someone else some troubleshooting.

 

The problem

We had an ATF test failing because it couldn't find a standard change template that had just been created.

The confusing part was that the template existed, was active and wasn't retired. A direct GlideRecord query against std_change_record_producer returned the record, but the following call returned nothing:

global.StandardChangeTemplate.findAll()

Both queries ran in the same transaction, only a second or so apart.

 

What changed in Brazil

After comparing the Script Includes between Zurich and Brazil, I found a change in StandardChangeTemplateSNC.findAll().

In Zurich, the method filtered the readable templates based on catalog item visibility.

In Brazil, it also checks category visibility when both the catalog and category fields are populated.

This additional check uses canViewCategory() in StdChangeUtilsSNC, which calls:

GlideappCategory.get(categoryId).canView()

From what I could see, there's no guard for a category reference that doesn't resolve to a valid record.

If the category contains an invalid reference, the template can be silently excluded from the results returned by findAll(). There's no obvious error explaining why the template has disappeared.

 

What caused it in our case

Our ATF test had been creating the standard change proposal using:

gr.category = 'Standard';

The problem was that 'Standard' is a display value, not a valid sc_category sys_id.

That script had been in place since 2024 and worked in Zurich because the category reference wasn't being evaluated in the same way.

Brazil's additional visibility check exposed the invalid reference, and the generated template became invisible to the script that had just created it.

 

What showed up in the logs

There were two messages that helped narrow it down:

[DefaultTranslationProvider] No db entry for: table=sc_category, id=<name>

Issuing query on invalid record to get value of element icon (com.glide.script.glide_elements.GlideElementUserImage)

The second message appears to be associated with trying to access sc_category.icon on a category record that couldn't be resolved.

Neither message immediately pointed to the standard change template, so they were easy to overlook.

 

The fix

We updated the ATF script to populate the category field with a valid sc_category sys_id rather than the display value.

Once corrected, the generated template was returned by findAll() and the test passed again.

 

Worth checking during an upgrade

If you're seeing standard change templates missing from scripted lookups after moving to Brazil, check the underlying std_change_record_producer records.

In particular, look at the category field and confirm that it contains a valid sys_id that resolves to a record in sc_category.

A 32-character sys_id alone isn't enough; the referenced record also needs to exist.

This was ultimately an issue with our original ATF script, but the change in Brazil exposed something that had been working unnoticed for a couple of years.

Has anyone else come across this change in behaviour, or seen it affect existing standard change templates?

0 REPLIES 0