cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - If community subscription notifications are filling up your inbox you can set up a daily digest and get all your notifications in a single email. X

Custom method to get PBOs in mail notification other than Number and Name

kchaithanya
8-Gravel

Custom method to get PBOs in mail notification other than Number and Name

Hi all,

I've used below code to get WTDocument number and name in mail notification.

java.lang.String pbo_name = ((wt.doc.WTDocument) primaryBusinessObject).getName();

wt.workflow.work.WfAssignedActivity wfa=(wt.workflow.work.WfAssignedActivity)self.getObject();

wfa.setName(pbo_name);

wfa=(wt.workflow.work.WfAssignedActivity)wt.fc.PersistenceHelper.manager.save(wfa);


Same way, I need to get other PBO like Product Group and Customer name in mail notifications. I've gone through API for 10.2 M030 and found that there were two methods namely getName()/getNumber() and setName()/setNumber() which were inherited from_WTDocumentMaster.

Is there any way to create getter methods for Customer Name and ProductGroup as mentioned above with new class ?

Please suggest me the procedure including which class to inherit to do so as I'm new to this API customization.

Regards,

Krishna Chaithanya


2 REPLIES 2

You can use LWCNormalizedObject/PersistableAdapter API to get and set the attribute value .see below articles for details

https://support.ptc.com/appserver/cs/view/solution.jsp?n=CS138252

https://support.ptc.com/appserver/cs/view/solution.jsp?n=CS135663

to get other attribute’s value in notification emails you can create workflow variable and store attribute values in variable.

Add workflow variable in activity instruction to get variable values in email notification

Hope it helps

Thanks

Shreyas

tstacy
1-Newbie
(To:satre-2)

We've done similar things, however, we created a utility class with methods in it to do the actual retrieval of the data so as to minimize the amount of code in the workflow.  And in the utility class the "getter" is reusable.

Top Tags