• SFDC_coder
  • NEWBIE
  • 0 Points
  • Member since 2016

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 1
    Replies
Why salesforce does not show Recently Viewed List filter for Custom objects in Salesforce classic?  
Is there anyway we can create list filter for Recently View records. I cannot find LastViewedDate while creating new View.
Please suggest on this.
I am getting Stored XSS error while security scan in the Javascript variable in my VF page.
Below is the code:
VF Page:
<apex:page showHeader="false" sidebar="false" standardController="Opportunity" extensions="MyExtension">
    <script>
        var Boolean= "{!Flag}"; //Stored XSS error
        var prodURL;  
        prodURL= '{!URL}'; //Stored XSS error
     </script>

Controller:
public class myExtension{
    public Boolean Flag {
        get;
        private set;
    }
    public PageReference URL {
        get {
          if(URL == null )
            URL = Page.myVFpage;
            return URL;
        }
        private set;
    }  
}

I tried using JSENCODE. But its not accepting because it is a boolean variable and URL. Please provide solution for this. 
Code snippet: 
        static testMethod void testOptyTrigger2() {
        
            List<Id> newWorkItemIds;
            User u = [select id, Firstname, Alias, Email, Username, LastName, CommunityNickname, TimeZoneSidKey, 
                      LocaleSidKey, EmailEncodingKey, LanguageLocaleKey from User where Username='User1@marvell.com'];
            User u2 = [select id, Firstname, Alias, Email, Username, LastName, CommunityNickname, TimeZoneSidKey, 
                      LocaleSidKey, EmailEncodingKey, LanguageLocaleKey from User where Username='User2@marvell.com'];
            
            System.runAs(u){
            Opportunity testOpty = [select id from Opportunity where name ='TestOpty'];
            }

got this error when i am in System.runAs line. Please let me know the exact way to solve this error.. 

Thanks in advance.
Why salesforce does not show Recently Viewed List filter for Custom objects in Salesforce classic?  
Is there anyway we can create list filter for Recently View records. I cannot find LastViewedDate while creating new View.
Please suggest on this.