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
dmchengdmcheng 

Nested URLFOR functionality? (cancelURL)

Hello.  I have a Parent__c object and a Child__c object.  I have a custom list button on Child__c object and I am using URLFOR to select a record type (the "p3" parameter) and fill in a field for the Child object.

The cancelURL parameter is not working - when I click Cancel on the Child data entry screen, there is a refresh but I am returned to the Child screen instead of the Parent record screen.

Do I have the cancelURL parameter formatted correctly?  If I enclose it with curly braces and a !, then I get a syntax error when trying to save the button code.

 

Is this occurring because of save="1"?  I need this because I am selecting a record type and need to skip the record type selection screen.

{!URLFOR($Action.Child__c.New, null, [
CF00N40000001euw3=Parent__c.Name,
p3="012400000009RQP",
retUrl=URLFOR($Action.Parent__c.View, Parent__c.Id, null, true),
cancelUrl=URLFOR($Action.Parent__c.View, Parent__c.Id, null, true),
save="1"
], true)}

 

 

JeeedeeeJeeedeee

Having the same problems :( got it solved already?

dmchengdmcheng

I have not found a solution for cancelURL or retURL. 

JeeedeeeJeeedeee

Maybe I have a solution for you... for me I got it solved... I wrote the cancelUrl instead of cancelURL...  stupid minor types...As I read your tekst, we are basically the same. I have a object MyObject2 and it contains references to the master (Account) and the child (MyObject1). I am now filling in both lookup fields..

 

 

{!URLFOR($Action.MyObject2__c.New, null, [

CF00N20000002OxOM =    MyObject1__c.Account__c ,
CF00N20000002OxOM_lkid =   MyObject1__c.AccountId__c ,
CF00NR00000013nNi  =    MyObject1__c.Name,
CF00NR00000013nNi_lkid =   MyObject1__c.Id,
saveURL= URLFOR($Action.MyObject1__c.View,  MyObject1__c.Id, null, true),
retURL= URLFOR($Action.MyObject1__c.View,  MyObject1__c.Id, null, true),
cancelURL=URLFOR($Action.MyObject1__c.View,  MyObject1__c.Id, null, true)
   ], false)}

 

 

dmchengdmcheng

Thanks for your reply.  It doesn't work for me.  I have record types on the child object and so I have to use save="1" to skip the record type selection screen, and I think that is affecting the cancelURL.

GuyClairboisGuyClairbois

thanks jd.. I'd been puzzling on this for a while.. Can't believe they make stuff like this case sensitive..