+ Start a Discussion
sagar077sagar077 

Create a button on Quote 'Populate Root Id', must work for Classic and Lightning both Create a field on QuoteLine "Root Id" Lookup (QuoteLine) On click of this Button we need to populate the Parent bundle Id (Parent Quote Line Item) on every child Lines

Create a button on Quote 'Populate Root Id', must work for Classic and Lightning both
Create a field on QuoteLine "Root Id" Lookup (QuoteLine)
On click of this Button we need to populate the Parent bundle Id (Parent Quote Line Item) on every child Lines
Input to your Class will be QuoteId from Quote Detail page.
NOTE: You need to identify fields at QuoteLine level where you can have immediate Parent QuoteLine Id and Bundle Product
 
For Example :
Quote Q-00001 :
QuoteLines:
QL-00001 (Product A)
QL-00002 (Product B)
QL-00003 (Product C)
QL-00004 (Product D)
QL-00005 (Product E)
QL-00006 (Product F)
QL-00007 (Product G)
QL-00008 (Product H)
QL-00009 (Product I)
QL-00010 (Product H)
QL-00011 (Product J)
QL-00012 (Product K)
QL-00012 (Product L)
QL-00013 (Product M)
QL-00014 (Product N)
QL-00015 (Product O)
QL-00016 (Product P)
QL-00016 (Product Q)
QL-00001 (Product C)
Output: Highlighted in Green
Quote Q-00001 :
QuoteLines:
QL-00001 (Product A) [ROOT_ID : Null]
QL-00002 (Product B) [ROOT_ID : QL-00001]
QL-00003 (Product C) [ROOT_ID : QL-00001]
QL-00004 (Product D) [ROOT_ID : QL-00001]
QL-00005 (Product E) [ROOT_ID : QL-00001]
QL-00006 (Product F) [ROOT_ID : QL-00001]
QL-00007 (Product G) [ROOT_ID : QL-00001]
QL-00008 (Product H) [ROOT_ID : QL-00001]
QL-00009 (Product I) [ROOT_ID : QL-00001]
QL-00010 (Product H) [ROOT_ID : QL-00001]
QL-00011 (Product J) [ROOT_ID : QL-00001]
QL-00012 (Product K) [ROOT_ID : QL-00001]
QL-00012 (Product L) [ROOT_ID : QL-00001]
QL-00013 (Product M) [ROOT_ID : NULL]
QL-00014 (Product N) [ROOT_ID : QL-00013]
QL-00015 (Product O) [ROOT_ID : QL-00013]
QL-00016 (Product P) [ROOT_ID : QL-00013]
QL-00016 (Product Q) [ROOT_ID : QL-00013]
QL-00001 (Product C) [ROOT_ID : QL-NULL]

Please help me i am new apex code
Thank You
AbhishekAbhishek (Salesforce Developers) 
Hi Sagar,

Please feel to reach out to the accelerator team who can give you the idea of how you can implement according to your business requirement if you have the premier success plan.

Please find the details on how to request for an accelerator:https://help.salesforce.com/articleView?id=000337601&type=1&mode=1

Otherwise, I would request you to reach out to your Account Executive If you wish to upgrade to Premier Support please contact your Account Executive.

Thanks!