You need to sign in to do that
Don't have an account?
balakrishna mandula 19
Disabling picklist value from user lookup in visualforce page
Hi
I am writing visualforce page in that I have Owner lookup field which is having lookup to Queue and User. If I select User then user values will be populated and if select Queue as pickilst Queues will be popoulated.
My requirement is only Queue should be there in pickilist, not the User.
Please help me in resolving this.
I used below javascript to hid User value.
function hid(){
owner = "pageId:formId:pgBlckId:j_id84:6:j_id85:j_id86:0:j_id87_mlktp";
var drop=document.getElementById(owner);
drop.options[1].selected = true;
drop.remove(0);
}
window.onload = hid;
with the above code I can hide the User value. Queue only is visible but user values are displaying not the Queue values.
please help me in resolving this
I am writing visualforce page in that I have Owner lookup field which is having lookup to Queue and User. If I select User then user values will be populated and if select Queue as pickilst Queues will be popoulated.
My requirement is only Queue should be there in pickilist, not the User.
Please help me in resolving this.
I used below javascript to hid User value.
function hid(){
owner = "pageId:formId:pgBlckId:j_id84:6:j_id85:j_id86:0:j_id87_mlktp";
var drop=document.getElementById(owner);
drop.options[1].selected = true;
drop.remove(0);
}
window.onload = hid;
with the above code I can hide the User value. Queue only is visible but user values are displaying not the Queue values.
please help me in resolving this
Use actionSupport on your picklist to rerender the container of your lookup field. Something like this:
Thanks
Rupal Kumar
http://mirketa.com
I am not using <apex:inputField value="{!myObject__c.myPicklist__c}"> for the pagelayout. I am taking fields from fieldsets. That's why I used owner = "pageId:formId:pgBlckId:j_id84:6:j_id85:j_id86:0:j_id87_mlktp";
Owner is lookup field as Owner(User, Queue). I need to disable User from Owner. I am able to diable user value from picklist. when I am selecting value from look up user values only fetching not the Queue values.
Below is the code:
<apex:page showHeader="false" sidebar="false" standardController="Case" extensions="Extenstion" id="pageId">
<apex:form id="formId">
<script>
function hid(){
owner = "pageId:formId:pgBlckId:j_id88:j_id89_mlktp";
var drop=document.getElementById(owner);
drop.options[1].selected = true;
drop.remove(0);
}
window.onload = hid;
</script>
<apex:pageBlock title="New Task" id="pgBlckId">
<apex:pageBlockButtons >
<apex:commandButton value="Save Task" action="{!saveTask}" status="actStatusId"/>
<apex:pageBlockSection title="Assignment Details">
<apex:inputField value="{!Task.OwnerId}"/>
<apex:inputField value="{!Task.BMCServiceDesk__FKOpenBy__c}"/>
</apex:pageBlockSection>
</apex:pageBlock>
</apex:form>
Controller:
global without sharing class Extension{
public PageReference saveTask(){
PageReference pageRef;
Database.UpsertResult ur = Database.upsert(Task);
pageRef = new PageReference('/apex/ABI_BSC_My_TaskPage');
pageRef.setRedirect(True);
return pageRef;
}