Project and Portfolio Management Practitioners Forum
cancel

how to add a new java script function to UI rules

Highlighted
skmohiuddin
Frequent Contributor.

how to add a new java script function to UI rules

Hi,

Is there a possibility to add a custom function to js file which is present in the path 'ITG_HOME\deploy\itg.war\web\knta\crt\js'. my requirement is to set a value in the the dependency field in rule to the resultant field using UI rules instead of SQL statement.

Is there an option of writing a custom javascript function like setFieldValue to achieve this.

Any help in this regard is appreciated.

Thanks,
Shaik Mohiuddin
6 REPLIES
MikeCF
Respected Contributor.

Re: how to add a new java script function to UI rules

Hi Shaik,

you can add your custom code to following file:

./deploy/itg.war/web/knta/crt/js/RequestRulesUserLibrary.js

Michael
skmohiuddin
Frequent Contributor.

Re: how to add a new java script function to UI rules

Thanks Michel for confirming this..
Could any one please provide a JavaScript code to setFieldValue function. to set a value in the the dependency field in rule to the resultant field using UI rules instead of SQL statement.

Thanks,
Shaik Mohiuddin
Jim Esler
Acclaimed Contributor.

Re: how to add a new java script function to UI rules

Could you explain why you would not want to use a SQL statement to store a value in the target field? This is what the SQL statement capability is for, while UI rules are intended to modify the behavior of the User Interface, e.g., visibility, required, etc.
skmohiuddin
Frequent Contributor.

Re: how to add a new java script function to UI rules

Yes you are correct. I have to populate the request description value into another text field through rule.Now when I have any 'apostrophe' in the text of request description it is getting populated with out any error but when the request is submitted through web services the rule is failing because of 'Apostrophe' if the request description is passed with out any apostrophe in its text then it is not giving any error in web services.

In brief the SQL statement rule is failing with web services when we have apostrophe in the text of req description.

So, thought of populating the value through UI rules so that we can avoid the apostrophe issue.

Let me know if there is any other way to solve this issue.

Thanks,
Shaik Mohiuddin

Michael.Ebert
Super Contributor.

Re: how to add a new java script function to UI rules

Hi Shaik,

if you are working with an Oracle database, have you tried the q-quote mechanism in a sql rule?

SELECT q'{[YOUR_TOKEN]}' FROM DUAL

In this case '{ and }' will work as a delimiter and your are able to use ' in the content of your resolved token.

Kind Regards,
Michael
skmohiuddin
Frequent Contributor.

Re: how to add a new java script function to UI rules

Yes Micheal I have tried the Quote messaging option available in 10g also.it works fine at PPM UI (PPM), but when request is submitted through web services it is throwing an error.

here are the queries what i have given in the SQL statement to avoid apostrophe issue.

select txt,txt1 from
(
SELECT q'{test request's description}' txt,q'{test request's description}' txt1 FROM DUAL
)
-----------------------------

select replace(txt,'''',''),replace(txt1,'''','') from
(
SELECT q'{test request's description}' txt,q'{test request's description}' txt1 FROM DUAL
)

These above queries work fine in PPM but fail when request is submitted through Web services.

let me know your thoughts on this


Thanks
Shaik Mohiuddin