Sometime we need to get current page URL in apex ,Then we need to use Apexpages.currentPage() methods provided by salesforce.
There is following step which you need to follow:
Step 1:
First call 'getHeaders()' method which return a map of the request headers,where the key string contains the name of the header, and the value string contains the value of the header.
After that get the 'Host' key value from that map.
String hostVal = ApexPages.currentPage().getHeaders().get('Host');
It gives like 'c.ap1.visual.force.com',etc.
Step 2:
Second,you need to call 'getUrl()' method which returns the relative URL associated with the PageReference,including any query string parameters and anchors.
String urlVal = Apexpages.currentPage().getUrl();
It returns as '/apex/pagename','/apex/pageName?check=false' etc.
Step 3: After that add these two values return in step1 and step2 with 'https://'
The whole method is given below:
public void getPageURL() {
String hostVal = ApexPages.currentPage().getHeaders().get('Host');
String urlVal = Apexpages.currentPage().getUrl();
String URLL = 'https://' + hostVal+ urlVal;
}
There is following step which you need to follow:
Step 1:
First call 'getHeaders()' method which return a map of the request headers,where the key string contains the name of the header, and the value string contains the value of the header.
After that get the 'Host' key value from that map.
String hostVal = ApexPages.currentPage().getHeaders().get('Host');
It gives like 'c.ap1.visual.force.com',etc.
Step 2:
Second,you need to call 'getUrl()' method which returns the relative URL associated with the PageReference,including any query string parameters and anchors.
String urlVal = Apexpages.currentPage().getUrl();
It returns as '/apex/pagename','/apex/pageName?check=false' etc.
Step 3: After that add these two values return in step1 and step2 with 'https://'
The whole method is given below:
public void getPageURL() {
String hostVal = ApexPages.currentPage().getHeaders().get('Host');
String urlVal = Apexpages.currentPage().getUrl();
String URLL = 'https://' + hostVal+ urlVal;
}
yurtdışı kargo
ReplyDeleteresimli magnet
instagram takipçi satın al
yurtdışı kargo
sms onay
dijital kartvizit
dijital kartvizit
https://nobetci-eczane.org/
MZ41
Hollanda yurtdışı kargo
ReplyDeleteİrlanda yurtdışı kargo
İspanya yurtdışı kargo
İtalya yurtdışı kargo
Letonya yurtdışı kargo
6LHY
Litvanya yurtdışı kargo
ReplyDeleteLüksemburg yurtdışı kargo
Macaristan yurtdışı kargo
Malta yurtdışı kargo
Polonya yurtdışı kargo
DYA
Portekiz yurtdışı kargo
ReplyDeleteRomanya yurtdışı kargo
Slovakya yurtdışı kargo
Slovenya yurtdışı kargo
İngiltere yurtdışı kargo
E0G
Yunanistan yurtdışı kargo
ReplyDeleteAfganistan yurtdışı kargo
Amerika Birleşik Devletleri yurtdışı kargo
Amerika Samoası yurtdışı kargo
Angola yurtdışı kargo
VN3O2
شركة تسليك مجارى بالجبيل
ReplyDeleteشركة تسليك مجارى بالخبر
شركة تسليك مجاري بالاحساء
تسليك مجاري بالهفوف wW9MdWzAaT
ReplyDelete