• Pavan Kumar Desabhatla 8
  • NEWBIE
  • 0 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 1
    Replies
My question, I have the following objects that I’m trying to query on and get the results.

Request__c ,Request_item__c have a master detail relation and Catalog_item__c has a look up to the Request_item__c.

The query below  would run just fine if I pass a request ID value in developer console.

I have a VF page that would render the output with an id again.

However when placed this in a class constructor and give it the ID from trigger.new it would fail to retrieve any rows.

Any help in this regard is appreciated.

select Name,Request__r.Name,
             Request__r.Contact__c,
            Request__r.Lead__c,
             Catalog_item__r.Name,
             Request__r.Request_Details_rtf__c,
             quantity__c,
             Catalog_item__r.cost_center__c,
             Catalog_item__r.sizeoptions__c,
             request__r.Send_to_Company__c,
             request__r.Send_to_Contact__c,
             request__r.Request_Shipping_Street__c,
             request__r.Request_Shipping_City__c,
             request__r.Request_Shipping_State__c,
             request__r.Request_Shipping_Postal_Code__c,
             request__r.Request_Shipping_Country__c,
             request__r.Phone__c
             from request_item__c where Request__r.Id=:reqId1
My question, I have the following objects that I’m trying to query on and get the results.

Request__c ,Request_item__c have a master detail relation and Catalog_item__c has a look up to the Request_item__c.

The query below  would run just fine if I pass a request ID value in developer console.

I have a VF page that would render the output with an id again.

However when placed this in a class constructor and give it the ID from trigger.new it would fail to retrieve any rows.

Any help in this regard is appreciated.

select Name,Request__r.Name,
             Request__r.Contact__c,
            Request__r.Lead__c,
             Catalog_item__r.Name,
             Request__r.Request_Details_rtf__c,
             quantity__c,
             Catalog_item__r.cost_center__c,
             Catalog_item__r.sizeoptions__c,
             request__r.Send_to_Company__c,
             request__r.Send_to_Contact__c,
             request__r.Request_Shipping_Street__c,
             request__r.Request_Shipping_City__c,
             request__r.Request_Shipping_State__c,
             request__r.Request_Shipping_Postal_Code__c,
             request__r.Request_Shipping_Country__c,
             request__r.Phone__c
             from request_item__c where Request__r.Id=:reqId1