You need to sign in to do that
Don't have an account?
Manoj Deshmukh
we select in user lookup can only edit/change values from 2nd and 3rd field
Create 3 fields on VF page. One is lookup to user, 2nd is picklist and 3rd one is text field
Now, we need to implement the functionality like as below
The person that we select in user lookup can only edit/change values from 2nd and 3rd field. In case of other user, other than selected user in user lookup, user cannot change the value. Instead it will come as readonly
Now, we need to implement the functionality like as below
The person that we select in user lookup can only edit/change values from 2nd and 3rd field. In case of other user, other than selected user in user lookup, user cannot change the value. Instead it will come as readonly
Please use below code:
Please let me know if helped.
Regards,
Ramakant
Please try below code:
<apex:form id="theForm">
<apex:actionFunction name="refreshPage" rerender="theForm"/>
<apex:pageBlock id="theBlock">
<apex:pageBlockSection id="theSec" >
<apex:inputField value="{!Customer__c.User__c}" id="accName" onchange="setResult();" />
</apex:pageBlockSection>
<apex:pageblockSection id="theSec1">
<apex:inputField value="{!Customer__c.Name}" id="accName1" />
<apex:inputField value="{!Customer__c.Type__c}" />
</apex:pageblockSection>
</apex:pageBlock>
<script>
function setResult(){
var spans = document.getElementById('thePage:theForm:theBlock:theSec:accName').value;
if(spans != $User.Id){
document.getElementById('thePage:theForm:theBlock:theSec1:accName1').readOnly=true;
refreshPage();
}
}
</script>
</apex:form>
</apex:page>