• grotibo
  • NEWBIE
  • 25 Points
  • Member since 2011

  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 5
    Replies

Hello,

 

I have some problems in a testMethod when using 2 runAs(a User) with a User field modification between them.

 

Simplified example:

 

User u = new User(alias = 'test', email='testUser_1@test.com',
            emailencodingkey='UTF-8', lastname='Testing', languagelocalekey='fr',
            localesidkey='fr_FR_EURO', profileid = 'xxxx',
            timezonesidkey='Europe/Paris', UserName='testUser_1@test.com');

System.runAs(u){
	System.assertEquals(Userinfo.getUserName(),'testUser_1@test.com');		//No problem here
}

u.UserName='testUser_2@test.com';		//I change the username

System.runAs(u){
	System.assertEquals(u.UserName,'testUser_2@test.com');				//No problem
	System.assertEquals(Userinfo.getUserName(),'testUser_2@test.com');		//Problem: Expected: testUser_1@test.com, Actual: testUser_2@test.com
}

 

And I have no problem if I omit the first runAs:

User u = new User(alias = 'test', email='testUser_1@test.com',
            emailencodingkey='UTF-8', lastname='Testing', languagelocalekey='fr',
            localesidkey='fr_FR_EURO', profileid = 'xxxx',
            timezonesidkey='Europe/Paris', UserName='testUser_1@test.com');


u.UserName='testUser_2@test.com';		//I change the username

System.runAs(u){
	System.assertEquals(u.UserName,'testUser_2@test.com');				//No problem
	System.assertEquals(Userinfo.getUserName(),'testUser_2@test.com');		//No problem
}

 

Is that a bug from Apex?

Does someone has a solution to fix this problem? (other than creating another User object between the 2 runAs)

 

Thanks

 

 

Hi,

 

Does anybody know in which table are stored the users requests to join private groups in Chatter?

 

I have seen the "CollaborationGroup", "CollaborationGroupMember" and "CollaborationInvitation" tables but no way to find something like "CollaborationGroupMemberRequest".

 

Thanks.

 

hi all,

 

i have a custom object. while creating each and every new fields in that object, i have added some lines in the Help Text (to get displayed in the UI, detail page and in edit page as well). while creating or editing or viewing the details page, the question mark (?) near every field describes about it. (i.e,.) working as it is.

 

now, i have created a visualforce page and i have overridden the new record creation page and edit page of that object. In that VF page, i have referred the fields from the custom object only (using inputField component). My problem is, i am not getting that help text (?) in my VF page, while creating a new one and editing the existing one too. how to bring the help text (?) near every field in my VF page... please help me.. 

 

 

thanks, 

abivenkat,

SFDC Learner

Hello,

 

I have some problems in a testMethod when using 2 runAs(a User) with a User field modification between them.

 

Simplified example:

 

User u = new User(alias = 'test', email='testUser_1@test.com',
            emailencodingkey='UTF-8', lastname='Testing', languagelocalekey='fr',
            localesidkey='fr_FR_EURO', profileid = 'xxxx',
            timezonesidkey='Europe/Paris', UserName='testUser_1@test.com');

System.runAs(u){
	System.assertEquals(Userinfo.getUserName(),'testUser_1@test.com');		//No problem here
}

u.UserName='testUser_2@test.com';		//I change the username

System.runAs(u){
	System.assertEquals(u.UserName,'testUser_2@test.com');				//No problem
	System.assertEquals(Userinfo.getUserName(),'testUser_2@test.com');		//Problem: Expected: testUser_1@test.com, Actual: testUser_2@test.com
}

 

And I have no problem if I omit the first runAs:

User u = new User(alias = 'test', email='testUser_1@test.com',
            emailencodingkey='UTF-8', lastname='Testing', languagelocalekey='fr',
            localesidkey='fr_FR_EURO', profileid = 'xxxx',
            timezonesidkey='Europe/Paris', UserName='testUser_1@test.com');


u.UserName='testUser_2@test.com';		//I change the username

System.runAs(u){
	System.assertEquals(u.UserName,'testUser_2@test.com');				//No problem
	System.assertEquals(Userinfo.getUserName(),'testUser_2@test.com');		//No problem
}

 

Is that a bug from Apex?

Does someone has a solution to fix this problem? (other than creating another User object between the 2 runAs)

 

Thanks

 

 

Hi,

 

Does anybody know in which table are stored the users requests to join private groups in Chatter?

 

I have seen the "CollaborationGroup", "CollaborationGroupMember" and "CollaborationInvitation" tables but no way to find something like "CollaborationGroupMemberRequest".

 

Thanks.

Hi,

 

My Approval fields are not populating on the Email Template.

What could be the reason?

 

I have created an email aklert for record rejection. I want to display the comments entered by the Approver in Email template. I have used the Approval merge field {!ApprovalRequest.Comments}  to display the comments..

 

But the comments are blank.

 

Please help me.. to retrieve the approval fields in Email template.

 

 

Regards,

Shravan

I have an email going to the record owner when their record is rejected as part of the Approval process. Is there a way to include the reasons for rejection in the email template.

 

I tried using {!ApprovalRequest.Comments} but it did not work.