cancel
Showing results for 
Search instead for 
Did you mean: 

Collaborator delete

Former Member
0 Kudos

Hi,

I have a requirement to delete all user group except a couple while creating an agreement from a master agreement. I have the following code, but in the create event the collaborator collection size is only 1 (owner) even though the master agreement has more than 1 collaborator. Hence my code does not delete the required groups. If I put in a validate event it gives the correct size of collaborators and deletes too. But I do not want to perform the delete in that event since I could accidently delete manual entries. Please advise where I can trigger this or an alternate way to solve this issue.

DeleteGroupCollaborators()
{

//Get the Collaborator Bean details
collabcol = doc.getCollaborators();

Logger.info(logMsg.setLogMessage("Collab Size"+collabcol.size()));
Iterator iter = collabcol.iterator();
while (iter.hasNext())
{
item = iter.next();
collabname = item.getDisplayName();
Logger.info(logMsg.setLogMessage("Collabname"+collabname));


if (!"Accounts Payable".equals(item.getDisplayName()){
iter.remove();
}
}
}

Thanks in advance,

Rani

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Rani,

Check the LOCK_ROLE and LOCK_PRINCIPAL field values in the Collaborator collection.

I think one of them is stores the information whether the given collaborator was added by the system (based on setting in the Setup > Document Security Template > Master Agreement Security Template - New Documents) or by the user. So you can put your code into the validation event.

Regards,

Adorjan

Former Member
0 Kudos

Thanks Adorjan. That was something I didnt know  that I could use in another of my requirement.

Unfortunately Validation event does not work as it creates confusion. For .e.g. the user creates wants to add a group "Group1" to the agreement. It is  one of the groups that gets deleted when brought from Master agreement. Since the group is present during creation, the user does not add it again and it gets deleted during saving. I need actually to delete before the user sees it .i.e during creation.

Any ideas ?

Thanks,

Rani

Answers (0)