Hello,
I have a need to query the DB for all products sold to a client then get the total. This then needs to be displayed in a field.
I am using SugarCRM CE 6.5.13
I would greatly appreciate any assistance.
Thanks.
Hello,
I have a need to query the DB for all products sold to a client then get the total. This then needs to be displayed in a field.
I am using SugarCRM CE 6.5.13
I would greatly appreciate any assistance.
Thanks.
Hi
you can query by client id with product_client relation table then it will give all product record ids.
then make a loop for count of total from product modules.
Hi
you can query by client id with product_client relation table then it will give all product record ids.
then make a loop for count of total from product modules.
Thank you for your reply. I am fairly new to SugarCRM CE and forgive me a follow up question. How do you do this. I have tried many times and I am not getting it. Could you show me a mock up of code. Thank you for your help.
Hey Dan A,
Instead of using logic stated by Mehul, you can use mysql "count" function to count the number of product sold. Let me know if this helps you or not.