Project and Portfolio Management Practitioners Forum
cancel

Can't set custom tokens

SOLVED
Go to solution
Highlighted
Tommy Honahan
Trusted Contributor.

Can't set custom tokens

Hi All,

I am having trouble setting the value of any custom tokens/fields using ksc_store. I have added a new field to my Request Header, token name: P_QAQC

When I try doing:

ksc_store REQ.P_QAQC="TEST"

in a step command, I get an error saying the token does not exist:

REQ.P_QAQC="TEST", "TEST"
ERROR while setting token.
ORA-00904: "P_QAQC": invalid identifier {KNTA_EXECUTION-140}

UPDATE KCRT_REQUESTS set P_QAQC = 'TEST' where REQUEST_ID = 30283

I also noticed this token does not show up in the Token Builder... is there something I have to do to allow me to update this field - or any custom token for that matter?
14 REPLIES
Jason Nichols K
Acclaimed Contributor.
Solution

Re: Can't set custom tokens

Tommy,

Try using

ksc_store REQ.P.P_QAQC="Test","Test"

The only difference being that extra .P in between the REQ and your token. This tells the proc that this really is a parameter token.

Jason
Tommy Honahan
Trusted Contributor.

Re: Can't set custom tokens

Thanks Jason! It works!

You wouldn't happen to have any insight on another ksc_store issue I'm having (I have a seperate thread for it, but I haven't received any responses):

I am able to view the value stored in the PKG.PARENT_REQUEST_ID, and it is simply the request ID (ex: 30981)



But when I try to set the value using:



Ksc_store PKG.PARENT_REQUEST_ID=â 30981â



I get the following error:



PKG.PARENT_REQUEST_ID="30282", "30282"
ERROR while setting token.
The token attempting to be stored is invalid. Please verify that the token name is correct. (KNTA-10234)

Jason Nichols K
Acclaimed Contributor.

Re: Can't set custom tokens

If it's a custom token, do the same thing: put the .P. between the PKG and token name.
Tommy Honahan
Trusted Contributor.

Re: Can't set custom tokens

It's actually not custom - and as I mentioned I am able to view the token name my just saying:

ksc_comment PKG.PARENT_REQUEST_ID

But if I try to set it using ksc_store and the same name, it says invalid token... I don't get it :-(
Jason Nichols K
Acclaimed Contributor.

Re: Can't set custom tokens

That's because you can only use ksc_store on custom parameters. The OOTB tokens are off limits from that function.
Tommy Honahan
Trusted Contributor.

Re: Can't set custom tokens

Is there any way to update the out of the box tokens outside of creating new custom procedure on the database and calling it? (which I don't have access to do unfortunately)
Jason Nichols K
Acclaimed Contributor.

Re: Can't set custom tokens

I'm not seeing any easy way of doing that without backend changes. Although, in the few packages I have on my local instance, all of the Packages that have that line filled in also have a Parent Request listed in the References section. Depending on how you are creating the packages, that may be an OOTB way of getting that field populated without needing to update the db from the backend.
Tommy Honahan
Trusted Contributor.

Re: Can't set custom tokens

Yep, I tried adding the reference to the Package in the Request, and vice-versa. Even though the reference shows up in the list, the Parent field does not get populated.
Jason Nichols K
Acclaimed Contributor.

Re: Can't set custom tokens

Did you manually add it or was it autopopulated during the creation of the package?
Tommy Honahan
Trusted Contributor.

Re: Can't set custom tokens

It only get's populated when I perform the "Create PPM Package" execution step from my request workflow.
Jason Nichols K
Acclaimed Contributor.

Re: Can't set custom tokens

Can you paste in the commands from your execution step?
Tommy Honahan
Trusted Contributor.

Re: Can't set custom tokens

It's an out of the box execution command. I tried taking a look at the execution step itself, but all I can see is that it has a Execution Type of "Built-In Workflow Event" and the Workflow Event is set to "create_package".
Linda Hauck
Respected Contributor.

Re: Can't set custom tokens

Hi Tommy,

I am dealing with this same issue, have you found a solution, other than updating the database directly?


thanks!
Linda
Tommy Honahan
Trusted Contributor.

Re: Can't set custom tokens

Linda,

I was unable to find a solution other then updating the database.

We ended up modifying our migration process as a workaround. Now, rather then creating a new package the developers are updating the version numbers of the objects within the package if changes need to be made.