0

I have a sObject which has a Long Text Area field "Account_Id" which contains , "'Account Name'+Account.name" but when i want to replace "Account.name" value from my Apex class than i am failed. e.g.

Account = [select Name from Account where Id =: oId LIMIT 1] ;
Temp_c sTemp = [select Account_Id from Temp_c where Id =: sId LIMIT 1 ];
String sFinal = sTemp.Account_Id ;

sFinal should be like 'Account Name'+Ravi (Account name is Ravi)

Please help me to get 'Account Name'+Ravi. Thanks in Advance.

1

Given what you posted, this may be what you want...

Account a = [select Name from Account where Id =: oId LIMIT 1] ;
Temp_c sTemp = [select Account_Id from Temp_c where Id =: sId LIMIT 1 ];
String sFinal = 'Account Name ' + a.name;
| improve this answer | |
  • Thanks for your help Eric, but i just want to call String sFinal = sTemp.Account_Id; and it should be populate oAccount.name value to string when i'm trying to get this field to visualforce page than i'm getting "Account Name'+oAccount.name". Account oAccount = [select Name from Account where Id =: oId LIMIT 1] ; Temp_c sTemp = [select Account_Id from Temp_c where Id =: sId LIMIT 1 ]; String sFinal = sTemp.Account_Id ; – kumar gaurav Aug 4 '15 at 4:33
  • @kumargaurav - I have no idea what you are trying to do. – Eric Aug 4 '15 at 12:56

Not the answer you're looking for? Browse other questions tagged or ask your own question.