• kumar7
  • NEWBIE
  • 0 Points
  • Member since 2012

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 4
    Questions
  • 3
    Replies
Hi All,

When i am deploying a class and test class i am getiing this error

line 1:0 no viable alternative at character ''

I have removed all sapecial characters and i added.... after also i am getting same error.

Thanks
Kumar
  • August 10, 2017
  • Like
  • 0
Hi All,

For this peace of apex class code i have written

 newPortalUser.UserName = newPortalUser.Email + '.portal';
                        string acctnum=[select accountnumber from account where id =:currentUser.Contact.Accountid].accountnumber;
                        if(acctnum == null){
                        newPortalUser.CommunityNickname = currentUser.Contact.AccountID +'_' + newPortalUser.FirstName + newPortalUser.LastName;
                        }else {
                        newPortalUser.CommunityNickname = acctnum +'_' + newPortalUser.FirstName + newPortalUser.LastName;
                        }  

For this i have written test class
========================
 Account acc = new Account (AccountNumber = '123', Name = 'Testing');
             insert acc;

But i am getting error while execution of test class
Error:-
System.QueryException: List has no rows for assignment to SObject

Thanks in adv
Hi all,

Through Test class is it possible to update the record?
if possible please send me a peace of code.

Thanks
kumar
  • March 04, 2015
  • Like
  • 0

Hi All

 

my requirement is i have visual force page in that page i created the cusom buttons like Account, Contact etc

 

 

Functionlaity :  if i click on Account button it needs to redirect to Account home page

 

 

can any one help on this

 

Thanks

in advance

 

 

sampath

  • January 08, 2013
  • Like
  • 0
Hi All,

When i am deploying a class and test class i am getiing this error

line 1:0 no viable alternative at character ''

I have removed all sapecial characters and i added.... after also i am getting same error.

Thanks
Kumar
  • August 10, 2017
  • Like
  • 0
Hi All,

For this peace of apex class code i have written

 newPortalUser.UserName = newPortalUser.Email + '.portal';
                        string acctnum=[select accountnumber from account where id =:currentUser.Contact.Accountid].accountnumber;
                        if(acctnum == null){
                        newPortalUser.CommunityNickname = currentUser.Contact.AccountID +'_' + newPortalUser.FirstName + newPortalUser.LastName;
                        }else {
                        newPortalUser.CommunityNickname = acctnum +'_' + newPortalUser.FirstName + newPortalUser.LastName;
                        }  

For this i have written test class
========================
 Account acc = new Account (AccountNumber = '123', Name = 'Testing');
             insert acc;

But i am getting error while execution of test class
Error:-
System.QueryException: List has no rows for assignment to SObject

Thanks in adv

Hi All

 

my requirement is i have visual force page in that page i created the cusom buttons like Account, Contact etc

 

 

Functionlaity :  if i click on Account button it needs to redirect to Account home page

 

 

can any one help on this

 

Thanks

in advance

 

 

sampath

  • January 08, 2013
  • Like
  • 0