Few examples to help clarify how PeopleSoft arrays work.
Local Array of Number &MYARRAY;
&MYARRAY = CreateArray(100, 200, 300); Result is [100] [200] [300]
You can assign values to the elements of the array:
Local Array of Number &MYARRAY;
&MYARRAY = CreateArrayRept(0,3); Result is [0] [0] [0]
&MYARRAY[1] = 100; Result is [100] [0] [0]
&MYARRAY[1] = 200; Result is [100] [200] [0]
&MYARRAY[1] = 300; Result is [100] [200] [300]
Use the Push method to add items to the end of the array:
Local Array of Number &MYARRAY;
&MYARRAY = CreateArray();
&MYARRAY.Push(100); Result is [100]
&MYARRAY.Push(200); Result is [100] [200]
&MYARRAY.Push(300); Result is [100] [200] [300]
Use the Unshit method to add items to the beginning of the array:
Local Array of Number &MYARRAY;
&MYARRAY = CreateArray();
&MYARRAY.Unshift(300); Result is [300]
&MYARRAY.Unshift(200); Result is [200] [300]
&MYARRAY.Unshift(100); Result is [100] [200] [300]
| Title | Under | Posted on |
|---|---|---|
| how to create application status in peoplesoft campus solutions 8.9 version | PeopleSoft Functional | 05/17/2012 - 4:09am |
| horizantal text in charts | PeopleSoft Technical | 05/10/2012 - 4:57am |
| no current buffer context error | PeopleSoft Technical | 05/10/2012 - 1:19am |
| Integration Broker : Operating Instance/Pub Contracts/Sub Contracts | PeopleSoft Technical | 04/24/2012 - 11:05am |
Comments
I was wondering, what was the best way to clear out an array in peoplecode during saveprechange processing so that elements can be re-evaluated each time. For example, when the value is deleted from a scroll level I want the array to be cleared and re-populated with only those values that are remaining. Thanks in advance for any help you might have.
Try reinitializing the array like
If scroll row got deleted then reinitialize the array and then populate the values.
Let me know if this works for you.
How to reinitializing the array in peoplecode.
Post new comment