The CreatorCon Call for Content is officially open! Get started here.

Script Include not working in reference qualifier

aagman4
Tera Contributor

I am trying to update the field with a Number using reference qualifier in dictionary but its not working(see the screenshot attached). It's not showing the info message as well.

 

Pls help me on this.

14 REPLIES 14

OlaN
Giga Sage
Giga Sage

Hi,

When calling a script include as a reference qualifier you need to call it in the following manner:

javascript: new ScriptIncludeName().functionName(parameters_to_function);

aagman4
Tera Contributor

I am using javascript: new sn_grc.SADAssessment.updateRecentSAD(current.sys_id); in reference qualifier and in script include - 

var SADAssessment = Class.create();
SADAssessment.prototype = {
    initialize: function() {
    },
 
updateRecentSAD: function(id) {
gs.addErrorMessage('hello');
 
but it's not working.aagman4_1-1690963328189.png

 

Inspecting your screen shot of the Dictionary entry, I saw that you are missing some pieces.

- new keyword is not there
- () missing after the Script include name

- function name appears to be missing also.

Your example should read like this:

javascript: new sn_grc.SADAssessment().updateRecentSAD(some_id_variable_here);

But, as Sagar Pagar already mentioned, an advanced reference qualifier is used to filter out which records should be available in a reference selection. You should not make changes to the records in your script.
In that case you should create a UI action or something else, depending on your requirement.

aagman4
Tera Contributor

I wanted to show a record by filtering it, Is it possible?