You need to sign in to do that
Don't have an account?
InfoDeliver Inc
SOQL multiple object matching problem
Is the following case possible to be done by using SOQL.
Custom object have more than 1 feature ( like attributes),
the relationship is like below.
Custom 1 .. N feature
We want to recommend product to custom according to the feature.
Generally , 1 product related to multiple feature , like below
Product 1 .. N feature
I want to search the products for one custom, can I use one SOQL to do this search?
Custom object have more than 1 feature ( like attributes),
the relationship is like below.
Custom 1 .. N feature
We want to recommend product to custom according to the feature.
Generally , 1 product related to multiple feature , like below
Product 1 .. N feature
I want to search the products for one custom, can I use one SOQL to do this search?
I am reiterating your requirement, let me know if I understood correctly.
You wish to use a single SOQL statement to retrieve a Product that has all the features of the Custom selected.
Thanks
AR
I want to retrieve all products that fits the custom's feature.
For example, a custom select the following features,
sport, ball, out-door , in-door, team play, game , white color, orange color, cooking,
we have 3 product , every product 2 or 3 feature
table tennis racket : sport, in-door , ball
cooking game : game, cooking
golf shoes : out-door , white color, running
the first 2 products' all features fit to the custom's selection, this case, the first 2 products are selected here.
The golf shoes's running feature is not in custom's selection, so golf shoes is not selected.
Can I use one SOQL to select the products for one custom in this case?
In your case Feature object is common , you can query upon Feature object to achieve your desired result.
But first you need to understand the Relationship Queries
https://www.salesforce.com/us/developer/docs/dbcom_soql_sosl/Content/sforce_api_calls_soql_relationships.htm
I have a problem about the Query's result.
Customer__c : Name, ID
Product__c : Name, ID
Feature__c : Name , ID
CustomerFeature__c : Name, ID,customerID__c , featureID__c
ProductFeature__c : Name, ID, productID__c, featureID__c
1, SELECT ID FROM CustomerFeature__c WHERE customerID__c = 「custome ID」
2, SELECT productID__c FROM ProductFeature__c WHERE featureID__c IN [ result ID of the above SQL]
The 1st SOQL can select ID correctly , the problem is the second SOQL.
the 2nd SOQL here will select all products if there is one related feature which fits to custom's feature.
So, "golf shoes" ( refer to above example) will be selected here.
But, what I want is the select the products which all features fit to custom, so "golf shoes" should be not selected.
Is there any way to select only products which all features fit to custom?
mistake : Product 1 .. N feature
correct: Product N .. N Feature
Sorry to make you confused.