Request for Quote Script PX
Hi Experts
I have created an event to try to send email to Suppliers whenever the RFQ is open.
But I don’t know how to get get the supplier list.
String suppliers = obj.getValueByAttId(RequestForQuoteConstants.ATT_RESPONSES_SUPPLIER);
ATT_RESPONSES_SUPPLIER returns an integer and suppliers return null using getValueByAttId.
Anyone has clues?
My code:
import com.agile.agileDSL.ScriptObj.IBaseScriptObj;
import com.agile.agileDSL.ScriptObj.AgileDSLException;
import com.agile.api.RequestForQuoteConstants;
// Gets the list of authorized users and invokes the pre-configured notification with these users as recipients
void invokeScript(IBaseScriptObj obj) {
// retrive the authroized users on the project when project status is changed to open
try
{
String prjStatus = obj.getValueByAttId(RequestForQuoteConstants.ATT_COVERPAGE_LIFECYCLE_PHASE);
if(prjStatus != null && prjStatus.equalsIgnoreCase(“Open”)) //project status is set to open
{
String suppliers = obj.getValueByAttId(RequestForQuoteConstants.ATT_RESPONSES_SUPPLIER);
if(suppliers != null && suppliers.length() > 0)
{
//send pre configured notification to authorized users. The user emails should have been pre configured.
StringTokenizer st1 = new StringTokenizer(suppliers,”;”);
List authorizedUsersList1 = new ArrayList();
authorizedUsersList1.add(owner);
while (st1.hasMoreTokens())
{
authorizedUsersList1.add(st1.nextToken());
}
obj.sendNotification(“New.RFQ.Notification”, false,authorizedUsersList1,””);
}
}
}catch(Exception e)
{
e.printStackTrace();
throw new AgileDSLException(e);
}//end of catch block
}