You need to sign in to do that
Don't have an account?
Populate value on the VF page
I want to populate Manager's Name for the user selected in a lookup field in VF page ..
When user select EmpName - Lookup field to user on VF apge,
I want to populate its corresponding manager's name..
Kindly suggest
VF page :
<apex:column headerValue="QC/DM Name">
<apex:inputField value="{!obj.dsObj.EmpName}" rendered="{!NOT(obj.isSummaryRecord) && NOT(obj.isFirstRecord)}"/>
<apex:outputLabel value="" style="text-align:right; font-weight: bold;" rendered="{!obj.isSummaryRecord}"/>
<apex:OutputField value="{!obj.dsObj.EmpName}" rendered="{!NOT(obj.isSummaryRecord)&& (obj.isFirstRecord)}"/>
<apex:actionsupport event="onchange" action="{!SelectManager}" rerender="!obj.isSummaryRecord, mgrName" status="waitingStatus"/>
<apex:param name="UsrId" value="{!obj.dsObj.EmpName}" assignTo="{!UsrId}"/>
</apex:column>
<apex:column headerValue="Manager Name" id="mgrName">
<apex:OutputField value="{!obj.dsObj.Manager__c}" rendered="{!NOT(obj.isSummaryRecord)}"/>
</apex:column>
Controller Class :
public PageReference SelectManager()
{
String UsrId;
String UsrName ;
User usr = [Select Id, Name , Reports_To__c from User where IsActive = true and Id =: UsrId Limit 1];
UsrName = usr.Reports_To__c ;
return Null;
}
I can't be sure this will work without seeing all of the code, but this should be an improvement:
VisualForce page:
Controller:
If this helps, please mark it as a solution, and give kudos (click on the star) if you think I deserve them. Thanks!
-Glyn Anderson
Certified Salesforce Developer | Certified Salesforce Administrator