function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Alex_Solar1Alex_Solar1 

Way to limit workflow email alerts?

I am integrating salesforce with order, delivery, and invoice information from SAP.  I want this information to be available to our customer portal users.  The way that our SAP data is set up, we have a one-to-one relationship between order, delivery, and invoice line items, so the integration becomes MUCH easier when we can just pass all the line items to one custom object rather than trying to integrate header info and line items into 6 different related custom objects. 
This solution would make for simple reports that our portal users could understand.  However, I also want portal users to receive email alerts for things such as new deliveries, invoices due in a few days, etc.  Each delivery or invoice has a few line items, though, so in this case users would get an email for every line item.  For example if a shipment was sent to them with three line items, they would get three line items when it shipped, and then three more when the invoice was due.  Is there a way to limit the number of emails sent to a user to one a day?  Does anyone have any other ideas of a good way to accomplish what I want?  Any help would be much appreciated!
RickyGRickyG
Alex -

I was working with someone a while back and came up with a suggestion that might work.  The issue is getting one email for multiple line items.  You want a way to determine when one order is submitted, and then you could work out the email to include the line items.

The solution was to have a parent record with a rollup summary field, which collected the MAX value for an field that only changed once per order - like say, order number.  (In the previous case, we used a date field, since there were nightly additions).  The workflow is fired when the rollup changes.  This takes care of the reduction in email messages. 

But the order number would change with the first item, right?  You can account for this by spawning a timed workflow that would run a reasonable amount of time after the field changed, which would allow for the order to be completed.

Make sense?  So crazy, it just might work.
EmsEms

Hi there - this is very close to something I am working on... the problem I am having is that I would like to include data off of the child record to include in the email... My example is as follows:

 

Assume a contact is a real estate agent with home listings for sale.  The contact is the parent on a master-detail relationship to Listings.

I would like to send an email to the Contact about the Highest price listing - so I create a rollup summary field max(lisitng price). However, I need to know the address of this listing in my email!  How do I pull the address of the listing into either the contact record or email?

 

I can see other, more code intensive ways of doing this (create a check box and some code that checks it if the listing is the most expensive) but I am hoping there is an easier way!

 

Thanks,

EMS