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.

how can i fetch a field value from another level and scroll in the same page???

4 replies [Last post]
Guest's picture
Guest

hi, everybody, first that all, excuses for my bad english... im a junion analist, and i have to make a modification in a original peoplesoft page, the client want to put in the page 2 new fields one of them to select item witholding transaction, and the other one to enter the number of the witholding voucher, i did those, and i store it in a record made by myself, but now, they want to gray or ungray those new field depending the selection of a checkbox placed in the level 0 scroll of the page.

in my fields i put the peoplecode necesary to gray the field if the checkbox is not selected, but, when i select the checkbox my fields are still gray....

in the checkbox fieldchange event i tried to put a peoplecode to ungray my field but it doesn't work...

i try with this code in the checkbox field change event

If %Component = "WS_WORKSHEET_IC" Then
If WS_ITEM.ITEM_SELECTED = "Y" Then
UnGray(WTHD_VCHR_INFO.AR_TRANS_TYPE);
UnGray(WTHD_VCHR_INFO.AR_WTHD_VCHR);
Else
Gray(WTHD_VCHR_INFO.AR_TRANS_TYPE);
Gray(WTHD_VCHR_INFO.AR_WTHD_VCHR);
End-If;
End-If;

and it doesn't work

and i gray my field in the rowinit event this way

If %Component = "WS_WORKSHEET_IC" Then
If WTHD_VCHR_INFO.ITEM_SELECTED = "N" Then
Gray(WTHD_VCHR_INFO.AR_TRANS_TYPE);
Gray(WTHD_VCHR_INFO.AR_WTHD_VCHR);
Else
UnGray(WTHD_VCHR_INFO.AR_TRANS_TYPE);
UnGray(WTHD_VCHR_INFO.AR_WTHD_VCHR);
End-If;
End-If;

and i was trying with a peoplecode for scrolls, but i don't have a clue about what should i have to do...

For &ROW = 1 To ActiveRowCount(Record.WS_ITEM)
If FetchValue(WS_ITEM.ITEM_SELECTED, &ROW) = "Y" Then
UNGray(WTHD_VCHR_INFO.AR_TRANS_TYPE);
UNGray(WTHD_VCHR_INFO.AR_WTHD_VCHR);
Else
Gray(WTHD_VCHR_INFO.AR_TRANS_TYPE);
Gray(WTHD_VCHR_INFO.AR_WTHD_VCHR);
End-If;
End-For;

thanks for any help that you can gave me...

OGONZALEZ's picture
User offline. Last seen 2 years 34 weeks ago. Offline
Joined: 08/11/2011
Posts: 3
Re: how can i fetch a field value from another level and ...

sorry, my bad, im the author of this thread, bu i forgot to login at the site, this is the page itself

see the image below:

Ashar's picture
User offline. Last seen 27 weeks 4 days ago. Offline
Joined: 03/26/2008
Posts: 226
Re: how can i fetch a field value from another level and ...

If %Component = "WS_WORKSHEET_IC" Then
If WS_ITEM.ITEM_SELECTED = "Y" Then
UnGray(WTHD_VCHR_INFO.AR_TRANS_TYPE);
UnGray(WTHD_VCHR_INFO.AR_WTHD_VCHR);
Else
Gray(WTHD_VCHR_INFO.AR_TRANS_TYPE);
Gray(WTHD_VCHR_INFO.AR_WTHD_VCHR);
End-If;
End-If;

This should work fine if you write this in the FieldChange peoplecode of the record field WS_ITEM.ITEM_SELECTED. If it is not working check if deferred processing is enabled for the field WS_ITEM.ITEM_SELECTED.

OGONZALEZ's picture
User offline. Last seen 2 years 34 weeks ago. Offline
Joined: 08/11/2011
Posts: 3
Re: how can i fetch a field value from another level and ...

hey, thanks for answer, well i already try to put those people code where you said, and disable the allow deferred processing, but it doesn't work.... my problem is that the checkbox is on the level 0 of the scroll and to put the new fields i create a new scrollarea located on the level 2 of the scroll...

i tried too, on my record i inserted a field called as the checkbox field name "item_selected" and i puted as key, and in the WS_ITEM.ITEM_SELECTED.fieldchange i tried to change the value of the WTHD_VCHR_INFO.item_selected thru peoplecode like this:

If WS_ITEM.ITEM_SELECTED = "Y" Then
WTHD_VCHR_INFO.ITEM_SELECTED = "Y";
Else
WTHD_VCHR_INFO.ITEM_SELECTED = "N";
End-If;

but a new error appears saying that WTHD_VCHR_INFO.item_selected doesn't exist on the page, i tried this because i puted the code to gray or ungray my fields in the WTHD_VCHR_INFO.item_selected.fieldchange, to test, but not work

OGONZALEZ's picture
User offline. Last seen 2 years 34 weeks ago. Offline
Joined: 08/11/2011
Posts: 3
Re: how can i fetch a field value from another level and ...

well after some help of a friend who has the peoplecode peoplebooks, we've found a solution for our problem, with this code:

in the rowinit of the fields that i wat to gray or ungray we put this code to gray it by default

If %Component = "WS_WORKSHEET_IC" Then
Gray(WTHD_VCHR_INFO.AR_TRANS_TYPE);
Gray(WTHD_VCHR_INFO.AR_WTHD_VCHR);
End-If;
and in the fieldchange event of the checkbox that i want to use for ungray my fields we put this code:

If %Component = "WS_WORKSHEET_IC" Then
If WS_ITEM.ITEM_SELECTED = "Y" Then
UnGray(Scroll.WS_ITEM, CurrentRowNumber(1), Scroll.WTHD_VCHR_INFO, 1, WTHD_VCHR_INFO.AR_TRANS_TYPE);
UnGray(Scroll.WS_ITEM, CurrentRowNumber(1), Scroll.WTHD_VCHR_INFO, 1, WTHD_VCHR_INFO.AR_WTHD_VCHR);
Else
Gray(Scroll.WS_ITEM, CurrentRowNumber(1), Scroll.WTHD_VCHR_INFO, 1, WTHD_VCHR_INFO.AR_TRANS_TYPE);
Gray(Scroll.WS_ITEM, CurrentRowNumber(1), Scroll.WTHD_VCHR_INFO, 1, WTHD_VCHR_INFO.AR_WTHD_VCHR);
End-If;
End-If;

and the checkbox that we want to use to gray or ungray my fields we disable the allow deferred processing and thats all...