You need to sign in to do that
Don't have an account?

wokflow-alert-dynamic recipient reg
Hi
I have the following requirement.
Using an S-Control(devloped with AJAX and javascript), users will be inserting records into a custom object. Notification Flag is one of the fields in the custom object.
Whenever a new record is created into this object with the Notification Flag check box checked, I have to send an email to two users(these user ids can be part of the cusom object).
I know how to create workflow alerts, workflow rules, email templates etc., but in all these the recipients have to be a member of a public group or profile etc.,
In this scenario, any user, selected (stored in to the custom obeject) is a recipient.
So My question is, Is there a way to dynamically decide the recipient of an email?
Thanks
Jay
If you are inserting the records using a scontrol, then you know the userids and I suggest notifying the given users using the 'send email' directly in your code, and not using workflow
E.g.
//insert records, with userid 00530000000t1di and 00530000000ooxw on the records
if(Notification Flag)
//get the email address for the two users by querying the user table
//send an email to these users using the example given at
http://forums.sforce.com/sforce/board/message?board.id=ajax_toolkit&message.id=699
}
Thanks,
It was very useful.
Jay