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
ezhil_kezhil_k 

How to create a link?

when a user enter values in  fields in the form and save ,it is sending  a link in email to the approver. when the approver clicks that link,it should redirect him to the detail page of the corresponding record to approve.How to create the "Link " ?

hitesh90hitesh90

Hi,

 

You have to create Link using HTML <a> tag in your Email Template.

 

Important :
Hit Kudos if this provides you with useful information and if this is what you where looking for then please mark it as a solution for other benefits.

Thank You,
Hitesh Patel
SFDC Certified Developer & Administrator
My Blog:- http://mrjavascript.blogspot.in/

souvik9086souvik9086

You can create a link in Apex controller of the visualforce page you want to redirect like this

 

String linkSend = 'https://c.ap1.visual.force.com/apex/VFPageName';

 

Then in the email body you can mention that variable.

 

If this post is helpful please throw Kudos.If this post solves your problem kindly mark it as solution.

Thanks

ezhil_kezhil_k

I want to pass the recordID of the form which the user fills  to the  approver in the link, iS that possible?

 

hitesh90hitesh90

Yes, It's Possible.... You can set it directly...
see below Example of HTML Email Template for your reference.

 

Email Template:

<messaging:emailTemplate subject="test" recipientType="User" relatedToType="Account">
	<messaging:htmlEmailBody >
		<html>
			<body>
				<p>Dear {!recipient.name},</p>
					<p>Below is a list of cases related to {!relatedTo.name}.</p>
					<table border="0" >
						<tr>
							<th>Case Number</th><th>Origin</th>
							<th>Creator Email</th><th>Status</th>
						</tr>
						<apex:repeat var="cx" value="{!relatedTo.Cases}">
						<tr>
							<td><a href ="https://na1.salesforce.com/{!cx.id}">{!cx.CaseNumber}</a></td>
							<td>{!cx.Origin}</td>
							<td>{!cx.Contact.email}</td>
							<td>{!cx.Status}</td>
						</tr>
						</apex:repeat>
					</table>
				<p/>
			</body>
		</html>
	</messaging:htmlEmailBody>
</messaging:emailTemplate>

 

Important :
Hit Kudos if this provides you with useful information and if this is what you where looking for then please mark it as a solution for other benefits.

Thank You,
Hitesh Patel
SFDC Certified Developer & Administrator
My Blog:- http://mrjavascript.blogspot.in/

souvik9086souvik9086

Yes possible.

 

The record you want to update in save method set that record Id in the string var.

 

Thanks

ezhil_kezhil_k

Thanks  for your answers, I will try with these...

ezhil_kezhil_k

HI..

 

sorry...I forgot to mention that,i want to redirect to the vf page...tht link should be vf page link with the record id.

souvik9086souvik9086

//Capture the recordID

 

String linkSend = 'https://c.ap1.visual.force.com/apex/VFPageName?id='+recordID;

 

If this post is helpful please throw Kudos.If this post solves your problem kindly mark it as solution.

Thanks

ezhil_kezhil_k

can u put in simple sample code...

souvik9086souvik9086

How are you inserting the form data?

 

INSERT objVar;

 

//Then write

String linkSend = 'https://c.ap1.visual.force.com/apex/VFPageName?id='+objVar.ID;

 

Then in the email body you can mention that variable.

 

If this post is helpful please throw Kudos.If this post solves your problem kindly mark it as solution.

Thanks