PA Breakdown Script

vineetk_195
Tera Contributor

Hello All,

I have configured an Indicator on Database view. Need to configure breakdown on an field which is available on base table, so as to acheive same I have written a script to get breakdown mapping between indicator facts table and field from base table.

But the issue which I have come across is, while using the filed from database view in the Breakdown mapping script I get an error " Not all references of "current" are passed in by "arguments" script".

Any suggestions / help would be great!

Thank You

Vineet Kumar

22 REPLIES 22

johnnyd54
Giga Expert

I've seen this issue a few times while trying to configure PA Scripts. Almost every time I believe the issue had to do with the fields that were selected underneath the facts table. Any fields I used, I had to select from the list. Then I just attached them to a variable before I did anything and I used the variables in my script.


vineetk_195
Tera Contributor

Thank you John,



I have used the same technique, where I have attached field value to a variable and then used same in the script, but still facing this issue.


Below is the script I have used:



var value = current.prb_cmdb_ci; // prb_cmdb_ci is the field from facts table i.e. derived from Database view


var sysID = '';


if (value && value!= '') {


  var gr = new GlideRecord('cmdb_ci_appl');


  gr.addQuery('sys_id',value);


  gr.query();


  if (gr.next()) {


  sysID = gr.field;


    }


}


sysID || '';



I am not sure why do I get this error?



Thank You


Vineet Kumar


In all of my PA scripts I'm returning something. I think you need to return sysID at the end


vineetk_195
Tera Contributor

Thank you John for the response.



I am returning sysID at end of my script as mentioned in my previous comments:



sysid || '';



Thank You


Vineet Kumar