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

visual force page


My org is an student enrollment application.I have an contact object, application custom object and recommender custom object and admissions custom object to name a few.When a student fills the contact details , automatically an application is generated for that particular student which has all the application details.And the application object has an related list admission document which has an document name and document status like statement of intent , letter of documentation etc...which is a pick list.And the document status has a pick list of required, read for approval etc...

I need to create an recommender email address in the application object such that as soon as the student fills his application with the recommender's email address ,an email shoots to the recommender saying that that particular student is requesting an letter of recomendation.Over here the recommender is the professor who will be recommending the student.And in the email the professor should click an link , which takes him to the visual force page with all the details.( all the fields related to the recommender and applicant name) , So, I have created an recommender object which is a related list of application.So, that when a professor enters a data, it creates a record.Now, the issue is I need to get the student name automatically populated in the visual force page such that he knows to which student he is recommending.And second issue is I need to get the recommender object record to be created/inserted to that particular students application.And the third issue is I need to get the document name changed to letter of recommendation as soon as the recommender object record is created in the student's application object. Over her, recommender object and admission document object are not related to each other , Although they are related to applications object. These are my issues .I would really appreciate any help in solving me this problem.


Hi Dkn,


If I understood correctly, this is what you need :


  1. You need to create a workflow rule that will send an email when a Student application is created. This email will be sent to the Professor specified in a field within the application record.

  2. Within the email you must include a link to your Letter Of Recommendation submission VF page, and a parameter with the ID of the Student Application that letter is for. IE:

  3. When a professor hits the link, he will be taken to a LOGIN screen, he must have credentials for your org (user and pass). This can be avoided by creating a Site and making the VF Page public.

  4. When a user reaches the VF Page you will query the Student Application basing the query on Where Id = ParameterPassed. This will get you the Student Application that corresponds to that email.

  5. You can show all the information needed in the VF Page by using {!studentApplication.fieldName} or vf tags such as <apex:outputField> <apex:outputText> etc.

  6. After the information you have to have a way for your Professors to create a recommendation , for this you will include a <apex:form> and create the neccesary fields for a Letter of Recommendation to be created. ( use <apex:inputFields>) when the form is submitted you must call a Method that will UPSERT the Recommendation.

  7. To link the Recommendation to the Student Application queried, you can simply add a Look Up field in the Recommendation to a Student Application and use the Value of the Parameter (the id) as the value for that field when making the upsert.


If any of these concepts are strange to you, or you feel uneasy coding this yourself, please go to :


You will find numerous tutorials and examples of code to get started coding your App on platform.


Also, if you haven't I recommend going through the Workbook which is very good to start with: Workbook: Get Started Building Your First App in the Cloud



Hope this helps and gets you started, if you have any more questions just reply to this thread I'll try helping you.



Hi incuGus,


I really appreciate your reply.


1) I have done the workflow.


2) I have created an visual force page


3) I have created an recommender object to that corresponding vf page, when the data is entered in vf page, a record is created in recommender object.


4) I have created an look up field of application Id and formula field of applicant name in recommender object.


5) Even in the visual force page , I have created a look up field but I shoudn't be creating an look up field in the vf page i.e I shoudn't expose that and I need applicant name to be populated.The reason behind this is when the  professor click on the look up icon he can see even the other student's name and their application ID but he shoudn't be seeing them .This is the problem.


I really appreciate your reply...Thank you so much....hopefully ...I can expect an other reply from you.


thank you



Hey there .


You should not show the Look up in the VF Page. Instead you should fill it programatically.

There is a method in your controller that handles the insert, within there you must set the ID to the lookup field.

this ID is the one i suggested passing over as a parameter in the link, you can grab it like this:


- if i remember correctly , you want the professor to recommend a student right? , anyway its the same its just a name.


Then in your insert method do :



public void insertMethod(){

    // validations nedeed or whatever logic needs to be run

   this.recommendation.lookUpField = Apexpages.currentPage().getParameters().get('studentId');

   insert this.recommendation




The rest of the information will be filled by the apex:form in your VF page, but your lookUp will be filled programatically.

This way you will only show the professor the info he needs to fill, and nothing else. You can do this with as many fields as you want.


If you have any doubts, let me know!






I really appreciate your reply...thank you...I have a standard controller ...not an custom controller , so do you want me to write controller extensions and write this method.


thank you







You're gonna need to i believe.Because you have to take in the parameter and such.

Try creating it and let me know if you have any further trouble.






Thank you so much for your help...thank you...


Now, what I have done is ...I have written a trigger where once an application is created and an applicant enters the recommender's email address in the respective field, an related recommender object record is created with application ID and name automatically populated with an recommender ID created.


1) I have a visual force page with standard controller , I need to get the name automatically populated in the visual force page.


2) Then , I need to attach this page to the sites and send this as an the link I can follow up with an ?=Recommender.ID.


Please guide if I am going wrong, the part where it is confusing is do I need to write an controller extension as you said and then call that method.


thank you



Hey man,


This is how i imagine it working:


When the email is sent you add a link in the body like this :[Id of who you are recommeding]


So this takes you to your VF page. and within its controller you grab that parameter from the url.

And query the info you need to populate the fields then in your visualforce page add that info as the values of your inputs.


So yes, your approach is correct.  You need to add the "parameter grabing and querying" to your extension, and send the email with a link with the parameter.