on 11-14-2011 9:38 AM
Hi All,
I am unable to find edit option for extended schema.
I have one requirement where I need to add one check box field in master agreement, when this check box is checked then alerts and notices will not be sent to collaborators.
Please help me if anyone has idea on how to handle it.
Regards,
Prabhat
Hi
You can try below mentioned approach in a document Lifecycle Management script with target either Save or Validate
1. Get the value of checkbox usine getExtensionField() method.
2. RGet all the collaborators for current doc using getCollaborators()
3. Run a loop to visit each collaborator
4. Use if condition to set Silent field to TRUE using setSilent() for collaborators in case Above checkbox field is ticked.
5. Save
Regards
Mudit Saini
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
1. Go to Setup->Configuration-> Extension Definition
2. Open Master Agreement (Extended Class Name: Master Agreement), go to Attributes
3. Click Create to create checkbox field, give internal name and display name and select Data Type as Boolean
4. Save
Also it is not possible to delete extended fields however you can choose to make them INACTIVE by setting INACTIVE = TRUE.
Hope this helps
Regards
Mudit Saini
I am trying to create a method in javascript Validate and getting parsing error while retrieving values in collaborators.
setSilentCollaborator()
{
Silent = doc.getExtensionField("DO_NOT_SEND_ALERT").get();
IF(hasValue(Silent))
{
collaborators = doc.getCollaborators();
FOR (var i=0; row = collaborators.rows<i>; i++)
{
// Iterate through Loop and set silent field for all collaborators
collaborators.setSilent()<i> = "TRUE";
} //FOR (var i = 0; row = Collaborators.rows<i>; i++)
}//IF(hasValue(silent))
}
Can you tell me what am I doing wrong?
Regards,
Prabhat
Hi
Try the following code:
import com.frictionless.api.ibean.IBeanIfc;
import com.frictionless.api.usermgmt.masterdata.UserAccountIBeanIfc;
import com.frictionless.api.ibean.OrderedSubordinateCollectionIfc;
import com.frictionless.api.contracts.*;
import java.util.*;
import java.text.SimpleDateFormat;
import com.frictionless.api.contracts.ContractIBeanIfc;
import com.frictionless.api.ibean.OrderedSubordinateCollectionIfc;
import com.frictionless.api.doc.collaboration.CollaboratorIBeanIfc;
logMsg = Logger.createLogMessage(session);
Silent = doc.getExtensionField("DO_NOT_SEND_ALERT").get();
if(hasValue(Silent))
{
CollaboratorCollection = doc.getCollaborators();
collectionsize = CollaboratorCollection.size();
if(collectionsize >0)
{
for(Iterator iterator1 = CollaboratorCollection.iterator(); iterator1.hasNext();)
{
CollaboratorIBeanIfc Collaborator = (CollaboratorIBeanIfc)iterator1.next();
if (Collaborator.getSilent().toString( ).equals ("false") )
{ Collaborator.setSilent(true);}
}
}
}
Also make sure you perform the following steps to trouble shoot:
1. Once script is executed, open the collaborator from the list and check status of Do Not Send Collaborator Alerts or Notices checkbox.
2. In case you are facing some error during execution, open the log file and trace the possible cause
Regards
Mudit Saini
Edited by: Mudit_UCB on Nov 15, 2011 12:59 PM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.