To cater such rollup requirements we need to have a master detail relationship between objects. The maximum number of master detail relationships on an object can be two. This is stored as a field in the Master side Object of the two objects in a master detail relationship.Īs has limitations on almost everything available we have limits for Roll-up Summaries as well!! We can configure a maximum of 25 Rollup Summaries. Roll-up Summary is a feature where, It gives us the options of having SUM, MIN, MAX of a field in all the child records or COUNT the number or child records. I had never seen a comma used in the code before “Stock_Code_c,Order_Header_r.Rep_Director_C” Never would have figured it out.Roll-up Summary is a feature of salesforce enabled only after having a master detail relationship between objects. SELECT Description_c, Order_Header_C, Order_Quantity_c, Stock_Code_c,Order_Header_r.Rep_Director_C FROM Order_Detail_C WHERE Stock_Code_C LIKE ‘%6195%’ I was told this couldn’t be done by someone in Success but someone in the Developer helped me out. I gave up but I posted in the Success and Developer communities. You basically have taught me everything I know! We don’t have a traditional admin at our company, as the person with access has other responsibilities, though hopefully that changes in the next year. I have never been formally trained with SalesForce (just given an id and pw) and I am not sure exactly what I can and can’t do since I am not an admin. the normal Salesforce website.” Everything about my SalesForce background is confusing! I don’t think I can see this via the normal website as I am not an admin, atleast I can’t see the page shown in the image on this page. Ha, I like your comment “I think it’s a lot more confusing if you look at the field definitions from your UI vs. Please reference your WSDL or the describe call for the appropriate names.” If you are attempting to use a custom relationship, be sure to append the ‘_r’ after the custom relationship name. ![]() “Didn’t understand relationship ‘Order_Detail_c.Order_Header_c’ in FROM part of query call. Alternatively, parent relationship queries can be run with REST Explorer under the Utilities menu without issue.” If you understand these limitations, parent relationship queries can be enabled under Settings. “Due to issues rendering query results, parent relationship queries are disabled by default. SELECT Description_c, Order_Header_C, Order_Quantity_c, Stock_Code_c, ( SELECT Rep_Director_C from Order_Detail_c.Order_Header_c ) FROM Order_Detail_C WHERE Stock_Code_C LIKE ‘6195’ SELECT Rep_Director_C, ( SELECT Description_c, Order_Quantity_c, Stock_Code_c FROM Order_Detail_C WHERE Stock_Code_C LIKE = ‘6195’ ) from Order_Header_CĮrror-“Bind variables only allowed in Apex code” SELECT Rep_Director_C, ( SELECT Description_c, Order_Quantity_c, Stock_Code_c FROM Order_Detail_C WHERE Stock_Code_C = ‘6195’ ) FROM Order_Header_r.Account_cĮrror-“First SObject of the FROM statement must be a valid SObject type.” I HAVE TRIED A FEW VARIATIONS WITH NO LUCK: I think the relationship issue is confusing or maybe a bit advanced for me.ġ Account-it says this under Child Relationships:Ģ Order_Header_c-it says this under Child Relationships:ģ Order_Detail_C-It says this under Fields I am trying to tie the Rep directors with products to see who selling more of select items. If you have time hopefully you can make sense and help me with the query or possibly this isn’t something that I can do. Hi David-I am still struggling with this. ![]() Tried using addition/subtraction with no luck, ie WHERE Order_Date_C = AND Order_Date_C <= ĪND id IN (select Order_header_c FROM Order_Detail_c WHERE Warehouse_C = '57') ***Not asking for help solving, just want to take my SOQL to the next level!***ġ Accounts that only purchase products belonging to select Product Families (or have not purchased)Ģ QTY purchased per Product for a specific Accountģ Orders shipped (invoiced) 5 days or more after the order was entered. >Possible specific examples (the first three I can’t solve) GROUP BY ROLLUP (I have used, but not exactly how I want.) ![]() Union all (Saw on a blog, but not sure how to use and when.) Sum(pid= ) (Saw on a blog, but not sure how to use and when.) Maybe you could do a post on advanced SOQL?Ĭount(id) (Saw on a blog, but not sure how to use and when.)
0 Comments
Leave a Reply.AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |