Skip to main content
Hi,

I have a look up field on visual force page. Need a look up to user. So querying contact by logged in user and making use of contact.reportsId as the value of input field. This is bringing up the look up field to user and wanted the input field before the glass icon to be disabled. so I did this way. 

  • <apex:inputField id="requestor" value="{!contact.ReportsToId}"  html-disabled="true">

I also have a button besides the input field as below 

  • <apex:commandButton value="Submit" action="{!doSave}"/>

so whenever a user picks up a user by the glass icon and clicks on submit, I want the text of value sent to my controller in doSave method.

For example: if I pick Priyanka Pallepati as the user by clicking the glass icon of look up field, I want to send Priyanka Pallepati to my doSave method.

How do I achieve this? Any suggestions would be highly appreciated.

Regards,

Priyanka.
6 answers
  1. Aug 21, 2015, 9:39 PM
    Hi Priyanka,

    This is impossible, in the con.ReportsToId, you must be getting a contact Id and if you query on contact with that id, it must return the record. Check my code, in the where clause I am comparing

    where Id =: con.reportsToId

     and I think your query is like

    where reportsToId =: con.reportsToId

    the later will not return any record, beacuse as you checked all the contacts in your org have reportsToId as null. If you still faces the issue, either provide me your org credentials or contact me on my email Id:

    neetu.bansal.5@gmail.com

    Thanks,

    Neetu
0/9000