Highlighted
Outstanding Contributor.. Outstanding Contributor..
Outstanding Contributor..
319 views

SRC Notification issue

Hi Guys!

I require your advice how can I send out the notification for this customer which. Please find the attached document with the steps, I have followed.

I tired to use 

jscall( "htmlemailtemplates.getMailBody", "HTML_SM ADD", $L.file, $L.file.save,email in $L.file) it also didn't work for me.

Best Regards,
Tom
0 Likes
2 Replies
Highlighted
Absent Member.. Absent Member..
Absent Member..

Re: SRC Notification issue

I'm gussing that the agency fields are the identifier for the agency and not the email adddress. The notification engine does not have a default configuration to retrieve the related email address from the dept table. Also, if they are intended to hold the actual email address values, are you populating the fields in the background on record add/save? If you check the fields are they populated in the newly opened ticket?

You could retrieve the email address based on the department value saved in the record when executing the notification. The script below provides a starting point (you would define a second function for the secondary agency). Based on the primary agency value in the record, it queries the dept table for a matching dept.name (change this field as needed). If a matching dept record is found, it returns::

1) the dept email address as "$L.primaryAgencyEmail" which can be used as the notification recipient and

2) returns a value of true or false (needtosend) which is used as the condition result so that if no matching dept record is found, the condition is set to false and SM does not attempt to send a notification.

/****************************************************************
*  Function to get the primary agency email address.   
* Called by Notification Defintion "IM ???? ????" *****************************************************************/

function getPrimaryAgencyEmail() {
var needToSend = false var recDept = new SCFile("dept"); // Select the Department Record for the primary agency specified in the record if ( recDept.doSelect("dept.name=\"" + vars.$L_file.primary_agency + "\"") == RC_SUCCESS ) { vars.$L_primaryAgencyEmail = recDept.email;
needToSend = true; } return needToSend; }

In the notification defintion, call the function above in the condition. (Remember that the function will return true or false depending on whether a dept record is found), and then use the returned email address as the recipient value. 

 

The HTML notification uses the recipient specified in the notification defintion. There is no need to include it as a parameter in the jscall for the notification: You actually don't even need $L.file.save if the notification is not referencing the saved record.

jscall( "htmlemailtemplates.getMailBody", "HTML_SM ADD", $L.file, $L.file.save) 
jscall( "htmlemailtemplates.getMailBody", "HTML_SM ADD", $L.file)

 

----------------------------------------------------
Kudos - what, where, how, and why
Want Good Answers? Ask Good Questions...
0 Likes
Highlighted
Acclaimed Contributor.
Acclaimed Contributor.

Re: SRC Notification issue

Could you clarify couple of things:

  • which SRC version you use?
  • are you using (or is it your intention to use) Dynamic Field Validations to retrieve email address from dept table?
  • And you have used SRC Tailoring - added primary.agency and secondary.agency to your customized Checkout screen (and mapped the right fields).
  • Are you currently able to retrieve any value to primary.agency and secondary.agency fields?

If you're using Dynamic Field Validations, please add a screenshot from the item's fields User Selections and its Dynamic Validations.

i'm trying to understand were you are standing - and in my view, you should be able to pull the email addresses from dept via SRC by using Dynamic Field Validations and no additional scripting is needed.

---
Moving on, this account is no longer active. Best regards, Kelalek
- So Long, and Thanks for All the Fish
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.