+ Start a Discussion
ArunaAruna 

Open task edit page by using lighting component quick action

I Hellow friends,

We have a javascript button in classic on a custom object related lisWhenWen the button is clicked it will open the task edit page by passing record type id and some other default values to URL. below is the code.
if({!Iobject.filedname}==false) 
{ 
window.alert("You must integration the some record to someother system before using this button"); 
} 
else{ 
var uri="/00T/e?recordtype=012j0000000m7fb&tsk3={! object.Name}&00N11000001sBSr={!object.RecordType}&tsk4={!Today()}&00Nj000000Alu1e={!Today()}&tsk3_lkid={!object.Id}&tsk12=Completed&00N0a00000Bzln4=ProdashInt-SFIntServices005j000000Bydz4&retURL={!object.Id}"; 

var res = encodeURI(uri); 

window.open(res,"_parent"); 
}
I am trying to convert above javascript button into lighting action. I am struggling to get the task edit page with some parameters passed to url .

I mean how do I convert below URL into lighting  working URL

var uri="/00T/e?recordtype=012j0000000m7fb&tsk3={! object.Name}&00N11000001sBSr={!object.RecordType}&tsk4={!Today()}&00Nj000000Alu1e={!Today()}&tsk3_lkid={!object.Id}&tsk12=Completed&00N0a00000Bzln4=ProdashInt-SFIntServices005j000000Bydz4&retURL={!object.Id}";
var res = encodeURI(uri);
window.open(res,"_parent");

Thanks In advance.

 
GovindarajGovindaraj
Hi Aruna,

URL hacks are not supported in Lightning Experience. The best way to prepopulate fields in Lightning Experience is to use actions with 'predefined values'
1. Setup -> Object Manager -> <Object Name> -> Buttons, Links, and Actions -> New Action.
2. Next add whatever fields you would like to have on the layout that will popup up in LEX when the action is clicked.
3. Then add each predefined field and the default values.
4. Finally add the action to the page layout.

Please let us know if this helps.

Thanks,
Govindaraj.S