Project and Portfolio Management Practitioners Forum
cancel

Get the project_id of a project in a custom designed request form.

SOLVED
Go to solution
Highlighted
Sevilay
Honored Contributor.

Get the project_id of a project in a custom designed request form.

Hi,

i try to explain my problem.
i created a custom request type.i also created a workflow and a header request type of course.
Users can access this request form by 3 different way.
One is that through "Create A Request" link from the left menu bar.
Second one is from the "References" tab of the project screen.
Third one is from the "References" tab of the tasks in the work plan.

For 2nd and 3rd options i want to get the project_id and show the project name in that request form.

In the risk ,issue request forms this project name is automatically taken from the project and can be seen in the form.There is a system token named knta_master_proj_ref.When i used the same token in my custom request form,i can't get automatically the project name and id.

How can i do this?

I hope,i can explain the problem well.

Thanks in advance..
5 REPLIES
john.jeremiah
Trusted Contributor.
Solution

Re: Get the project_id of a project in a custom designed request form.

Hi Sevilay,

I understand your question and have been looking at it as well.

For Risks, Issues and Changes, they already have a Token for the project reference -
[REQ.P.KNTA_MASTER_PROJ_REF]

which lets you access the project data... as in the following commands in an execution step in my risk workflow:

ksc_set TEMP_REQ_ID="[PRJ="[REQ.P.KNTA_MASTER_PROJ_REF]".PROJECT_REQUEST_ID]"
ksc_set TEMP_PORTFOLIO="[REQ="[TEMP_REQ_ID]".REQD.VP.TFL_PORTFOLIO]"
ksc_store REQ.P.R_PORTFOLIO=[TEMP_PORTFOLIO]
------------

That works because I have a TOKEN reference to the project.....

If you don't have the TOKEN, (as in your 2nd and 3rd options). I've been thinking that I would have to look it up from the KTNA_REFERENCES with something like:


select parameter1 from KNTA_REFERENCES where source_id=[REQ.REQUEST_ID]


John
Sevilay
Honored Contributor.

Re: Get the project_id of a project in a custom designed request form.

Hi John,

first of all i really thank you for your long and detailed explanation.

But i think i forgot to mention the most important point.
i have to get the project_id at the very beginning ,in fact when creating the request but before the submitting it.
As you know, reuest_id's are created after the requests are submitted.In my situation request isn't submitted yet and i should know the project_id.
The thing i want to do is make certain the user to choose resource who is in the staffing profiles of that project in which the request is created not the all users.Ä°f i know the project_id in the beginning,i can write an sql query to get the project resources and make certain the user to choose from only this selection.Otherwise the user can choose anyone else not in that project.
This request can be started by the project resources and project manager through "References tab of the project" and also from the "References tab of the task in the workplan".
Secenario that is expected to be done is that:
1. User select the create a new request.
2. User select the custom request type.
3.** User choose the assigned person.
4. User submits the request.

In short i have to get the project_id before submitting the request.How can i do this ?
If there is no way , i make another step in the workflow and this is dummy step,user first create the request and then select the user.But this is not my first choice.

Thanks again.
Sascha Mohr
Acclaimed Contributor.

Re: Get the project_id of a project in a custom designed request form.

Hi,
if it is not an option to have the user first select the project manually and then have a validation for resource selection that depends on the project selected, you could try to generate a link on the project details page that looks like this one:

/itg/web/knta/crt/RequestCreate.jsp?REQUEST_TYPE_CREATE=5.10.30062.PMO+-+Risk&loggingIssue=true&projectId=177717&projectName=Portfoliomanagement+Demo

I have done something similar to start project related reports (not for request types yet). Clicking the link on the project details page opens the submit report and the project field is already populated. What you need to know here:
5 and 10 are the lenghts (characters) of the risk request type's ID and name respectively. The project name needs to be URL-encoded if it contains any non-ASCII chars.
Sevilay
Honored Contributor.

Re: Get the project_id of a project in a custom designed request form.

Hi Sacsha,

thanks to you.

But i think,this is not a solution to my problem.

All resources can create this request types more than once and want to see the history.
Also project manager should create this from the workplan and can bind this request type to a task in the work plan.
So a link in the form can not be applicable.Besides i don't understand the usage exactly but this is not the case now.

But i put project_name field on the form.i customize its query and add an "ALL" option manually addition to the project list.When the user choose "ALL" option, all the users in the system should be populated (because user can create this request outside of the project,from the left menu for example).
When the user selects a project from the list,only the resources of this project should be populated.

i wrote the resources fields' validation as following :

select distinct ku.user_id,ku.full_name,ku.username
from
ppmasya_usr.rsc_staffing_profiles sp,
ppmasya_usr.pm_projects pp,
ppmasya_usr.rsc_positions rp,
ppmasya_usr.rsc_resource_assignments ra,
ppmasya_usr.rsc_resources rr,
ppmasya_usr.knta_users ku
where container_entity_type_code = 1
and sp.container_entity_id = pp.project_id
and rp.staffing_profile_id = sp.staffing_profile_id
and ra.position_id = rp.position_id
and rr.resource_id = ra.resource_id
and ku.user_id = rr.user_id
and pp.project_id like
decode('[REQ.KNTA_MASTER_PROJ_REF]','ALL','%%','%[REQ.KNTA_MASTER_PROJ_REF]%')
order by ku.full_name.

But it doesn't work.REQ.KNTA_MASTER_PROJ_REF is the token name of the project_name field.

if i can do at least this ,this would be enough for now.

Thanks.
Sevilay
Honored Contributor.

Re: Get the project_id of a project in a custom designed request form.

Hi,

i solved the previous problem.
Don't take it account.

Thanks.