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
PrattyPratty 

Inserting project in controller and using that Id in VF template

Hello Friends,

 

I am using a visualforce template, in that template I am using a custom component and a controller.

 

In controller I am trying to insert a project and want to use it's Id in anchor tag of visualforce template.

 

here's the code,

 

class test

{

       public string ProjectId {get; set;}

 

        public void Init()

        {

             Project project = new Project();

             project.name = 'testProject';

             ............

             insert project;

             ProjectId = project.Id;

        }

}

 

<messaging:emailTemplate subject="Mutual Interest for" recipientType="User" relatedToType="Contact">
<messaging:htmlEmailBody >

<c: testComponent />

<a href="https://testSites.force.com?Id= here I want to use project Id" >click </a>

......................

 

Can anybody help me to get through this.

 

Thanks and Regards,

Pratty

Rahul SharmaRahul Sharma

Try using merge fields over there.