Title | Under | Posted on |
---|---|---|
Component interface Error: no rows exist for the specified keys | PeopleSoft Technical | 03/15/2019 - 3:54am |
ADD 24 months starting from current month.(peoplesoft) | PeopleSoft Functional | 07/29/2018 - 8:44pm |
TRC values dropdown | PeopleSoft Technical | 04/04/2018 - 12:54am |
how to find missing sequence in GRID and print the mising sequence number while saving through peoplecode | PeopleSoft Technical | 09/11/2017 - 4:49am |
Hi Piyali - nice to see you again :)
I have a blog post that shows how you do a similar thing. The post shows how to fetch a value from a grid, the thing that you need to do differently is store the values fetched to an array. After you finished fetching all the values you need you can then populate the drop down list using the rest of the code in the post.
Pay attention to the last part:
DERIVED_CO.ADDR_TYPE_DESCR.ClearDropDownList();
DERIVED_CO.ADDR_TYPE_DESCR.AddDropDownItem("HOME", "Home");
You will need to do some work here to figure out how to pass the values in your array. One way is to loop through the values and pass them in to the AddDropDownItem function.
Good luck!
Give back to the community and help it grow!
* Help with unanswered forum questions and issues
* Register or login to share your knowledge at your own blog
Make a For loop to read the rowset of that Grid while looping using
adddropdownlist function to add the values in the field to make that drop down value.
Ex:
&rs=getlevel(0)().getrecord(1).getscroll(Scroll. Grid Name);
For &i=1 to &rs.activerowcount
Adddropdownlist(Record.Field ,&rs(&i).Record.Record name.Field.Field Name.Value);
End-for;
All the best
This might help you get it done without using an array ;)
Thanks Deepak!
Give back to the community and help it grow!
* Help with unanswered forum questions and issues
* Register or login to share your knowledge at your own blog
Thanks A lot Comshack and Deepak,
I have succeeded to add those value in drop down.
But still one problem.That drop down is not getting cleared at second attempt.It is holding the previous value.I Have added ClearDropList.But Still Its not working.
Here is the code which i have written in Page Activate.
************************************************
&rs1 = GetLevel0().GetRow(1).GetRowset(Scroll.COMPETENCIES);
&fld1 = &rs1.Getrow(1).GetRecord(Record.COMPETENCIES).GetField(Field.HX_PRIMARY);
&fld2 = &rs1.Getrow(1).GetRecord(Record.COMPETENCIES).GetField(Field.HX_SECONDARY);
&fld1.ClearDropDownList();
&fld2.ClearDropDownList();
&SQLCust = CreateSQL("Select COMPETENCY FROM PS_COMPETENCIES WHERE EMPLID=:1", CM_EVALUATIONS.EMPLID);
&SQLCust1 = CreateSQL("Select COMPETENCY FROM PS_COMPETENCIES WHERE EMPLID=:1", CM_EVALUATIONS.EMPLID);
While &SQLCust.Fetch(&COMPETENCY1)
&fld1.AddDropDownItem(&COMPETENCY1, &COMPETENCY1);
End-While;
While &SQLCust1.Fetch(&COMPETENCY1)
&fld2.AddDropDownItem(&COMPETENCY1, &COMPETENCY1);
End-While;
***********************************************
Warm Regards,
P I Y A L I
Warm Regards,
P I Y A L I
Page activate code fires once and only once (when the page loads). How are you going about your 2nd attempt? are you exiting the page and coming back? or do you just have an emplid field on the page and you change that to change the drop down values?
Give back to the community and help it grow!
* Help with unanswered forum questions and issues
* Register or login to share your knowledge at your own blog
The best way would be to put this piece of code in a function and call the function whenever you would require to reload the drop down list.
Peace,
Ashar