Skip to main content
13-Aquamarine
May 16, 2024
Question

Email Notification from Windchill Workflow

  • May 16, 2024
  • 1 reply
  • 924 views

Hi Mahesh i have one business requirement : requirement as below -->
1) One String custome attribute we have on PromotionRequest.

2) While creating PromotionRequest creater will add the emails in that String attribute which are comma separated.

3)And I need to get that attribute values (Emails) and i have to notify those User using mail with customised subject and mail body.

So I need a help to achieve this I am very new in Workflow customization.

1 reply

HelesicPetr
22-Sapphire II
22-Sapphire II
May 16, 2024

Hi @@_1647 

You need to write a code to read the attribute with the separator in the String and believe that user input is correct 😄

PetrH. 

@_164713-AquamarineAuthor
13-Aquamarine
May 16, 2024

Yes I know the way to get attribute values using PBO  : 

com.ptc.core.lwc.server.LWCNormalizedObject obj = new

com.ptc.core.lwc.server.LWCNormalizedObject(primaryBusinessObject,null,null, null);

obj.load("theAttribute");

Object softAttribValue = obj.get("theAttribute");

if (softAttribValue instanceof String) {

yourvariablee  = (String) softAttribValue;

}

But I want use this varibale values to send emails dynamically that I need 

 

HelesicPetr
22-Sapphire II
22-Sapphire II
May 16, 2024

Hi @@_1647 

So now use substring to divide the email address from the string and send the emails to them

use  for cycle to add participants one by one 

localEMailMessage.addRecipient(participant);


PetrH