• IanZepp-ISV
  • NEWBIE
  • 0 Points
  • Member since 2009

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 2
    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
Please help me how to to send an email using EmailTemplate with letterhead information? Am I missing something here.
 
'targetObjectId' - sets the context and ensures that merge fields in the template contain the correct data.
'templateId'  - The ID of the template to be merged to create this email.
 

//create single email message

var request = new sforce.SingleEmailMessage();

//set id

request.targetObjectId = id;

//set email template id

request.templateId = emailTemplateId;

//send email

var result = sforce.connection.sendEmail([request]);

if (!result[0].getBoolean("success")) {

throw(result[0]);

}

  • February 23, 2008
  • Like
  • 0