• SFRaj
  • NEWBIE
  • 75 Points
  • Member since 2012

  • Chatter
    Feed
  • 3
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 15
    Replies
Hello,

I m using APEX Class for Check my login form inputs..

Basically I m passing my Username, Password via function from aspnet page. In apex class following coding i m using... when after process this coding ( Username password is match retuen true, or false).. but I got a error when save this Apex Class...

How do I perform my login Username and Password is correct ? If Correct/wrong how do i return the value to asp.net page????

APEX Code
global class getLoginCheck{
 
  WebService static Lead getLoginCheckFromusername(string username,string password) {
 
   Contact r=[SELECT Count() from Contact WHERE Firstname = :username];
  Integer result = 0;
  if(r=0)
  {
  result = 0;
  }
    return result ;
    
  }
}

 



aspx.cs
getLoginInfo.Lead getLoginInfoFromUsername = getLoginInfoObj.getLoginCheckFromusername(txtUsername.text,txtPassword.text);
// Dropdown list name is ddlUsername

 



/**** How do I get return value from return fucnction from Apex Code and how to bind the all the retrn data's to dropdown list ****/
  • May 10, 2012
  • Like
  • 0

Hello,

 

Im new to APEX and could use a nudge here. Im trying to update a custom field with the Opportunity object and am getting the following error below. 

 

Visual Force Error: System.NullPointerException: Attempt to de-reference a null object 

 


Code

 

public with sharing class myTestClass{
	
	public MyCustomBuildObject__c build {get;set;}
	public String myWSXMLResult {get;set;}  
	public String getWSXMLResult() {
		

		build = ip_shared_updateMethods.getBuild('a1DV00000000jK4MAI');
		if(build.Opportunity__r.LiveLink_URL__c == null && build.Product_Group__r.Engineering_Engagement__c == 'Required')
		{
			String tmpFolderName = build.Opportunity__r.Account.Name + ' - ' + build.Opportunity__r.Custom_Contract_Number__c;
			String wordCharPattern = '[^_A-Za-z0-9-\\s]';
			String LLWSResultPattern = '[0-9]{2,}';
			Pattern compiledWordCharPattern = pattern.compile(wordCharPattern);
			Matcher wordCharMatcher = compiledWordCharPattern.matcher(tmpFolderName);
			tmpFolderName = wordCharMatcher.replaceAll('');
			tmpFolderName = tmpFolderName.replaceAll('  ',' ');
			
			DSPA__c dsp = DSPA__c.getInstance();
			String tmpObjectID = dsp.DSPID__c;
			
			String myWSXMLResult = another_class.invokeWs(tmpFolderName,tmpObjectID);
			
			Boolean LLWSPatternMatched = pattern.matches(LLWSResultPattern,myWSXMLResult);
			
			if(LLWSPatternMatched)
			{
				/******Error occurs on line below******/
				build.Opportunity__r.LLURL__c = 'https://internalService/' + myWSXMLResult;
				update build;
			} 
			
		} 
		return myWSXMLResult;
	}
}

 

This is where the error is pointing to..

 

/******Error occurs on line below******/
build.Opportunity__r.LLURL__c = 'https://internalService/' + myWSXMLResult;

Im sure this is an easy one, thanks ahead of time for the advice.

  • May 07, 2012
  • Like
  • 0

Hi,

 

I want to open a Image when a link is clicked

<ol>

<li>Some text.......... Display Image<li>

<ol>

 I am not sure how to use target attribute in anchor tag.

Display Image should be a link onclick of which i want to display a image.

 

Can you guys provide some input

 

Regards,

 

kumar

 

  • March 05, 2012
  • Like
  • 0

Hi All,

 

What is the validity time of sessionId?

  • May 07, 2012
  • Like
  • 0

Hi,

 

I am developing a visualforce page to show standard page in an iframe. On that iFrame am using standard page as source. I dont want relatedlisthover links on that iframe. But I want relatedlist details.

  • March 05, 2012
  • Like
  • 0

I have a formula field where I create a link using HYPERLINK. I want one of the parameters in the url to be encoded. So I tried to use URLENCODE. But I get an error that URLENCODE is not allowed in a formula field.

 

