Let's Reconnect, thank you for making 2022 our best year yet.

Look Back
Remove Inactive Users from Opportunity Team tab using groovy — Cloud Customer Connect
You're almost there! Please answer a few more questions for access to the Applications content. Complete registration
Interested in joining? Complete your registration by providing Areas of Interest here. Register

Remove Inactive Users from Opportunity Team tab using groovy

Accepted answer
4
Views
1
Comments
in Sales 1 comment

Summary: Remove Inactive Users from Opportunity Team tab using groovy

Hi Team,

We wrote below script to remove Inactive Users from Opportunity Team tab using groovy. But it is not working as expected.

Can anyone help us here.

def OpptyResourcesIterator = nvl(OpportunityResource, null);

while(OpptyResourcesIterator.hasNext())

{

def OpptyResourcesVORow = OpptyResourcesIterator.next();

Long existingResourceId = OpptyResourcesVORow.getAttribute('ResourceId');

def resources = newView('Resource')

def vc = newViewCriteria(resources)

def vcr = vc.createRow()

def vci1 = vcr.ensureCriteriaItem('PartyId')

vci1.setOperator('=')

vci1.setValue(existingResourceId)

vc.insertRow(vcr)

resources.appendViewCriteria(vc)

resources.executeQuery()

while(resources.hasNext())

{

def row = resources.next();

def ActiveFlag = row.getAttribute('UserAccountActiveFlag')

if(ActiveFlag == 'N'){

Howdy, Stranger!

Log In

To view full details, sign in.

Register

Don't have an account? Click here to get started!