Jazz Register Log in
Jazz Forum Welcome to the Jazz Community Forum

Welcome to the Jazz Community Forum

Connect and collaborate with IBM Engineering experts and users

Can not use JavaScript Library funcion in RPE template

Hello!
Sorry, but I have a strange problem with JS library function. I'm doing everything like to:
But when I want use the function in a text element in the template, I'm getting a reference error:
Reference error in RPE
May be somebody knows why it happens. Help me please if possible!
Thank you!

0 votes


Accepted answer

Permanent link

This is a design limitation in RPE. A library script cannot use variables or data properties. If so, RPE will not use the script as library.

You should see the following message logged in console:
CRRPE3615E The script with id xx has data or variable references and cannot be used as a library.

Though you could use the library script function within try catch block, it is as good as calling a function that is not defined and hence it will be caught.

Dmitry A. Lesin selected this answer as the correct answer

0 votes

Comments

Yes Prasad, it is the limitation.

>>> I ran a quick test. Though I could use the library script function within try catch block, the output does not contain what is expected from the function.
Are the data properties evaluated correctly during document generation? or is just during the "Test script"?

Yes, thanks

I checked the same, and it's correct. And even, try...catch block isn't required if any variables are excuded because there's no error.


2 other answers

Permanent link

Did you check the "library script" property?



Thanks,
Kumar

0 votes

Comments

 Yes, exactly!

Checked library setting

And I can find and insert this function in another element by CTRL-SPACE.

 I'm working with RPE v6.0.5!

But I found that it catches an error that  "displayAllTCNames" is not defined when I try to use it. It's strange, may be there's a bug in RPE because I can not use it in the same template, isn't there?
Thank you


Permanent link

Could you try this in the text element?

try{
    displayAllTCNames()
}
catch(e){
    //catch and just suppress error
}

0 votes

Comments

Cool! You are genius.

Thank you very much!

Your answer

Register or log in to post your answer.

Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 12,038
× 332
× 152

Question asked: Aug 07 '18, 9:09 a.m.

Question was seen: 4,205 times

Last updated: Aug 10 '18, 8:14 a.m.

Confirmation Cancel Confirm