You need to sign in to do that
Don't have an account?
Alex Von Hassler
How can I update a field value by clicking on a link sent in an email?
Hi, I would like to update a field value when a user clicks on a link or button on a email sent out by salesforce.
We have a workflow that sends out automatic reminders about certain jobs. I would like to setup a second workflow that sends an email 2 days later with a button or link (e.g. "Job completed? Yes, No?") for the user to click on. That button or link should then update a field value in salesforce to "Job completed" or "Job cannot be completed". It doesn't matter if it's a picklist or text field, - I just can't figure out a way to update a field by clicking on a button/link in an email.
I greatly appreciate any help.
Alex
We have a workflow that sends out automatic reminders about certain jobs. I would like to setup a second workflow that sends an email 2 days later with a button or link (e.g. "Job completed? Yes, No?") for the user to click on. That button or link should then update a field value in salesforce to "Job completed" or "Job cannot be completed". It doesn't matter if it's a picklist or text field, - I just can't figure out a way to update a field by clicking on a button/link in an email.
I greatly appreciate any help.
Alex
You can achieve this requirement by using Salesforce Site. For this you have to create site, visualforc page, apex class and email template. Go through the following steps.
http://mydomain.force.com/ updateJobStatus? recId =a1cN0000000Vr6R& isJobCompleted Yes
http://mydomain.force.com/ updateJobStatus? recId =a1cN0000000Vr6R& isJobCompleted =No
When user click on given link then visualforce page will open and record will update automatically.
Regards,
Yogesh More
more.yogesh422@gmail.com || Skype:-yogesh.more44
All Answers
You can create custom button/link and execute java-script code to update specified field.
For your reference you use following code.
Let us know if it helps you.
Regards,
Yogesh More
more.yogesh422@gmail.com || Skype:-yogesh.more44
Thank you for helping out. This button works great within salesforce, but I was hoping to send out a link in an email that can update a field.
The user shouldn't even have to be in salesforce for this.
Thank you,
Alex
You can achieve this requirement by using Salesforce Site. For this you have to create site, visualforc page, apex class and email template. Go through the following steps.
http://mydomain.force.com/ updateJobStatus? recId =a1cN0000000Vr6R& isJobCompleted Yes
http://mydomain.force.com/ updateJobStatus? recId =a1cN0000000Vr6R& isJobCompleted =No
When user click on given link then visualforce page will open and record will update automatically.
Regards,
Yogesh More
more.yogesh422@gmail.com || Skype:-yogesh.more44
I added the visual force page, updated the apex class with the correct object name/field name and tested the email template, but when I click on the link to go to the VF page I get this:
Any idea on how I could solve this?
Thank you so much!
Alex
Go to (Setup | Develop | Sites) and click on public access setting.
Site should be active.
Add created page as an Active Site Home Page.
This setup is based on your posts and those of a previous topic.
Custom Object: Customer_Issue__c
Custom Field: Status__c (type picklist with options=: "Solved" and "Not Solved")
I have a workflow that sends out a HTMl email with the two links. The links are setup with the custom site and custom object ID.
Next is the visual force page:
Here is the Apex class:
I don't get any errors and can get to the page when I click on the link in the email. I must be losing the connection somewhere along the line. The field just doesn't update.
Any idea what could be wrong or missing?
Thank you!
Alex
Regards,
Yogesh
more.yogesh422@gmail.com || Skype:-yogesh.more44
http://www.yogeshmore.com/ || +919096872010
I've given object permissions to the user and added the site and class to the profile.
I also added the Site Guest User to the Debug Logs, but it's not showing any logs for the user when I send the email and click on the link.The only logs I get are the ones from the workflow that sends the email.
I have the feeling that there is a disconnect between the link in the email and the apex class. Any idea why, or what I could try next?
Thank you,
Alex
I figured it out! After I implemented your last suggestion I also had to change the Object ID in the link to the Record ID by using a merge field in the email template. Now it works perfectly!
I hope these posts will help someone else out there.
Thank you SO much for your help YogRaj!
Alex
The Sims Freeplay Mod Apk (https://f5zones.com/the-sims-freeplay-mod-apk/)
i tried this whole setup in my developer org and it is working fine. But whem i try cretaing the same on my Sandbox i am getting the below error for Apex class. Please help asap
Error: Compile Error: Variable does not exist: Id at line 15 column 13
public class updateDownloadedStatus{
public String recId {get;set;}
public String isJobCompleted {get;set;}
public updateDownloadedStatus()
{
recId = ApexPages.currentPage().getParameters().get('recId');
//isJobCompleted = ApexPages.currentPage().getParameters().get('isDownloadCompleted');
}
public PageReference updateRec()
{
Contact obj = new Contact();
obj.Id = recId;
obj.testM__IsDownloaded__c =true;
update obj;
return null;
}
}
Thanks in advance
Harshitha
Also, get on (https://emiratesapk.com/)
If you are looking for some online Quran learning apps I'm gonna share them with you
Online Quran Classes (https://www.onlinequranclasses.com/)
Learn Quran Online (https://www.myqurantutor.com/)
Once I followed your suggestions, I observed that I will have to make changes in the Object ID to the Record ID in the link as indicated via email template Like (https://oldrollmodapk.com/). It now works fine!