Project and Portfolio Management Practitioners Forum
cancel
Showing results for 
Search instead for 
Did you mean: 

Updating request field with value in table component field

Highlighted
b460
Regular Collector

Updating request field with value in table component field

Hi,

Could someone tell me how I would be able to take the value saved in a table component row and populate a field within the request.

For example, I have a request with a table component in it. When a new row is added to the table, one of the fields that need to be populated is called "Revised Date". Once the table row has been added and saved, how would I copy the "Revised Date" field inside the table to the "Revised Date" field in the request?

Thanks.
6 REPLIES
b460
Regular Collector

Re: Updating request field with value in table component field

I managed to get the field to copy to the request by using:

[REQD.T..TC.VP..TOTAL]

I am now wondering how would I be able to get the "Revised Date" field from the last added row?

Is there a way to only select fields in the last submitted row in the table?

Re: Updating request field with value in table component field

Hi,

just try this one

[REQD.T..TE="[REQD.P.]".VP.]

it will give you of the row number which matches the total row count ( TE="[REQD.P.]" )

Kind Regards,
Michael


Greg_Shrout
Collector

Re: Updating request field with value in table component field

Could you use Last Updated Date?
In my request types I have a Last Updated Date field and a Last Updated By field that are system fields. I use a rule to get these fields to populate into my user defined fields. Here the SQL to do that:
select last_update_date, last_update_date from
KCRT_REQUEST_DETAILS
where
request_id = [REQ.REQUEST_ID]
and rownum = 1
~
In 7.5 there is a rule event called 'Apply On Page Load', so I use that as the event, Request_ID contains any value is the dependency, and the above query populates my UDF.
Good luck
-Greg
b460
Regular Collector

Re: Updating request field with value in table component field

Hi Michael,

I have tried what you suggested, but it seems not to be working. The dates from the table fail to copy over to the request at all when using ( TE="[REQD.P.]" )for the row count.

I have attached a screenshot of my rule, could you have a look to see if I am doing anything wrong?

Thanks,
BC.

Re: Updating request field with value in table component field

Hi,

looks the way I would do it.
Do you get an error?
Is the result field formatted wrong?
Or is there just no result?

Kind Regards,
Michael

Re: Updating request field with value in table component field

Hi,

I tried to reproduce it on my environment and get the same results --> nothing.

But this must be a bug, because if you hit the save button the second time, you will get the right date (PPM 7.5 SP4). So PPM seams to have a problem to resolve the token ( TE=... ) for new added table entries. In addition you will get old values on modifications or even wrong on deletions.

So I tried another way: take all values in column and cut out the last one.
LTRIM(SUBSTR('[REQD.T.STATUS_REPORTING.TC.P.REVISED_START_DATE]', INSTR('[REQD.T.STATUS_REPORTING.TC.P.REVISED_START_DATE]', ',', -1) + 1))

But there is also an undocumented feature. On first save the new value is in last position, but on next save the list isn't ordered any more. Additionally the seperator varies from ', ' to ','.

Perhaps you can do a mix of both ways, by recognizing the frist or second time hitting the save button (so with or without changes in table component) and getting the right date.
Or you can try it with a SQL Trigger.

Good luck,
Michael
//Add this to "OnDomLoad" event