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
KPJSKPJS 

Need a clone button for Quote and Quote Line Items for Lightning

We created a custom clone button for Quote to clone the quote and quote line items, but it doesn't work in Lightning. 

Code for the button at present:
/{!Quote.Id}/e?clone=1&oppid={!Quote.Opportunity_ID__c}*

*It kept saying that OpportunityId didn't exist, so we created a custom ID field, which worked fine in Classic. 

I am not an Apex coder, so wondered if anyone has had luck creating a URL Hack to clone Quote and Quote Line Items in Lightning.

Right now, when we try to clone in Lightning, we get the error "Required fields are missing: [OpportunityId]" so something else is going on. I want to believe that this is a simple fix, but I don't know. I would be forever grateful if someone could help. 

Thanks!

User-added image

VinayVinay (Salesforce Developers) 
Hi,

Below is the syntax for lightning URL hack.
/lightning/o/Account/new?defaultFieldValues=
    Name={!URLENCODE(Account.Name)},
    OwnerId={!Account.OwnerId},
    AccountNumber={!Account.AccountNumber},
    NumberOfEmployees=35000,
    CustomCheckbox__c={!IF(Account.SomeCheckbox__c, true, false)}
https://www.salesforceben.com/salesforce-url-hacking-for-lightning-tutorial/

Thanks,
Vinay Kumar