You need to sign in to do that
Don't have an account?
Jagadeesh Adaveni
Can you please help me out?
Hi All,
I have Location and student objects are there. In Location object multiselect picklist paymentmode is there with values(ACH,Check,Cash) and student is lookup to location and even in Student i have picklist called paymentmode with values(ACH,Check,Cash).
Requirement is Whatever the values i selected in Location only those values should appear in student. I tried following code but it is not working
I have Location and student objects are there. In Location object multiselect picklist paymentmode is there with values(ACH,Check,Cash) and student is lookup to location and even in Student i have picklist called paymentmode with values(ACH,Check,Cash).
Requirement is Whatever the values i selected in Location only those values should appear in student. I tried following code but it is not working
VisualforcePage ---------------------- <apex:inputField value="{!Student__c.Payment_Mode__c}"> <apex:actionSupport event="onchange" action="{!picklistFunction}"/> </apex:inputField> Controller -------------- public PageReference picklistFunction() { List<Student__c> studentList = new List<Student__c>(); List<Student__c> stuList = [select id,name,Payment_mode__c,Location__c,Location__r.Payment_mode__c from Student__c]; for(Student__c st : stuList) { st.payment_mode__c = st.Location__r.Payment_Mode__c; studentList.add(st); } update studentList; return null; }
In student obj u can create one formula field in that store "Location__r.Payment_mode__c" its a simple solution.
Mark its as best answer if its helps.
Thanks.
It is giving error saying that Error: Field Payment_mode__c is a multi-select picklist field. Multi-select picklist fields are only supported in certain functions.