+ Start a Discussion

getting the domain origin from $Origin

i am trying to set value of custom url field to a visualforce page to for that i need domain oring prefix like ap1.salesforce.com or na1.salesforce.com .how to get that in UI it is showing some global objects $Organization,$Profile,$System,$User,$UserRole which object should be used and which field please tell

Devender MDevender M
You can try this code

var url = location.href;

$Api might prove useful (for your purposes it doesn't matter which version you use).