Skip to main content
1-Visitor
February 29, 2016
Question

How to get list of Released objects(documents) in mail notification in promotion approval request?

  • February 29, 2016
  • 1 reply
  • 5157 views

Hi Gurus,

I have one customer requirement that, After approving the list of promotion objects, those object names, numbers and version should be included in a mail notification.

Kindly suggest if there is any work arounnd/customization code available for the same.

Regards,

Mahesh Kumar G

1 reply

1-Visitor
February 29, 2016

Declare a string workflow variable. Use the below API to get Promotion Targets. Cast the query result to respective object types, get the name and number, store it in the variable - may be append a new line after each entry. Use the variable in activity and emails

QueryResult qLatest = wt.maturity.MaturityHelper.service.getPromotionTargets(pn);

Thank you

Binesh Kumar

Medtronic - MITG

1-Visitor
May 12, 2016

Hi Binesh,

Thanks for your reply, As i m beginner to customization, Could you please a sample code for The same. I am not sure how to Cast query results to Respective Documents.

Regards,

Mahesh

20-Turquoise
May 13, 2016

Mahesh: You can do something like the following starting with Binesh's line to get the promotion request targets

QueryResult qLatest = wt.maturity.MaturityHelper.service.getPromotionTargets(pn);

while (qLatest.hasMoreElements()) {

     Object obj = qLatest.nextElement();

     String name;

     String number;

     if(obj instanceof EPMDocument) {

          EPMDocument epmDoc = (EPMDocument)obj;

          number = epmDoc.getNumber();

          name = epmDoc.getName();

     }

     else if(obj instanceof WTPart) {

          WTPart wtPart = (WTPart)obj;

          number = wtPart.getNumber();

          name = wtPart.getName();

     }

}

Randy