Fetch products whose subscription type doesn't exists - Answers - Salesforce Trailblazer Community
Trailblazer Community
Ask Search:
Vishal DubeyVishal Dubey 

Fetch products whose subscription type doesn't exists

For Every Product there are 3 records with the Same Product name but different Product Type(SAAS, Subscription, Perpectual)

For Example: For a product named Product A  there exists 3 records:
   Product Name   Product Type
1. Product A           SAAS
2. Product A           Subscription
3. Product A           Perpectual 

Now there are some Products whose Product Type= Subscription doesn't exist.
How to get list of those Products.  

Best Answer chosen by Vishal Dubey
Parik DhodyParik Dhody
you can create a report of Products and group rows by Products and Columns by Product Types. This will give you for each product a 0 or 1 for each product type and then scanning through the list you will easily be able to see which prodcuts have a 0 in Product Type = Subscription column.

All Answers

Parik DhodyParik Dhody
you can create a report of Products and group rows by Products and Columns by Product Types. This will give you for each product a 0 or 1 for each product type and then scanning through the list you will easily be able to see which prodcuts have a 0 in Product Type = Subscription column.
This was selected as the best answer
Vishal DubeyVishal Dubey

@Parik I need to use Matrix Report for this .. right??

Can you suggest me some reference link with the above scenario that will be helpful.

Also can we fetch the records thru SOQL??

Yashad TayalYashad Tayal
SELECT Type, name, COUNT(Id) From Product2 GROUP BY ROLLUP (type, Name)
Vishal DubeyVishal Dubey
@Yashad .. I tried using the mentioned query it is showing below error:
[object Object]: Aggregate query does not support queryMore(), use LIMIT to restrict the results to a single batch
Yashad TayalYashad Tayal
Try to add conditions to your query to limit the result like  Where type !='Subscription'