function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
SFDC@ErrorSFDC@Error 

How to copy parent+child on another object

Hi All

I have created 5 custom object(Quote,QuoteLineItem,QuoteProductLineItem,Product,ProductLineItem) and created relationship.I have created a custom button in quote  which will add prodcut with select option in quoteLineItem and its working fine .Prodcut have child object ProductLineItem.Need to fecth child record of product in QuoteProductLine Item which is child of QuoteLineItem when I click add button to click.

 
Bhaswanthnaga vivek vutukuriBhaswanthnaga vivek vutukuri

write apex class to fetch the record and do logic and call that method from button|

{!REQUIRESCRIPT("/soap/ajax/28.0/connection.js")}
{!REQUIRESCRIPT("/soap/ajax/28.0/apex.js")} 
{!REQUIRESCRIPT("/support/console/28.0/integration.js")} 

var productId = "{!Product.Id}";
var result = sforce.apex.execute(
"ProductSampleClass", //class name 
"getchildlineitem", //method name 
{pId: productId}); //method parameter
window.location.reload(true);

SFDC@ErrorSFDC@Error
Hay I am using lighting so custom button will not work
Bhaswanthnaga vivek vutukuriBhaswanthnaga vivek vutukuri
Use quick action bro