Remove Inactive Users from Opportunity Team tab using groovy
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'){