• Violeta Grigorova
  • NEWBIE
  • 0 Points
  • Member since 2018

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 0
    Replies
I have a custom Object SBQQ__Subscription__c. It has some fields that I want to retrieve. This is my controller:

public with sharing class ActiveController_2 {
    
    private ApexPages.StandardController stdController;
    private final Account acct;

    public ActiveController_2(ApexPages.StandardController stdController) {
        this.stdController = stdController;
        this.acct = (Account)stdController.getRecord();
     }

public List<SBQQ__Subscription__c> getSubscriptions() {
        List<SBQQ__Subscription__c> subscriptionResults = [SELECT Name, MasterDeviceName__c, SBQQ__ProductName__c, Location__c, DeviceId__c, SBQQ__ContractNumber__c, Server_Status__c  FROM SBQQ__Subscription__c WHERE DeviceId__c LIKE :acct.AccountNumber];
        return subscriptionResults;
    }
}

I get the following errror: SObject row was retrieved via SOQL without querying the requested field: Account.AccountNumber 

I read through the forum and I saw that there are other people having the same issue and I get that I should mention Account.AccountNumber somewhere in my query, but I cannot understand how.

Also, I went through the WSDL of our organisation and here is what I found on the SBQQ__Subscription__c object:

<complexType name="SBQQ__Subscription__c">
<complexContent>
<extension base="ens:sObject">
<sequence>
<element name="SBQQ__Account__c" nillable="true" minOccurs="0" type="tns:ID"/>
<element name="SBQQ__Account__r" nillable="true" minOccurs="0" type="ens:Account"/>


If you could give me an idea of what is going on in here?
Thank you,
Violeta