My formula (field type is Formula (Text)):

 

HYPERLINK('http://foo.com?bar=' + URLENCODE(Bar__c))

 

Error:

 

Function URLENCODE may not be used in this type of formula (Related field: Formula)

 

It seems like a perfect fit to use URLENCODE to encode parameters for use in HYPERLINK. Am I missing something?

 

I can use SUBSTITUTE and do the encoding myself, but I am trying to see if there is a better way.

 

Thanks,

VV

  • July 05, 2013
  • Like
  • 0
Hello,

I m using APEX Class for Check my login form inputs..

Basically I m passing my Username, Password via function from aspnet page. In apex class following coding i m using... when after process this coding ( Username password is match retuen true, or false).. but I got a error when save this Apex Class...

How do I perform my login Username and Password is correct ? If Correct/wrong how do i return the value to asp.net page????

APEX Code
global class getLoginCheck{
 
  WebService static Lead getLoginCheckFromusername(string username,string password) {
 
   Contact r=[SELECT Count() from Contact WHERE Firstname = :username];
  Integer result = 0;
  if(r=0)
  {
  result = 0;
  }
    return result ;
    
  }
}

 



aspx.cs
getLoginInfo.Lead getLoginInfoFromUsername = getLoginInfoObj.getLoginCheckFromusername(txtUsername.text,txtPassword.text);
// Dropdown list name is ddlUsername

 



/**** How do I get return value from return fucnction from Apex Code and how to bind the all the retrn data's to dropdown list ****/
  • May 10, 2012
  • Like
  • 0

Hello,

 

Im new to APEX and could use a nudge here. Im trying to update a custom field with the Opportunity object and am getting the following error below. 

 

Visual Force Error: System.NullPointerException: Attempt to de-reference a null object 

 


Code

 

public with sharing class myTestClass{
	
	public MyCustomBuildObject__c build {get;set;}
	public String myWSXMLResult {get;set;}  
	public String getWSXMLResult() {
		

		build = ip_shared_updateMethods.getBuild('a1DV00000000jK4MAI');
		if(build.Opportunity__r.LiveLink_URL__c == null && build.Product_Group__r.Engineering_Engagement__c == 'Required')
		{
			String tmpFolderName = build.Opportunity__r.Account.Name + ' - ' + build.Opportunity__r.Custom_Contract_Number__c;
			String wordCharPattern = '[^_A-Za-z0-9-\\s]';
			String LLWSResultPattern = '[0-9]{2,}';
			Pattern compiledWordCharPattern = pattern.compile(wordCharPattern);
			Matcher wordCharMatcher = compiledWordCharPattern.matcher(tmpFolderName);
			tmpFolderName = wordCharMatcher.replaceAll('');
			tmpFolderName = tmpFolderName.replaceAll('  ',' ');
			
			DSPA__c dsp = DSPA__c.getInstance();
			String tmpObjectID = dsp.DSPID__c;
			
			String myWSXMLResult = another_class.invokeWs(tmpFolderName,tmpObjectID);
			
			Boolean LLWSPatternMatched = pattern.matches(LLWSResultPattern,myWSXMLResult);
			
			if(LLWSPatternMatched)
			{
				/******Error occurs on line below******/
				build.Opportunity__r.LLURL__c = 'https://internalService/' + myWSXMLResult;
				update build;
			} 
			
		} 
		return myWSXMLResult;
	}
}

 

This is where the error is pointing to..

 

/******Error occurs on line below******/
build.Opportunity__r.LLURL__c = 'https://internalService/' + myWSXMLResult;

Im sure this is an easy one, thanks ahead of time for the advice.

  • May 07, 2012
  • Like
  • 0

Hi All,

 

What is the validity time of sessionId?

  • May 07, 2012
  • Like
  • 0
Hi,
In my applicaton i using Contace tab.. I want select all the Firstname only from here. and also to bind the all the Firstname in asp.net page dropdown list.. When I m trying this task i got error like  "System.QueryException: List has more than 1 row for assignment to SObject"
Can You please solve the problem?

My Apex Class Code : 

global class getUserName{
 
  WebService static Lead getLeadUserName() {
    Lead c = [SELECT FirstName FROM Lead ];
      Lead l= new Lead(FirstName =c.FirstName);
   return l; 
 
  }
}

 



