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

Community Tip - You can change your system assigned username to something more personal in your community settings. X

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

kchaithanya
10-Marble

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
12-Amethyst
(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.

Announcements


Top Tags