My Oracle Support Banner

How To Allow Supplier Contacts To Create Contacts With Duplicate Email Id (Doc ID 2671347.1)

Last updated on DECEMBER 22, 2020

Applies to:

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

Goal

Customer have written a script as below which do not allow users to create a contact with duplicate email.
Now they want this validation to be run for all the contacts apart from Supplier Contacts.

def emailIter = Email;
emailIter.reset();

while(emailIter.hasNext())
{
def emailRow = emailIter.next();
if((emailRow.getPrimaryRowState().isNew() || emailRow.getPrimaryRowState().isModified())&& emailRow.EmailAddress != null)
{
//now check for duplicates across
def vo= newView('PersonParty')
def vc = newViewCriteria(vo)
def vcr = vc.createRow()
def vci1 = vcr.ensureCriteriaItem('EmailAddress')
vci1.setOperator('=')
vci1.setValue(emailRow.EmailAddress)

def vci2 = vcr.ensureCriteriaItem('PartyId')
vci2.setOperator('<>')
vci2.setValue(PartyId)

vc.insertRow(vcr)
vo.appendViewCriteria(vc)
vo.executeQuery()
if (vo.hasNext())
{
throw new oracle.jbo.ValidationException('Contact Email cannot be duplicate ' +emailRow.EmailAddress)
return false;
}
}
}
return true;


 

Solution

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
Goal
Solution


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