My Oracle Support Banner

Generate Unique Number For A Field (Doc ID 2195125.1)

Last updated on NOVEMBER 03, 2016

Applies to:

Oracle Fusion Sales Cloud Service - Version and later
Information in this document applies to any platform.


How is the following code generating numbers ?

def opty = newView('OpportunityVO');

def count = nvl(opty.getEstimatedRowCount(),0);
def newCount = count+1;
def yr = year(new Date());

def id = OptyId;
def id1 = right(id.toString(),3);

String input = newCount;
StringBuffer buf = new StringBuffer(input);

while (buf.length() < 5) {
 buf.insert(0, '0');

String output = buf.toString();



To view full details, sign in with your My Oracle Support account.

Don't have a My Oracle Support account? Click to get started!

In this Document

My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.