You need to sign in to do that
Don't have an account?
Varsha Jethwani
How to access values of Account Object and Custom Object fields from Opportunity
I am trying to check the condition in my apex code, but it fails due to highlighted code. I am trying to access field NPCT_Recur_Donation_Opps_Total_Number__c from Opportunity's Account
and similarly below condition
Anyone let me know where I am wrong
for( Oppotunity opp: OppList)
{
if((opp.NPCT_Last_Reason_Code__c == NPCT_Constants.NPCT_Last_Reason_Code_AC01 || (opp.Accounts.NPCT_Recur_Donation_Opps_Total_Number__c <= 1 || opp.npe03__Recurring_Donation__r.NPCT_Consecutive_Reversals__c == 2))
.
.
.
}
Thanks in advance
Regards,
Varsha
and similarly below condition
Anyone let me know where I am wrong
for( Oppotunity opp: OppList)
{
if((opp.NPCT_Last_Reason_Code__c == NPCT_Constants.NPCT_Last_Reason_Code_AC01 || (opp.Accounts.NPCT_Recur_Donation_Opps_Total_Number__c <= 1 || opp.npe03__Recurring_Donation__r.NPCT_Consecutive_Reversals__c == 2))
.
.
.
}
Thanks in advance
Regards,
Varsha
Directly you cant able to refer the account fields in opportunity trigger.new
Please try with below code.
If this helps, please mark it as best answer.
Regards,
Ankaiah Bandi