You need to sign in to do that
Don't have an account?

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.
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.
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);