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
KunalKunal 

Execute S-Control Using Trigger

I have a requirement to send email to a administrator when an account's name has changed. I want to do the following:
 
1) Create a trigger on Account After Update
2) This trigger will call an S-Control that has interface for sending email (the same s-control example on the home page)
3) I would like to populate the S-Control body with the name of the old account and new account
4) User clicks on 'Send' which sends the email.
 
Please advise if this is doable and if yes, how this can be achieved. I am trying to find posts that shows how to call an s-control from trigger and pass parameters.
 
Alternatively, I Want some way to make the account name read only which I think is not possible out-of-the-box in Salesforce.com
DevAngelDevAngel
Triggers have no way to cause an scontrol to run.  Interaction with the ui is limited to pushing error messages to the ui.

You should look at workflow.  You can set up a workflow process that is triggered on the change of the account name and cause an email message to be sent. 



Cheers
KunalKunal

How can you use Workflow to track update to a single field? Say the account name was 'ABC' and when only it chnages to 'XYZ' I need to send an email to administrator.

Also, in the email I need to include a hyperlink that opens a webpage on our intranet and does some database update on SQL 2000 database on our side.

So, I need someway to have a custom hyperlink in the outbound email that has parameters from the old account (name and some custom field) and new account name like below:

http://intranet/SomePage.aspx?OldName=[[OLDNAME]]&NewName=[[NewName]]&SomeId=[[CUSTOMFIELD]]

Let me know how all this can be achieved in SF using workflow or some other way.

Thanks.

SaurabhRawaneSaurabhRawane
I have a way to achieve half of your thing,hope it might prove useful.
Here it is:

1. Write a Trigger around update of that record.
2. Trigger will set some Custom Field as true.
3. Write a WorkFlow rule around the above Custom Field to send an HTML email,containing the link of the new record.

If you find anyother way around do post it...

Thanks,
Saurabh Rawane