You need to sign in to do that
Don't have an account?
mnoorgat
Getting Account Name from Case
Hi,
A quick question, how can I get the "Account Name" linked to a case?
I thought I'd have to do something like:
sforce.Case cas = (sforce.Case)qr.records[i]
string accName = cas.AccountName;
Except the WSDL doesn't define AccountName. What am I missing?
Thanks.
Hi mnoorgat,
A case can be parented by a contact. If there is a contact id on the case, then you will need to first obtain the contact. Once you have the contact you can check to see if the contact has an account id. If so, you then need to obtain the account name based on the account id from the contact record.
Net-net is that it will take 2 more calls (retrieve or query) to obtain the account name for an account indirectly associated with a case.
Thanks Dave,
Sorry for my delay in replying. Your answer was very useful in helping me decide the approach to take for a solution I'm building.
Question: I'm stiill interested in knowing wheteher ot not it would be possible to use a join of some kind to reduce the number of calls to get the Account Name from a Case to just one query? Or will the 2 additional calls you mentioned always stand? (Will it still be the same for the 6.0 api?)
Thanks for all your help.
Hi mnoorgat,
Until we design and publish join support in our API the 2 calls will stand. We will be publishing join support at some point in the future.