My aspx Code Behind:

 getUserName.getUserNameService getUserNameObj = new getUserName.getUserNameService();
            getUserNameObj.SessionHeaderValue = new getUserName.SessionHeader();
            getUserNameObj.SessionHeaderValue.sessionId = sessionId;
 
            getUserName.Lead getUserNameResponse = getUserNameObj.getLeadUserName();
 
            ddlUserName.Items.Add(getUserNameResponse.FirstName);

 

  • May 07, 2012
  • Like
  • 0

i have below code

<tr style="display:{!if(!cx.Include_in_Confirmation__c == true, 'none', 'block') } ">
</tr>
but its not work as none is not implemented as i changed to table-column its work but not in IE .

please help me the better solution why none is not applied thr?

thanks

Our org currently has "public read" permissions on our org wide defaults. We cannot make this private.

I am creating a customer portal with custom visual force pages...where I display data using SOQL queries.

 

Is it a good idea to add a clause on the SOQL query to return only those records where the account id matches the logged in user's acount id?

 

And if yes..how can I get the currently logged in user's acount id?

 

Thanks.

Hi

I have cancel and ignore button when i click cancel the popup will close , when ignore clicked it should pass a flag value.

 

But when i click cancel also the flag value is passing.

 

<apex:commandButton value="Ignore" action="{!checkDupes}" oncomplete="YAHOO.force.com.hideMe();"/>
              <apex:param value="true" name="flag" assignTo="{!showDupes}"/>
          <apex:commandButton value="Cancel" immediate="true" onclick="YAHOO.force.com.hideMe();"/>

 

How it is possible to pass flag value only when ignore is clicked.

Hello,

 

I want to use the Customer Portal to allow my customers to get in touch with each other.  To do this, ideally, they log into the customer portal, and their user information is visible via list views to other customer portal users, and vice versa.  What this would essentially be is a directory of Customer Portal users that could be looked at using standard list views.

 

I've been doing some testing, and it seems as if Contacts are not available to be seen by other Contacts.  Since all my member information is at the Contact level, what the best way to approach this problem?

 

I'm guessing that I'm going to have to set up a custome object called "Portal Profile" or something liket that, which copies certain information off of the Contact record and stores it in the custom object, which I would then share in the portal.

 

Open to thoughts and feedback on this approach.

Hi,

 

Below is my trigger and Test Class

 

Red Colur line i am not covering in test class means if conditon is not checking in trigger test class

Trigger:
trigger Recruitervalidation on Recruiter__C (before Update) {  
    for (Recruiter__c a : Trigger.new) {
        system.debug('a.Status__c '+a.Status__c);
        system.debug('a.jobname__C '+a.jobname);
        
        if ((a.Status__c == 'waiting')&&(a.jobname__c==null)) {
                
            a.addError('Please fill the "Jobname" for the Job');
        }
       else if ((a.Status__c == 'Pending')&&(a.Jobdesc==null)) {
                
            a.addError(‘Some Error Message');
        }                                                         
    }
}

Test Class:

@istest

private class Recruitervalidation_test{

public static testmethod void Recruitervalidation_test()

{

Recruiter__c rc = new Recruiter_c();

rc.status__c='waiting';

rc.jobname__c='';

rc.joblocation__C='INDIA';

rc.jobtype__C='Technical';

insert rc;

rc.status__C='pending';

rc.jobdesc__C='';

rc.joblocation__C='INDIA';


update rc;

}}

 

Thanks

  • April 25, 2012
  • Like
  • 0

Hi,

 

I am developing a visualforce page to show standard page in an iframe. On that iFrame am using standard page as source. I dont want relatedlisthover links on that iframe. But I want relatedlist details.

  • March 05, 2012
  • Like
  • 0

Hi,

 

I want to open a Image when a link is clicked

<ol>

<li>Some text.......... Display Image<li>

<ol>

 I am not sure how to use target attribute in anchor tag.

Display Image should be a link onclick of which i want to display a image.

 

Can you guys provide some input

 

Regards,

 

kumar

 

  • March 05, 2012
  • Like
  • 0