Getfield Peoplecode Scroll 1
I got this PeopleCode somewhere that says it can dynamically add items in the drop down list:
For example, if I have some PeopleCode on a level 2 record (say FieldChange), then I can do a GetField, GetRecord or GetRow, which will return the 'current' field, record or row from the perspective of the executing code.
My problem is I do not know exactly what event in the peoplecode should I put this in.
What I want to achieve is something like this:
A user will select a date. When the date is before June 2018, it displays a set of drop down items. However, if the selected date is on or after June 1, 2018, it will display another set of drop down list items.
Brian Tompsett - 汤莱恩1 Answer
So you are wanting the dropdown list to change when the date changes if I understand correctly. You should then put your code in the FieldChange Event for the date field.
In PeopleSoft you have Record.Field.FieldChange Event and Component.Record.Field.FieldChange. The Record.Field.FieldChange event will fire whenever this field is changed regardless of what component it is in. While Component.Record.Field.FieldChange PeopleCode only fires when that field is changed in the component where you saved the code.
In your case you likely want it on the Component.Record.Field.Fieldchange event as your logic sounds componentpage specific.