Project and Portfolio Management Practitioners Forum
cancel

Can't define my own custom JavaScript functions to use in UI rules

Highlighted
Igorek-KZ
Regular Contributor.

Can't define my own custom JavaScript functions to use in UI rules

Good Day! I want to add new JS function to use in UI rule, so I've modified RequestRulesUserLibrary.js in <PPM_Home>/
server/<PPM_ServerName>/deploy/itg.war/web/knta/crt/js. But, I can't use my function in UI rule of request, generated error in attachments.

I thought, that my function it's not correct, and, for checking, copied system function "showMessage" from "RequestRulesSystemLibrary.js" to "RequestRulesUserLibrary.js" and called it, for example, showMessage2. Then tried to use it and similar error generated.

Also I've attached RequestRulesUserLibrary.js with my functions. Will be appreciated for any help!

Best Regards,
Igor
3 REPLIES
Radim79
Respected Contributor.

Re: Can't define my own custom JavaScript functions to use in UI rules

Hi, send me please how you call the function on request rule. There is maybe problem with function parameters.

 

Thanks

 

Radim

Igorek-KZ
Regular Contributor.

Re: Can't define my own custom JavaScript functions to use in UI rules

Radim, Hi!

Here's the function:

GoToURL('http://google.com')

 

Best Regards,
Igor
Igorek-KZ
Regular Contributor.

Re: Can't define my own custom JavaScript functions to use in UI rules

Ok, I think problem is detected - it's

document.location.href

function. I've dubuged this script in chrome, this is an error:


Another my own functions in RequestRulesUserLibrary.js work fine. All what I want - to execute a jump to URL, so I decided use UI rules and JS function document.location.href, but it doesn't work. Is there any alternatives to execute a jump to some URL? And why document.location.href doesn't work?
Best Regards,
Igor