• Aaron Gilbertson
  • NEWBIE
  • 4 Points
  • Member since 2017

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 2
    Replies

Have created a few custom fields against Opportunity.

AgencyAccount -> Link to Account record (only accounts deemed as 'agents')
AgencyContact -> Link to contact (only contacts from accounts deemed to be 'agents')

and a couple other date and status fields

all of them work fine except for AgencyContact?

i include it in my SOQL query and it just won't come through - but it doesnt give me an unknown field error either - the results as an array look like this:
stdClass Object ( [Id] => 0067F00000AGqRiQAL [AgencyAccount__c] => 0017F00000MPAwtQAH [AgencyBooking__c] => 1 [AgencyDiscount__c] => 10 [Amount] => 3300 [Campaign] => stdClass Object ( [Id] => [Name] => APGA 50th Anniversary Publication ) [CloseDate] => 2018-03-30 [Contact__c] => 0037F00000K8iH4QAJ [Name] => TAP [OpportunityLineItems] => stdClass Object ( [done] => 1 [queryLocator] => [records] => Array ( [0] => stdClass Object ( [Id] => [CurrencyIsoCode] => AUD [Description] => ERHP [ListPrice] => 3300 [Name] => TAP Early Right Hand Full Page [PricebookEntry] => stdClass Object ( [Id] => [Product2Id] => 01t7F000002rW2mQAE ) [Product2] => stdClass Object ( [Id] => [Name] => Early Right Hand Full Page ) [TotalPrice] => 3300 [UnitPrice] => 3300 ) ) [size] => 1 ) [Owner] => stdClass Object ( [Id] => [Name] => Dave Marsh ) ) SObject Object ( [type] => [fields] => )


query:
Select Id,Contact__c,Amount,CloseDate,Name,Campaign.Name,Owner.Name,AgencyBooking__c,AgencyContact__c,AgencyAccount__c,AgencyDiscount__c,(Select PricebookEntry.Product2Id,TotalPrice,UnitPrice,ListPrice,CurrencyIsoCode,Name,Description,Product2.Name From OpportunityLineItems) From Opportunity WHERE AccountID = '##salesforce_id##' AND StageName='Closed Won' AND Booking_Status__c = NULL

ready for the really weird part?

when i do the same query in the free soql builder app

(https://soqlbuilder.herokuapp.com/)

i get the field data!!!
User-added image

driving me absolutely nuts!!

happy to provde any more code or anything if anyone has questions, but i have run several queries before with no issues

i updated the WSDL file too and in it, the custom field is defined and everything!!
 

Have created a few custom fields against Opportunity.

AgencyAccount -> Link to Account record (only accounts deemed as 'agents')
AgencyContact -> Link to contact (only contacts from accounts deemed to be 'agents')

and a couple other date and status fields

all of them work fine except for AgencyContact?

i include it in my SOQL query and it just won't come through - but it doesnt give me an unknown field error either - the results as an array look like this:
stdClass Object ( [Id] => 0067F00000AGqRiQAL [AgencyAccount__c] => 0017F00000MPAwtQAH [AgencyBooking__c] => 1 [AgencyDiscount__c] => 10 [Amount] => 3300 [Campaign] => stdClass Object ( [Id] => [Name] => APGA 50th Anniversary Publication ) [CloseDate] => 2018-03-30 [Contact__c] => 0037F00000K8iH4QAJ [Name] => TAP [OpportunityLineItems] => stdClass Object ( [done] => 1 [queryLocator] => [records] => Array ( [0] => stdClass Object ( [Id] => [CurrencyIsoCode] => AUD [Description] => ERHP [ListPrice] => 3300 [Name] => TAP Early Right Hand Full Page [PricebookEntry] => stdClass Object ( [Id] => [Product2Id] => 01t7F000002rW2mQAE ) [Product2] => stdClass Object ( [Id] => [Name] => Early Right Hand Full Page ) [TotalPrice] => 3300 [UnitPrice] => 3300 ) ) [size] => 1 ) [Owner] => stdClass Object ( [Id] => [Name] => Dave Marsh ) ) SObject Object ( [type] => [fields] => )


query:
Select Id,Contact__c,Amount,CloseDate,Name,Campaign.Name,Owner.Name,AgencyBooking__c,AgencyContact__c,AgencyAccount__c,AgencyDiscount__c,(Select PricebookEntry.Product2Id,TotalPrice,UnitPrice,ListPrice,CurrencyIsoCode,Name,Description,Product2.Name From OpportunityLineItems) From Opportunity WHERE AccountID = '##salesforce_id##' AND StageName='Closed Won' AND Booking_Status__c = NULL

ready for the really weird part?

when i do the same query in the free soql builder app

(https://soqlbuilder.herokuapp.com/)

i get the field data!!!
User-added image

driving me absolutely nuts!!

happy to provde any more code or anything if anyone has questions, but i have run several queries before with no issues

i updated the WSDL file too and in it, the custom field is defined and everything!!
 

Have created a few custom fields against Opportunity.

AgencyAccount -> Link to Account record (only accounts deemed as 'agents')
AgencyContact -> Link to contact (only contacts from accounts deemed to be 'agents')

and a couple other date and status fields

all of them work fine except for AgencyContact?

i include it in my SOQL query and it just won't come through - but it doesnt give me an unknown field error either - the results as an array look like this:
stdClass Object ( [Id] => 0067F00000AGqRiQAL [AgencyAccount__c] => 0017F00000MPAwtQAH [AgencyBooking__c] => 1 [AgencyDiscount__c] => 10 [Amount] => 3300 [Campaign] => stdClass Object ( [Id] => [Name] => APGA 50th Anniversary Publication ) [CloseDate] => 2018-03-30 [Contact__c] => 0037F00000K8iH4QAJ [Name] => TAP [OpportunityLineItems] => stdClass Object ( [done] => 1 [queryLocator] => [records] => Array ( [0] => stdClass Object ( [Id] => [CurrencyIsoCode] => AUD [Description] => ERHP [ListPrice] => 3300 [Name] => TAP Early Right Hand Full Page [PricebookEntry] => stdClass Object ( [Id] => [Product2Id] => 01t7F000002rW2mQAE ) [Product2] => stdClass Object ( [Id] => [Name] => Early Right Hand Full Page ) [TotalPrice] => 3300 [UnitPrice] => 3300 ) ) [size] => 1 ) [Owner] => stdClass Object ( [Id] => [Name] => Dave Marsh ) ) SObject Object ( [type] => [fields] => )


query:
Select Id,Contact__c,Amount,CloseDate,Name,Campaign.Name,Owner.Name,AgencyBooking__c,AgencyContact__c,AgencyAccount__c,AgencyDiscount__c,(Select PricebookEntry.Product2Id,TotalPrice,UnitPrice,ListPrice,CurrencyIsoCode,Name,Description,Product2.Name From OpportunityLineItems) From Opportunity WHERE AccountID = '##salesforce_id##' AND StageName='Closed Won' AND Booking_Status__c = NULL

ready for the really weird part?

when i do the same query in the free soql builder app

(https://soqlbuilder.herokuapp.com/)

i get the field data!!!
User-added image

driving me absolutely nuts!!

happy to provde any more code or anything if anyone has questions, but i have run several queries before with no issues

i updated the WSDL file too and in it, the custom field is defined and everything!!