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.

closed as unclear what you're asking by Eric, Vamsi Krishna, Alex Tennant, Mark Pond, Chris Duncombe Aug 4 '15 at 17:21

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

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;
  • 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.