Discussions
- General Development
- Schema Development
- Apex Code Development
- Visualforce Development
- Formulas & Validation Rules
- Security
- Mobile
- Force.com Sites & Site.com
- Chatter Development
- Java Development
- .NET Development
- Perl, PHP, Python & Ruby
- Desktop Integration
- APIs and Integrations
- Visual Workflow
- Apple, Mac and OS X
- VB and Office Development
- AppExchange Directory & Packaging
- Salesforce Labs & Open Source Projects
- Other Salesforce Applications
- Jobs Board
- Force.com Discussion Boards
- :
- Developer Boards for Force.com and Database.com
- :
- Java Development
- :
- How to write a select query using two tables and ...
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic to the Top
- Bookmark
- Subscribe
- Printer Friendly Page
How to write a select query using two tables and compare two id's?
[ Edited ]- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
09-20-2012 11:36 PM - edited 09-20-2012 11:44 PM
Hi All,
I am working on salesforce to java integration through webservices
How to write a select query using two tables like QuoteLineItem and PricebookEntry and compare id's and get the product2id . this query how to write ?
i write a query like this
QueryResult q = binding.query("select id,(select id,product2id from PricebookEntry)from QuoteLineItem");
i am getting errors
AxisFault
faultCode: {urn:fault.enterprise.soap.sforce.com}INVALID_TYPE
faultSubcode:
faultString: INVALID_TYPE:
id,(select id,product2id from PricebookEntry)from QuoteLineItem
^
ERROR at Row:1:Column:38
Didn't understand relationship 'PricebookEntry' in FROM part of query call. If you are attempting to use a custom relationship, be sure to append the '__r' after the custom relationship name. Please reference your WSDL or the describe call for the appropriate names.
faultActor:
faultNode:
faultDetail:
{urn:fault.enterprise.soap.sforce.com}InvalidSObje
id,(select id,product2id from PricebookEntry)from QuoteLineItem
^
plz help..
Re: How to write a select query using two tables and compare two id's?
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
10-03-2012 04:19 PM
Use as following....
select id,PricebookEntry.product2id from QuoteLineItem
Re: How to write a select query using two tables and compare two id's?
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
10-03-2012 10:34 PM
Hi Varun,
ok ,I need to compare both object id's PricebookEntry object id and QuoteLineItem object PricebookEntryId
like this PricebookEntry.id = QuoteLineItem.PricebookEntryId if both id's same get the product2Id
How to write single sql query?
plz need help...
Re: How to write a select query using two tables and compare two id's?
[ Edited ]- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
10-06-2012 12:35 AM - edited 10-06-2012 12:44 AM
Hi Devi,
To accomplish this u need to write the query using INNERJOIN. Try the following:
SELECT PricebookEntry.id,PricebookEntry.product2id FROM QuoteLineItem INNER JOIN PricebookEntry ON QuoteLineItem.Id=PricebookEntry.Id
I hope this will helpful for you.
www.trinay.com
570-575-0475

