Auto Increment a Number in PeopleSoft

Your rating: None Average: 3.5 (2 votes)

Use the GetNextNumber function to increment the value in a record for the field you specify by one.

Syntax:
GetNextNumber ({record.field | record_name, field_name}, max_number)

Best place to add such code is in SavePostChange event.

Example:
My_Field = GetNextNumber(My_Record.My_Field, 99999999);

Please try to help out with unanswered topics on the forum. Chances are you have had the same issue/question some time in your IT career!

Comments

Have a question? Please ask it on the forum instead.
hari's picture
hari (not verified)
Hi Nice

Hi
Nice

Nitin's picture
Nitin (not verified)
Re: Auto Increment a Number in PeopleSoft

There ia another function GetNextNumberWithCommits.
This created a new connection .. fetch the number,.. updated with new and commits.

One of them is having an Issue on OS390.

Lepa's picture
User offline. Last seen 3 weeks 19 hours ago. Offline
Joined: 06/23/2008
Posts: 565
Re: Auto Increment a Number in PeopleSoft

Nitin, your talking about GetNextNumberWithGapsCommit, right? I think you just forgot the word "Gaps". But yes I agree with you, GetNextNumberWithGapsCommit has more flexibility and provides better performance. Thanks for your tip!

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

Mayank's picture
Mayank (not verified)
Re: Auto Increment a Number in PeopleSoft

Nitin / Lepa i do agree with both of you..and want to update 1 more thing which is --
The GetNextNumberWithGaps function is very restrictive in its usage. The GetNextNumberWithGapsCommit function can be used in any event.

david wong's picture
david wong (not verified)
Re: Auto Increment a Number in PeopleSoft

do you place the code on the record or on the page?

Lepa's picture
User offline. Last seen 3 weeks 19 hours ago. Offline
Joined: 06/23/2008
Posts: 565
Re: Auto Increment a Number in PeopleSoft

I would put that code on the component level if you code under savepostchange event.

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

Post new comment

The content of this field is kept private and will not be shown publicly.
CAPTCHA
The question below is to prevent automated spam submissions.
Image CAPTCHA
Enter the characters shown in the image.