Project and Portfolio Management Practitioners Forum
cancel

Question around Table Component

Highlighted
Peter Zehrer
Super Contributor.

Question around Table Component

Hi,
We are right now on 7.1 SP10.

We have a requirement wherein we have a table component which has a drop down field. This field has values (ex. a,b,c,d,e). The requirement is whenever a person selects any of the values in the drop down that value should not be available for him to use again in the table componenent.

So in this case if the first time 'a' is slected then for the second row and subsequent rows 'a' should not be available for selection in the table component.

Any help in this regard is greatly appreciated.
11 REPLIES
Niraj Prabhu
Outstanding Contributor.

Re: Question around Table Component

Peter,

You can achieve this by writing a Validation which always looks for field value based out of storage within field which is part of Table Component.

You can store information of the user selecting table component either on the request form or on table component itself, then you can use the SYS.USER_ID to map it with the records existing in the table component on either storage table.

Let me know if you have any questions.

Regards,
Niraj
Niraj P.
Peter Zehrer
Super Contributor.

Re: Question around Table Component

Thanks for the response Niraj.

Could you please explain it in detail.

Just to make myself clear there is a field on the table component which is a drop down which has the values a,b,c,d,e.

In the first row of the table component I would select say a.

When i create a second row this field should now not have a and should only display b,c,d,e for selection.

similarly for the next rows. Effectively I would be able to create only 5 rows each with distinct field value.

Thanks,
Deepak
Mahen M
Acclaimed Contributor.

Re: Question around Table Component

If there is maximum of 5 rows only then why do you want it as Table component? Kindly let me know the reason, We can try other easy ways.

Apart from this a,b,c,d,e drop down field is there is any other fields in your TC?

Regards,
Mahendran M
Peter Zehrer
Super Contributor.

Re: Question around Table Component

Well there are about 12 other fields in the table component and the drop down that I m talking about has got about 35 different values.
The criteria here is not restricting the number of rows in the table component but having one - one mapping between the rows and the values selected in the field.

Let me know if you have any further questions.
Vibhor Dwivedi
Super Contributor.

Re: Question around Table Component

PFA

You can restrict the validation for second drop down field in the table component using auto complete list and token of the first drop down field.
Mahen M
Acclaimed Contributor.

Re: Question around Table Component

Vibhor,
You are advicing to add a new field in the TC, but Peter's requirement is within one Field alone.

Say if there is one field(column) called

Project 1:
Its validation has A,B,... Y, Z if in one row of Project 1 if you choose A.... then we should not be able to create another row whose Project 1 is A itself.

Peter please advice if my understanding is wrong.

You can write a validation Query as

(Select Distinct values of TC dropdown field) - (Select distict TC DropDown field assigned for this Request)

It may not work if you add values without saving... but worth to give a try.

Please let me know if you acheive any success.

Regards,
Mahendran M
Raj Ghimire
Outstanding Contributor.

Re: Question around Table Component

May be we can achive this using Two different validations:
Validation A as list validation which will store all the values in KNTA_LOOKUPS table. Validation A should have a Default value say "Not Needed" or something.

Then we can use a second(B) Auto comptle field validation for the fields.
Second validation(B) should query three different tables. knta_lookups for all available values AND kcrt_table_entries & knta_parameter_set_fields for the values that are alreay saved for Table Component field. Make sure to ignore the Defult value with query like kcrt_table_entries.parameter4 != 'Not Needed'. Then you can query for the values that are present in knta_lookups but not in
kcrt_table_entries for that Parameter.

I think that should probably work for you. Check it out and let us know.

-Raj
Raj Ghimire
Outstanding Contributor.

Re: Question around Table Component

Sorry I meant to say: the actual table component field should have the default value which can be ignored using != in query.
-Raj
Peter Zehrer
Super Contributor.

Re: Question around Table Component

Thank You for your suggestions.

Mahen - Your understanding on this is right. But I have question for you on your suggestion. How would you get the second part of your query - get the distinct values selected for this request.

Just to let you know I would not save my table component for the values to be going and sitting in the database. Rather I would want it to happen on the fly.

So for example when i click on the table component I would click on Add and adda row, click on Add and add another row even before I save or click on done.

Hope this clarifies.
Mahen M
Acclaimed Contributor.

Re: Question around Table Component

Yes that's what I thought too.... Can you create a caution message in request page when the TC have 2 or more rows with the same dropdown value.

Select distinct sl_no, XYZ from Table_component
Group by XYZ
having count(XYZ)>=2

I dont think there is anyway we can have this on the fly conditions.

Regards,
Mahendran M
Peter Zehrer
Super Contributor.

Re: Question around Table Component

That s what I thought that we may not do this on the fly but your suggestion on the error message is a great idea and then probably having an execution step which will not allow the request to move ahead untill the changes are made would be a kind of work around.