• Jayakrishnan Salim
  • NEWBIE
  • 20 Points
  • Member since 2017

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 7
    Questions
  • 7
    Replies

Hi,

In my org some API is trying to log in with wrong credentials and due to this the user's access is being restricted. 

Here is the login history.
User-added image

I am not able to identify which system is pinging SF and in the connected apps section, I am not seeing any issue. Is there any way to revoke access to this IP?

Hi All, 

I am getting the below error while displaying rich text field content on a lightning page. Kindly help if you have some idea.

User-added imageIf I upload the image from Visual Force page, the image is getting displayed. The issue is in the lightning page.
In my org, I have a custom object whose Name field is an auto-number field and has another field which is a lookup to contact object. In the contact object I have a lookup relationship to this custom object. Since the name field is an auto-number field, the secondary field should be searchable in instant results as per this document (https://help.salesforce.com/articleView?id=search_lookup_config_lex.htm&type=5). In the search layout of the custom object, I have configured it as the contact field as the secondary field. 
User-added image

As you can see in the above screenshot, the secondary field in the search layout is the lookup to contact. So as per the Salesforce documentation, I should be able to search the custom object records with the contact names in instant results. But instead, I am not getting any results. Is there any other configuration I am missing? Could someone guide me please?
I would like to know why 'Lightning experience override' option is not present in Opportunity Clone button override. I could override the New as well as Edit buttons. But in the case of Clone button, I can see only the 'Salesforce classic override option'. Can anyone throw some light on this? I have implemented lightning:actionOverride in my aura component.

Attaching the screenshot.
User-added image
Hi, 

I would like to know if there is a way by which we can understand if an apex class is never called in recent times. In my org, the apex character limit has touched over 77%. I am sure that there are a lot of classes which are old and obsolete.  How can I identify them? Is there a tool for that? 
Hi, 

I would like to create a test class where I need to test the details of logged in user in SF community. What I am doing is, I take the userId of the logged in user and then fetch the contactId from user object. And with that contact Id, I fetch the account id associated with it. But when I try to assign contact id to the user object in test class, I get the below exception.
System.DmlException: Update failed. First exception on row 0 with id 0050W0000070R3kQAE; first error: UNKNOWN_EXCEPTION, You can't create a contact for this user because the org doesn't have the necessary permissions. Contact Salesforce Customer Support for help.: []

Here is my test class code.
@isTest
public class CommunityHomeControllerTest {
    
    @testSetup static void recordCreation() {
		
       	UserRole r = new UserRole(name = 'TEST ROLE');
    	insert r;
        User user = new User();
        user.ProfileID = [Select Id From Profile Where Name='System Administrator'].id;
        user.EmailEncodingKey = 'ISO-8859-1';
        user.LanguageLocaleKey = 'en_US';
        user.TimeZoneSidKey = 'America/New_York';
        user.LocaleSidKey = 'en_US';
        user.FirstName = 'first';
        user.LastName = 'last';
        user.Username = 'test@appirio1.com';   
        user.CommunityNickname = 'testUser123';
        user.Alias = 't1';
        user.Email = 'no@email.com';
        user.IsActive = true;        
        user.PortalRole = 'Manager';
        insert user;
	}
    
    static testMethod void getTotalReports(){
        Test.StartTest();
        User user = [Select id, contactId from user where Username = 'test@appirio1.com'];
        System.RunAs(user) {            
            Account a = new Account(Name='Test Account Name');
            insert a;           
            Contact c = new Contact(LastName = 'Contact Last Name');
            c.AccountId = a.Id;
        	insert c;                   
            user.ContactId = c.id;
            update user;           
            PageReference pageRef = Page.CommunityHome;
            Test.setCurrentPage(pageRef);
            CommunityHomeController controller = new CommunityHomeController();
            controller.getParentAccounts();
            Test.stopTest();
        }                
    }
}

Thank you in advance. 
Hi, 
I am using SalesforceSDK for Android in one of my apps. The issue I am facing is, I am not able to re-login as a different user after logging out. 
The code I am using for logout the current user is 
SalesforceSDKManager.getInstance().logout(this);
After that the login screen comes. But while I try to login as a different user, it throws the below error and goes back to login screen again. 
{"message":"Session expired or invalid","errorCode":"INVALID_SESSION_ID"}
If I re-login as same user, I am not getting this error. 
To successfully re-login as a new user, I have to kill the app from background and then relaunch it. 

Kindly help me on this. 
Thank you in advance. 

 
Hi All, 

I am getting the below error while displaying rich text field content on a lightning page. Kindly help if you have some idea.

User-added imageIf I upload the image from Visual Force page, the image is getting displayed. The issue is in the lightning page.
In my org, I have a custom object whose Name field is an auto-number field and has another field which is a lookup to contact object. In the contact object I have a lookup relationship to this custom object. Since the name field is an auto-number field, the secondary field should be searchable in instant results as per this document (https://help.salesforce.com/articleView?id=search_lookup_config_lex.htm&type=5). In the search layout of the custom object, I have configured it as the contact field as the secondary field. 
User-added image

As you can see in the above screenshot, the secondary field in the search layout is the lookup to contact. So as per the Salesforce documentation, I should be able to search the custom object records with the contact names in instant results. But instead, I am not getting any results. Is there any other configuration I am missing? Could someone guide me please?
I would like to know why 'Lightning experience override' option is not present in Opportunity Clone button override. I could override the New as well as Edit buttons. But in the case of Clone button, I can see only the 'Salesforce classic override option'. Can anyone throw some light on this? I have implemented lightning:actionOverride in my aura component.

Attaching the screenshot.
User-added image
  List<Lead> numberOfLeads = [select Id from Lead];
   System.debug(numberOfLeads.size());

I need number of Leads but above my code is returning 0 always, please help me. thanks in advance
Hi, 

I would like to create a test class where I need to test the details of logged in user in SF community. What I am doing is, I take the userId of the logged in user and then fetch the contactId from user object. And with that contact Id, I fetch the account id associated with it. But when I try to assign contact id to the user object in test class, I get the below exception.
System.DmlException: Update failed. First exception on row 0 with id 0050W0000070R3kQAE; first error: UNKNOWN_EXCEPTION, You can't create a contact for this user because the org doesn't have the necessary permissions. Contact Salesforce Customer Support for help.: []

Here is my test class code.
@isTest
public class CommunityHomeControllerTest {
    
    @testSetup static void recordCreation() {
		
       	UserRole r = new UserRole(name = 'TEST ROLE');
    	insert r;
        User user = new User();
        user.ProfileID = [Select Id From Profile Where Name='System Administrator'].id;
        user.EmailEncodingKey = 'ISO-8859-1';
        user.LanguageLocaleKey = 'en_US';
        user.TimeZoneSidKey = 'America/New_York';
        user.LocaleSidKey = 'en_US';
        user.FirstName = 'first';
        user.LastName = 'last';
        user.Username = 'test@appirio1.com';   
        user.CommunityNickname = 'testUser123';
        user.Alias = 't1';
        user.Email = 'no@email.com';
        user.IsActive = true;        
        user.PortalRole = 'Manager';
        insert user;
	}
    
    static testMethod void getTotalReports(){
        Test.StartTest();
        User user = [Select id, contactId from user where Username = 'test@appirio1.com'];
        System.RunAs(user) {            
            Account a = new Account(Name='Test Account Name');
            insert a;           
            Contact c = new Contact(LastName = 'Contact Last Name');
            c.AccountId = a.Id;
        	insert c;                   
            user.ContactId = c.id;
            update user;           
            PageReference pageRef = Page.CommunityHome;
            Test.setCurrentPage(pageRef);
            CommunityHomeController controller = new CommunityHomeController();
            controller.getParentAccounts();
            Test.stopTest();
        }                
    }
}

Thank you in advance. 
Hi, 
I am using SalesforceSDK for Android in one of my apps. The issue I am facing is, I am not able to re-login as a different user after logging out. 
The code I am using for logout the current user is 
SalesforceSDKManager.getInstance().logout(this);
After that the login screen comes. But while I try to login as a different user, it throws the below error and goes back to login screen again. 
{"message":"Session expired or invalid","errorCode":"INVALID_SESSION_ID"}
If I re-login as same user, I am not getting this error. 
To successfully re-login as a new user, I have to kill the app from background and then relaunch it. 

Kindly help me on this. 
Thank you in advance.