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

Can we use table component token in the request type rules

Highlighted
Mahalakshmi Iye
Acclaimed Contributor

Can we use table component token in the request type rules

Hi All,

We want to use the TC Field token in our request type(RT).


We have three fields in TC,
1. Company Name
2. Allocation %
3. Effective date.

On the Request Type we have field called Total Allocation.

The requirment is, the total allocation field should have sum of Allocation %(from TC) grouped by maximum Effective date.

In Short, we would like to fetch values from TC field (Allocation %) for selected rows in TC. Is this possible in PPM 7.1?

Thanks in advance.

Regards,
Maha.
7 REPLIES
Mahen M
Honored Contributor

Re: Can we use table component token in the request type rules

I hope this cannot be done.

Try to choose a TC in the dependency area of the Rule.

Regards,
Mahendran M
Mahen M
Honored Contributor

Re: Can we use table component token in the request type rules

You can trigger a rule based on a change in Table component as such, But I am not sure how to add up the % Allocation.

My advice instead of Table component have the custom fields, It has lot of advantages.

Regards,
Mahendran M
Mahalakshmi Iye
Acclaimed Contributor

Re: Can we use table component token in the request type rules

Thanks Mahendran.

I feared the same but wanted to reconfirm. We will not be able to use custom field as we unlimted record entries for the same.

Thanks again.

Jason Nichols K
Honored Contributor

Re: Can we use table component token in the request type rules

You could write a function that did the calculation and store it in a separate field on the form. I've done this before to calculate the sum of a column in a TC. You can have a Rule trigger on the TC field change, and then for the SQL use

SELECT a.out, a.out
FROM (SELECT calcFnc([REQ.REQUEST_ID]) out
FROM DUAL) a

The subquery in the FROM clause is used so that the function is only called once, but the value can be used twice.
Mahalakshmi Iye
Acclaimed Contributor

Re: Can we use table component token in the request type rules

Thanks Jason.

To use function, we will have to save the request first only then it will be available in the KCRT tabls to fetch the values, right?

But I want to trigger this rule as soon as the field is changed even on not submitted step. Will the use of function be appropriate in that case?

Please suggest.


Thanks again!

Maha.

Re: Can we use table component token in the request type rules

Hi,

check the Commands and Tokens Reference Guide (CmdTokVal.pdf). There is a chapter about Table Components and rules (Chapter 4). There is a example how to caluclate the sum of a TC field from the request context.

It is like this:

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

Regards
Volker
Mahalakshmi Iye
Acclaimed Contributor

Re: Can we use table component token in the request type rules

Thanks Volker.

yes thats right, we can use this token for getting the total of particular field in TC.However, It give the sum of all records in TC, as in if I have ten records , this token will give me sum of all ten records , where as I want sum of only five records that meets my criteria.

Hope I am not too confusing.

Thanks Again!
Maha.
//Add this to "OnDomLoad" event