Absent Member.. thePITman Absent Member..
Absent Member..
126 views

Dynamically populating field on Object Type

I've been racking my brain all day, but can't seem to figure out a way to do this...

I am in the PPM Workbench, creating an Object Type to be used as part of a Package. When filling in a field on the Object Type form, upon choosing a value in the Validation, I want it to automatically update (populate) another field on the Object Type (via a Special Command or otherwise, not really sure how).

Use case: I have a field on the Object Type called "File Name," whose validation is a Special Command that pulls a list of files from Subversion. When the user chooses the desired File Name from the Validation list, I want to execute another Special Command (or pull a value from another column from the File Name validation) that populates the next field, Revision Number, with the Revision Number of the file just chosen.

Basically, I have 2 fields: (1) File Name, which is editable, and (2) Revision Number, which is read-only. When the user chooses a File Name, it automatically finds the Revision Number for that file, and populates the Revision Number field.

Is there a way to do this? Any help is appreciated!

0 Likes
4 Replies
Natalia_R_PPM Absent Member.
Absent Member.

Re: Dynamically populating field on Object Type

Hello thePITman,

i'm trying to replicate this behavior according to your instructions.
However i believe there is no way to do this. I will send you a response if I find something about it

Also , If you have some screenshots you can paste the images here,

Regards, 

Natalia 

HP Support
If you find that this or any post resolves your issue, please be sure to mark it as an accepted solution.
0 Likes
Absent Member.. thePITman Absent Member..
Absent Member..

Re: Dynamically populating field on Object Type

I've been trying to think of any way to solve this. One way is to have the 2 fields as I mentioned (File Name and Revision Number). The user selects the File Name, and the Revision Number stays blank (read-only). However, once the package is submitted, the first step of the workflow calls a Special Command that uses the value from the File Name to find out the Revision Number, and then populates the Revision Number field. However, this doesn't help the developer who is adding the line to the package to make sure it is the Revision Number he/she expected. I'd like the developer to be able to see the Revision Number immediately, and have it stored on the package line.

Of course I can bring the Revision Number back as another column in the File Name validation, but we would want to use the Revision Number later in the workflow, so simply displaying it in the File Name validation does not satisfy the requirement.

Unless... for the File Name validation, the hidden parameter [P.FILE_NAME] stores the Revision Number, the visible parameter [VP.FILE_NAME] has the file name, and then the 3rd column has the Revision Number again. This way I could reference [P.FILE_NAME] for Revision Number and [VP.FILE_NAME] for the File Name. But is this best practice?

As it is right now, for [VP.FILE_NAME] I just bring back "filename.ext@rev" and I parse out the @rev as the Revision Number for later use. But this convention is not convenient for developers. I have attached a screen shot to this post.

If this is not possible, I will have to think of another way. Sorry for the sporatic post... just throwing out some of my ideas to see if it sparks any ideas within anyone else.

0 Likes
Natalia_R_PPM Absent Member.
Absent Member.

Re: Dynamically populating field on Object Type

Hello thePITman, 

I believe that the only way is to displaying it in the File Name validation.
Maybe i can try to do it in my lab and see if there is other way to do it.
I check cases about same behavior but didn't found something related with this,

Maybe other users can help you here

Regards,

Natalia

 

HP Support
If you find that this or any post resolves your issue, please be sure to mark it as an accepted solution.
0 Likes
Derek Giedd Honored Contributor.
Honored Contributor.

Re: Dynamically populating field on Object Type

The Revision field will only be populated when you execute one of the migrate steps in your workflow.  Until then, the revision field will be blank.  After you migrate a single time,  it is populated.  You  should be able to create a dummy migration step to populate it at the start of your workflow.  It does not get re-triggered if you change the file name unless a migration step is executed. So, while it does not work like a rule in a request, it can initially populate the field if a single workflow migration step is executed.  As far as I can see, since rules do not exist in packages, you can only initiate this in the workflow.

This assumes your file name has a token of FILE_NAME and the Revision field has a token of REVISION.  It also assumes the file name format is "filename@revision" If not, just modify the code below.

1) Create a new special command "sc_set_revision"

Add one Command "Set Revision" with a condition of '[P.FILE_NAME]' IS NOT NULL

and steps

ksc_itg_run_sql QUERY_STRING="select substr('[P.FILE_NAME]',instr('[P.FILE_NAME]','@')+1) from dual"
ksc_store REVISION=[SQL_OUTPUT], [SQL_OUTPUT]

In the commands for your object type add a single command that has a step "sc_set_revision".

 

-- Remember to give Kudos to answers! (click the KUDOS star)
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.