0

I am unable to create a list button in Task to be added on custom obj related list to create a task with some values from custom obj that would work for lightning.

This is how it is already working for classic

/00T/e?who_id={!myCustomObj.ContactId__c}&tsk1={!myCustomObj.myCustomField}}&tsk1_lkid={!myCustomObj.myCustomField}&what_id={!myCustomObj.Id}&tsk10=Quotation&tsk5=Issue%20quotation&tsk6={!"Comment "&myCustomObj.Name&": "&myCustomObj.Link}%0A{!"Contact : "&myCustomObj.Contact__c&" https://test.salesforce.com/"& myCustomObj.ContactId__c}&email=1&retURL=/{!myCustomObj.Id}

I have tried using /lightning/e/Task/new?defaultFieldValues= in different ways but found no luck.

Can I update existing button for both lightning and classic?

1 Answer 1

1

The issue is with your URL, to create a new task you should use:-

  • /lightning/o/Task/new

enter image description here

whereas you were using:-

  • /lightning/e/Task/new

to prepopulate other field values, you can refer this article on lightning URL hacks

A sample example from this blog is:-

/lightning/o/Contact/new?defaultFieldValues=
OwnerId={!Account.OwnerId}, AccountId={!Account.Id},
MailingStreet={!Account.ShippingStreet},
MailingCity={!Account.ShippingCity},
MailingState={!Account.ShippingState},
MailingPostalCode={!Account.ShippingPostalCode},
MailingCountry={!Account.ShippingCountry},
LeadSource=Custom+Contact+Button

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .