You are viewing this site as a guest. You can still ask questions and help others! Join our Dev2Dev IT Community to receive your own blog, share your knowledge, and much more.

Avoiding Data Duplication in Grid

3 replies [Last post]
tejaspaiowns's picture
User offline. Last seen 1 year 49 weeks ago. Offline
Joined: 07/22/2011
Posts: 4

I'm making a Project Management System. In the project, when the Project Manager wants to select a project leader and team members , he gets the name of the employees in the look-up list which is fetched from the employee master table. Now, when he selects his resource list , if he selects a particular resource as a project leader in the 1st row of the grid , he should not be able to select any other resource as project leader.
Since, there can be only 1 project leader for a particular project.

However, its okay if he selects multiple team members ..

P.S. : Project Leader / Team Member is fetched from another field called employee role which contains these two translate values.

Please help, a bit urgent.

Be Jealous!

Guest's picture
Guest (not verified)
Re: Avoiding Data Duplication in Grid

Say, you have a field called ROLE_TYPE and Manager selects "Project Leader" value on this field for a particular row, what you need to do is to check (using ROLE_TYPE Field Edit PeopleCode of course) if there is any "Project Leader" in the list already. You can do this by traversing through the rowset and checking the ROLE_TYPE for each and every row.

tejaspaiowns's picture
User offline. Last seen 1 year 49 weeks ago. Offline
Joined: 07/22/2011
Posts: 4
Re: Avoiding Data Duplication in Grid

Well, I know the concept .. I'm just struggling with writing the code .. Can you help me out with the coding part .. I even realize &rowset.ActiveRowCount has to be used, just not able to execute it ..

Be Jealous!

Guest's picture
Guest (not verified)
Re: Avoiding Data Duplication in Grid

Here it is..

Local rowset &Level1;

&Level1= GetLevel0()(1).GetRowset(Scroll.MYSCROLLRECORD);

For &I = 1 to &Level1.ActiveRowCount
&Level1.GetRow(&I).GetRecord(Record.MYRECORD).GetField(Field.MYFIELDNAME).DisplayOnly = False;
End-For;