Project and Portfolio Management Practitioners Forum
cancel

Can field token be used in validation > drop down list > SQL

Highlighted
bzdafro
Honored Contributor.

Can field token be used in validation > drop down list > SQL

I am trying to add a field to an object type that allows the user to select an environment type from a drop down list (PROD/QV/DEV).  Then have another field in the object type use the result within a SQL query to return all environments that are PROD or QV or DEV.   It doesnt appear this is possible.  This is what I have tried:

 

I have a field (token = [ENV] ) in an object type that asks 'What environment do you want to delete from'.   Its a drop down validation where the user selects PROD, QV, or DEV.    I would like to take the result and use it within another field, which is using a validation > drop down list > SQL.  

select environment_name, server_name from kenv_environments where environment_name like '(ABI)%' and user_data20='[P.ENV]'

 

I keep getting an error "One of the tokens in the validation was unparseable  KNTA-10073).   It appears you can ONLY USE tokens that are referenced from the Tokens button at the bottom of the validation.  (see pic)    Is there any way around this?  

 

 

1 REPLY
Utkarsh_Mishra
Acclaimed Contributor.

Re: Can field token be used in validation > drop down list > SQL

You can do it using the Auto-Complete list...

 

And in Auto-Complete list use the "Validated By" as "Command with Delimited Output".

 

Then the token can be used as:

 

IN COMMAND- 

 

ksc_run_java com.kintana.core.server.execution.KSCSQLQuery [AS.JDBC_URL] [AS.DB_USERNAME] "[AS.DB_PASSWORD]" "select REPLACE(SUBSTR('[P.TR_FROM_DATE]',1,10),'-','')  from dual" -token SQL_OUTPUT -delimiter "~" -file [AS.PKG_TRANSFER_PATH][SYS.USER_ID].txt [EXCEPTION_OPTION]


ksc_set TEMP_TR_FROM_DATE="[SQL_OUTPUT]"

 

For more details please check the attached snapshot.

 

Cheers..
Utkarsh Mishra

-- Remember to give Kudos to answers! (click the KUDOS star)