You need to sign in to do that
Don't have an account?
Lemington
SOQL Syntax
We are running a relationship SOQL query (Account and Contact) which both have a FAX field. We have tried to alias the field names to distinguish the two fields without success. In the queryresult set, we can correctly reference one field through the "FAX" field name. Question: How do we reference the other FAX field?
Also, if there is a good SOQL reference, could you please point us in the right direction.
Thank you.
Query text is below. We tried many combinations of "Account.Fax", "Contact.Account.Fax", FAX1, FAX2, FAX_1, etc., without success. The Phone and Category fields will require a similar solution.
SELECT Contact.Account.Name, Contact.Account.Phone, Contact.Account.Fax, Contact.Account.Category__c, Contact.Salutation, Contact.FirstName, " & _
"Contact.LastName, Contact.Title, Contact.MailingStreet, Contact.MailingCity, " & _
"Contact.MailingState, Contact.MailingPostalCode, Contact.MailingCountry, " & _
"Contact.Phone, Contact.MobilePhone, Contact.Fax, Contact.Email, Contact.Category__c FROM Contact
if you have a query
select Fax, Account.Fax from contact
then typically you'd access these fields by doing
Contact c = (Contact)qr.getRecords()[0];
c.getFax();
and
c.getAccount().getFax();
The exact syntax will depend on what soap client & language you're using.