- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
Hi @Michael Farine1,
Apologies for the delay on this, I was having some difficulties getting a reply to actually post on here, and I have also been unable to update my original article since the Community revamp.
I have found a solution to your particular issue, and this has also fixed a wider issue. The cause looks to be related to a few OOB tables that somehow simultaneously don't have auto-number enabled, but still have an auto-number turned on (I'm unsure how this is the case). The tables in question are:
- Indicator [pa_indicators]
- Breakdown [pa_breakdowns]
- Application License Definition [sys_app_license_defn
The related info is as follows:
TABLE: sys_app_license_defn | PREFIX: '' | DIGITS: 7
TABLE: pa_indicators | PREFIX: '' | DIGITS: 9
TABLE: pa_breakdowns | PREFIX: '' | DIGITS: 9As you can see, there are two tables using a number of digits matching 9, and one matching 7. All of which have no prefix.
Since the regex conditions we are using utilised the format "PREFIX\d{NUMBER_OF_DIGITS}", we end up having any string that contains at least 7 or 9 digits in a row matching one of these tables and being converted into a hyperlink (more than likely not pointing to any real record). Example:
The solution to this was actually rather simple, and just required a small addition to the query to filter out any tables without a prefix (^number_ref.prefixISNOTEMPTY):
// Get all tables with a number prefix
var table = new GlideRecord("sys_db_object");
table.addEncodedQuery("sys_update_nameISNOTEMPTY^number_refISNOTEMPTY^number_ref.prefixISNOTEMPTY");
table.query();
The end result is now the expected behaviour. Same example as above, but with the updated query:
I hope this helps if you are still looking to utilise this business rule.
Sadly, I cannot update my article, so I will leave this in the comments for now.