+ Start a Discussion

URLFor syntax for a View

I'm not sure how to properly format a URLFor statement to reference a view that I've defined. I do not wish to go to the default Tab view for my custom object. Listed below is a Javascript which is assigned to a custom button; the last line of the Javascript is a hard-wired URL to the View itself.


Any advice as to how I could do it properly with the URLFOR statement?


var url = parent.location.href; //string for the URL of the current page
var update_Request = new sforce.SObject("emandra__EOI_Request__c"); //create a new sObject for storing updated record details
update_Request.Id = '{!emandra__EOI_Request__c.Id}'; //set the Id of the selected Request record
update_Request.emandra__Status__c = "Completed"; //set the value for Status to 'Completed'
result = sforce.connection.update([update_Request]); //push the updated records back to Salesforce