0

Can someone tell me why my fields aren't being populated other than my subject field? I am trying to clone a task. I created a URL button on Task object. Here is my code:

/lightning/o/Task/new?&defaultFieldValues={!IF(NOT(ISBLANK(Task.What)),'&WhatId=' + Task.What,'')},
{!IF(NOT(ISBLANK(Task.Who)),'&WhoId=' + Task.Who,'')},Subject={!Task.Subject},
Priority={!Task.Priority}, Description={!Task.Description}, Status={!Task.Status}

1 Answer 1

2

If your task subject has a space like 'Dan Subject' that will break. You need to urlencode all the fields that are not Ids or one word values.

Example:

/lightning/o/Task/new?&defaultFieldValues=
{!IF(NOT(ISBLANK(Task.What)),'&WhatId=' + Task.What,'')},
{!IF(NOT(ISBLANK(Task.Who)),'&WhoId=' + Task.Who,'')},
Subject={!URLENCODE(Task.Subject)},
Priority={!URLENCODE(Task.Priority)}, 
Description={!URLENCODE(Task.Description)},
Status={!URLENCODE(Task.Status)}

This might be helpful: URL Hacking

1
  • 1
    Thank you Dan. It worked. I had to modify a little for the picklist values.
    – Dana
    Commented Nov 2, 2021 at 0:24

You must log in to answer this question.

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