You need to sign in to do that
Don't have an account?
rv90
Get a value from account object in custom object trigger
Hi there,
I have financial Account as a custom object and account as a standard object,
In financial object i have a look up relation field (Client_Account__r) with account.
Now, i am coding in FinancialAccount trigger handler class - I need to fetch "Name" value from Account.
By using formula field i successfully got the value from account object by using - - Client_Account__r.name
But when coding in apex trigger class, i am not able to fetch the value- below is my code-
Client_Account__c is a custom field in financial account object and is a lookup with account object.
I have financial Account as a custom object and account as a standard object,
In financial object i have a look up relation field (Client_Account__r) with account.
Now, i am coding in FinancialAccount trigger handler class - I need to fetch "Name" value from Account.
By using formula field i successfully got the value from account object by using - - Client_Account__r.name
But when coding in apex trigger class, i am not able to fetch the value- below is my code-
for (Financial_Account__c fa:triggernew) { string finalstr=''; string totalstr=''; string cName = fa.Client_Account__r.Name; IF(cName!= Null){ IF( cName.contains ('NDT/')) { totalstr= cName.removeStart('NDT/'); }else{ totalstr = cName; } } }I am getting null in cName variable .
Client_Account__c is a custom field in financial account object and is a lookup with account object.
Let us know if this will help you
All Answers
Let us know if this will help you