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
TamilTamil 

How to add an URL value in formula.

I have a custom hyperlink field in an object. It opens a visualforce page from a list view. I want to be able to pass the list view Id in that link to return back to the list view on clicking cancel. Is it possible to pass the list view id in the hyperlink field? Or is this possible some other way?
Hargobind_SinghHargobind_Singh
Hi, out of box, doesn't seem like that is possible, as your object field can only refer to constants and field values on the record, the page and URL isn't accessible to the record. 

If you really want this to happen, then you might want to think about exploring custom interface altogether to refer to view ID in the URL.

You should also explore custom buttons on list-view and see if retURL automatically gets passed by Salesforce to your redirection page. 

 
TamilTamil
Is it possible to build a Custom URL
doravmondoravmon
If I'm understanding correct, you want to click cancel button, then go backward.
Say before click, your url is : www,****.salesforce.com/listviewId/123456, after click cancel, it should goes to www.****.salesforce.com/listviewId
so you can have a method in the controller:
public.......()
{  string Id=ApexPages.currentPage().getParameters().get('aid');   //this is the listviewId in the url before
   string web=URL.getSalesforceBaseUrl().toExternalForm();
return new PageReference(web+'/Id').setRedirect(true);
}

then call the method in the button's action in apex page ~

Please provide some details if you still unclear~
Hope this helps
 
AshlekhAshlekh
As my understanding you are trying to create a field (Formula) and want to show on List view records. So in each record or row this field populated.And when when ever user click on that field value , user will be redirect to another page. And you want user will come back on same screen if user click on Cancel button which is available on rediect page.


So according to formula field you can't write your javascript but you can hard code the value of Listview. And pass the value a param to next page and on next page you have to get the value when user click on Cancel button.

-Thanks
Ashlekh Gera