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
shinerajbshinerajb 

Application tab issue

Hai,

 

I had created one App named as "DL",and I have one custom tab named as "Login",this is my landing tab,and the VF page for this tab is 

 

*****Login*****

 

<apex:page controller="Login" action="{!redirect}">
</apex:page>

****************************************

 ************controller************

******controller****

public class Login{
public PageReference redirect() {
PageReference pr;
Integer total_records;
String email_login;
email_login=UserInfo.getUserName();
Http httpProtocol ;
httpProtocol = new Http();
HttpRequest request;
request = new HttpRequest();
String endpoint ;
endpoint = 'http:///Services/validate_user_login.php?id='+email_login;
request.setEndPoint(endpoint);
request.setMethod('GET');
pr=Page.loginfailure;
HttpResponse response;
response = makeCallout(request);
JSONParser parser = JSON.createParser(response.getBody());

while (parser.nextToken() != null)
{
if ((parser.getCurrentToken() == JSONToken.FIELD_NAME) && (parser.getText() == 'total_records'))
{
parser.nextToken();
total_records=integer.valueof(parser.getText());
}
}
if( total_records>0){

return Page.welcome_login;}
else{
return Page.loginfailure;}
}

}

**********************************

 

Here I am checking that user is valid or not,if valid it should go to 

 

***********welcome_login*******

<apex:page >
<h1> Welcome</h1>

</apex:page>

***********************************

if user is invalid,then it should go to 

 

********loginfailure*****

<apex:page >

<br/>
<h1>
You do not have a valid account on <a id="theLink" name="theLink" href="https://mail.google.com/">www.gmail.co.in</a>. Please contact the folks at Decisionlink for further assistance</h1>
</apex:page>

***************************

 

In my case resulting page is displaying in the home tab of some other application and not under under my app "DL",So how can I solve this problem.

bob_buzzardbob_buzzard

You need to set the tabstyle in your visualforce page:

 

<apex:page tabstyle="Login__tab">