You need to sign in to do that
Don't have an account?

How to get contact associated account filed value
Hi All,
I have Account object and Issue(custom object). Issue object have look up relation with Account. I have a button called create Issue on Account object which is overriden by VF page. When I click on create Issue, i want to render some fields based on associated account region. so in my controller i want to check something like below.
If(Issue__c.Account__r.Region__c == 'abc') is this the correct way? I am getting the expected value. Can some one please help me with this pls?
Thanks.
I have Account object and Issue(custom object). Issue object have look up relation with Account. I have a button called create Issue on Account object which is overriden by VF page. When I click on create Issue, i want to render some fields based on associated account region. so in my controller i want to check something like below.
If(Issue__c.Account__r.Region__c == 'abc') is this the correct way? I am getting the expected value. Can some one please help me with this pls?
Thanks.
Please find below code for your reference:-
Issue__c issueObj = [select id,Name,Account__r.Region__c from Issue__c limit 1];
if(issueObj != null){
if(issueObj.Account__r.Region__c == 'North'){
//display your field as per your requirement
system.debug('Is North Location- '+ True);
}
else
system.debug('Is North Location- '+ False);
}
Log:-
Let me know in case of any concerns.
Please mark this answer as the solution/ best answer if it solves your purpose so that it can help other community members.
Thanks,
Pramod Nishane
Salesforce Consultant
Varasi LLC
www.varasi.com
I would recommend rendering within the visualforce page..the code will be something like this..
Let me know if you need the full code.
--
Thanks,
Prashant