• slin
  • NEWBIE
  • 0 Points
  • Member since 2009

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

Hi Everyone, ive got some trouble with the SOQL References.

 

Error Code:

 

System.SObjectException: SObject row was retrieved via SOQL without querying the requested field: Order__c.Legs__r Class.PurchaseRequestController.count: line 24, column 33 Class.PurchaseRequestController.getCount: line 4, column 28 External entry point

 

my syntax: (ive marked the affected lines red)

 

List<Integer> out = new List<Integer>();

for(Order__c ord : [select Name,Algorithm__c,ExpireDate__c,Legs__c,Slab__c,Screw__c,
Quantity__c from Order__c])
{
Integer quant = (ord.Quantity__c).scale();
out[Integer.valueOf(ord.Legs__r.Id)] += quant;
out[Integer.valueOf(ord.Slab__r.Id)] += quant;
out[Integer.valueOf(ord.Screw__c)] += quant;
}

 

 

 

 some solutions?

 

  • November 18, 2009
  • Like
  • 0