Relevance substitution failed

We have a process at my company that we use to create a setting on a computer that contains the computer purchase date. It has worked for many years until the last couple of years. Now we have started running into 50 or so computers that throw a “relevance substitution error”.

We have a txt file that each line is a serial number, followed by a tab, followed by a date. We download the file to the computer. Create a parameter with the local serial number. then we check to see if the serial number is in the file. if it is, we take everything after the tab char on the line with it’s serial number.

this is the bit of action script that is causing me the issue:

parameter “shipdate” = “{following text of last “%09” of it of (line whose (it as lowercase as string contains (parameter “serialnumber”)) of file (“C:\Program Files (x86)\BigFix Enterprise\BES Client\PC_Ship.txt”))}”

in the log file we get this error on the above line: “Command failed (Relevance substitution failed)”

does anyone have any ideas as to why this would throw an error on only some machines, some times. we have found that some machines will fail one time and then run successfully another time. there doesn’t appear to be any similarity on the devices. Dell Latitude laptops, Dell OptiPlex desktops, Surface laptops.

I would suspect its failing on machines that are missing the file with the expect text in. That would cause a singular expression error which would in turn cause a relevance substitution error.

You could use pluralize the relevance statement to avoid that, or use the | operator to error trap and set a default

Pluralization approach
parameter "shipdate" = "{following texts of lasts "%09" of it of (lines whose (it as lowercase as string contains (parameter "serialnumber")) of files ("C:\Program Files (x86)\BigFix Enterprise\BES Client\PC_Ship.txt"))}"

Error trap
parameter "shipdate" = "{following text of last "%09" of it of (line whose (it as lowercase as string contains (parameter "serialnumber")) of file ("C:\Program Files (x86)\BigFix Enterprise\BES Client\PC_Ship.txt")) | ""}"

3 Likes

So after after fiddling around with it for several hours and trying your suggestions, I found that the issue was with the “%09”. For some reason this was causing issues with some machines. I replaced it with a “-” and they all started to work.

Is there a reason that the %09 would not work? i looked at another post where someone was having an issue formatting something with a tab using %09.

It would throw a “Singular expression refers to nonexistent object” error if the line was missing a tab - like a data entry error where someone used spaces instead of a tab?

1 Like

So thats the interesting, i used find and and replace to replace all tabs with “-” i didnt fix any errors on the file. so the fact that it worked this time with a “-” instead of a tab means that there was a tab there before.

At this point it doesn’t matter to me beyond it being an odd things that has started having issues. Thanks for your time and help!

1 Like