• Tyler Harris 8
  • NEWBIE
  • 20 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 7
    Questions
  • 3
    Replies
I'm trying to use the Lighting Path with Coach Class and get the scrollable arrows to work.  However, I can't set scrollable attribute on the inner div and I get this error:
 
Action failed: c:opportunityApprovalHistoryLightning$controller$popright [Cannot create property 'scrollLeft' on string '

How can I make the Chevon left right buttons scroll the div view appropriately? Here is the link to the LDS item I using for further context. I just want to be able to scroll left and right using the buttons.
User-added image

Lightning Component
<aura:component controller="opportunityApprovalHistoryLightning" implements="lightning:actionOverride,force:hasRecordId,flexipage:availableForAllPageTypes" access="Global" >

 <lightning:layout horizontalAlign="center" multipleRows="true">
     <lightning:layoutItem flexibility="grow" size="12" padding="around-small">
    <lightning:buttonGroup >
       <lightning:button label="Submit for Approval" variant="brand" class="slds-m-top_medium" onclick="
            <div class="slds-path__scroller" role="application" aura:id = "scroller_outer">
                
               <div class="slds-path__scroller_inner" aura:id = "scroller_inner">
                  <ul class="slds-path__nav" role="tablist">
                     <li class="slds-path__item slds-is-incomplete" role="presentation">
                        <a aria-controls="path-content-1" aria-expanded="true" aria-selected="false" class="slds-path__link" href="javascript:void(0);" id="path-1" role="tab" tabindex="-1">
                           <span class="slds-path__stage">
                             <lightning:icon iconName="utility:check" size="xx-small" />
                              <!--<span class="slds-assistive-text">Stage Complete</span>-->
                           </span>
                           <span class="slds-path__title">Sales Manager</span>
                        </a>
                     </li>
                     <li class="slds-path__item slds-is-incomplete " role="presentation">
                        <a aria-controls="path-content-2" aria-expanded="true" aria-selected="false" class="slds-path__link" href="javascript:void(0);" id="path-2" role="tab" tabindex="-1">
                           <span class="slds-path__stage">
                              <lightning:icon iconName="utility:check" size="xx-small" />
                              <span class="slds-assistive-text">Stage Complete</span>
                           </span>
                           <span class="slds-path__title">Regional Segment Director</span>
                        </a>
                     </li>
                     <li class="slds-path__item slds-is-incomplete " role="presentation">
                        <a aria-controls="path-content-3" aria-expanded="true" aria-selected="false" class="slds-path__link" href="javascript:void(0);" id="path-3" role="tab" tabindex="-1">
                           <span class="slds-path__stage">
                             <lightning:icon iconName="utility:check" size="xx-small" />
                              <span class="slds-assistive-text">Stage Complete</span>
                           </span>
                           <span class="slds-path__title">Product Marketing </span>
                        </a>
                     </li>
                     <li class="slds-path__item slds-is-incomplete" role="presentation">
                        <a aria-controls="path-content-4" aria-expanded="true" aria-selected="false" class="slds-path__link" href="javascript:void(0);" id="path-4" role="tab" tabindex="-1">
                           <span class="slds-path__stage">
                            <lightning:icon iconName="utility:check" size="xx-small" />
                              <span class="slds-assistive-text">Stage Complete</span>
                           </span>
                           <span class="slds-path__title">Engineering</span>
                        </a>
                     </li>
                     <li class="slds-path__item slds-is-incomplete" role="presentation">
                        <a aria-controls="path-content-5" aria-expanded="true" aria-selected="false" class="slds-path__link" href="javascript:void(0);" id="path-5" role="tab" tabindex="-1">
                           <span class="slds-path__stage">
                            <lightning:icon iconName="utility:check" size="xx-small" />
                              <span class="slds-assistive-text">Stage Complete</span>
                           </span>
                           <span class="slds-path__title">Product Marketing - Post Engineering</span>
                        </a>
                     </li>
                     <li class="slds-path__item slds-is-incomplete" role="presentation">
                        <a aria-controls="path-content-6" aria-expanded="true" aria-selected="false" class="slds-path__link" href="javascript:void(0);" id="path-6" role="tab" tabindex="-1">
                           <span class="slds-path__stage">
                            <lightning:icon iconName="utility:check" size="xx-small" />
                              <span class="slds-assistive-text">Stage Complete</span>
                           </span>
                           <span class="slds-path__title">Business Segment Leader</span>
                        </a>
                     </li>
                     <li class="slds-path__item slds-is-incomplete" role="presentation">
                        <a aria-controls="path-content-7" aria-expanded="true" aria-selected="false" class="slds-path__link" href="javascript:void(0);" id="path-7" role="tab" tabindex="-1">
                           <span class="slds-path__stage">
                            <lightning:icon iconName="utility:check" size="xx-small" />
                              <span class="slds-assistive-text">Stage Complete</span>
                           </span>
                           <span class="slds-path__title">Opportunity Owner</span>
                        </a>
                     </li>
                     <li class="slds-path__item slds-is-incomplete" role="presentation">
                        <a aria-controls="path-content-8" aria-expanded="true" aria-selected="true" class="slds-path__link" href="javascript:void(0);" id="path-8" role="tab" tabindex="0">
                           <span class="slds-path__stage">
                            <lightning:icon iconName="utility:check" size="xx-small" />
                              <span class="slds-assistive-text">Current Stage:</span>
                           </span>
                           <span class="slds-path__title">Closed</span>
                        </a>
                     </li>
         

                  </ul>
                  <div class="slds-path__scroll-controls">
                     <lightning:button class="slds-button slds-button_icon slds-button_icon-border-filled" title="Scroll left" tabindex="-1" onclick="{!c.popleft}">
                         <lightning:icon iconName="utility:chevronleft" size="xx-small" />
                        <span class="slds-assistive-text">Scroll left</span>
                     </lightning:button>
                     <lightning:button class="slds-button slds-button_icon slds-button_icon-border-filled" title="Scroll right" tabindex="-1" onclick="{!c.popright}">
                          <lightning:icon iconName="utility:chevronright" size="xx-small" />
                        <span class="slds-assistive-text">Scroll right</span>
                     </lightning:button>
                  </div>
               </div>
                
            </div>
         </div>
         <div class="slds-grid slds-path__action">
            <span class="slds-path__stage-name">Stage: Unqualified</span>
            <button class="slds-button slds-button_brand slds-path__mark-complete">
               Approval Pending
            </button>
         </div>
      </div>
    

</aura:component>

Lightning
({
	
  
    popright : function(component, event, helper){
        var inner = component.find("scroller_inner").getElement().innerHTML;
        console.log(inner);
        inner.scrollLeft -= 5;


    }
})

Hello,

I'm currently trying to find the best way to approach a request we have internally. I have inherited  custom Visualforce Community that has a custom search that is conducting a large SOSL search and rendering the results in VF and into a AngularJS controller. We have found that the JS remote call is very slow in rendering the results on page. So I have a few questions on how to optimize:

1) Would an API call be faster in fetching the results? Is there anything I can set in Salesforce to make this faster?

2) In general, are Lightning Components/Apps faster to render data on page? Would it make sense to refactor into a lightning component?

Apex
@RemoteAction
    global static List<SObject> getAllRecords (String language, String searchString, Boolean isSaved) {
        System.debug('>>> searchString = ' + searchString);
        List<SObject> records = new List<SObject>();
        String contentRecordTypeId = GlobalPRM_ManagementService.getRecordTypeId(GlobalPRM_ConstantDeclarations.CONTENT_RECORD_TYPE_RESOURCE, 'ContentVersion');
        
        String savedResourceIds = '';
        if (isSaved) {
            savedResourceIds = getSavedResourceIds();
             //Updated by JoJo 05/10/2016, If viewing saved only, but without saved resource, return empty records.             
               
             if (savedResourceIds == '' ) {
                 return records;
             }
        } 
        
        if (searchString == '') {
            String filter1 = '';
            if (savedResourceIds != '' ) {
                filter1 += ' AND Id IN ' + savedResourceIds;
            }
              System.debug('>>> filter1 = ' + filter1);
            records.addAll(GlobalPRM_ManagementService.getArticlesByFieldSet('Resource_Library__kav', 'GlobalPRM_ResourceLibraryArticle_FieldSe', language, filter1));
            String fieldNames = 'Title, Description, TagCsv, Brand__c, Type__c, Products__c, Solutions__c, Role__c, CreatedDate, LastModifiedDate, FileType';
            for(GlobalPRM_VisibilitySettings__c rec: GlobalPRM_VisibilitySettings__c.getAll().valueS()){
              fieldNames+=','+rec.source__c;
            }
            String filter2 = GlobalPRM_ManagementService.buildFilterForContent(language, 'RecordTypeId = \'' + contentRecordTypeId + '\'');
            if (savedResourceIds != '') {
                filter2 += ' AND Id IN ' + savedResourceIds;
            }
            System.debug('>>> filter2 = ' + filter2);
            records.addAll(GlobalPRM_ManagementService.queryListByFieldNames(fieldNames, 'ContentVersion', filter2));
        } else {
            String queryString = 'FIND \'' + searchString + '\' IN ALL FIELDS RETURNING ';
            String filter1 = GlobalPRM_ManagementService.buildFilterForArticle(language, '', 'Resource_Library__kav');
            String filter2 = GlobalPRM_ManagementService.buildFilterForContent(language, 'RecordTypeId = \'' + contentRecordTypeId + '\'');
            
            // 8/18/2016 Jade Global: This has been added to include customSetting Fields in Query and Visibility__c has been Removed from Query
            String visibilityFields = GlobalPRM_ManagementService.retQueryStringForCustomSettingFields('GlobalPRM_VisibilitySettings__c');
            
            if (savedResourceIds != '' ) {
                filter1 += ' AND Id IN ' + savedResourceIds;
                filter2 += ' AND Id IN ' + savedResourceIds;
            }
            queryString += 'Resource_Library__kav ('+visibilityFields+', Thumbnail__c, Heading__c, FirstPublishedDate, LastModifiedDate, Description__c, Products__c, Solutions__c, Brand__c, Type__c, Role__c, Tags__c, KnowledgeArticleId' + 
                           filter1 + '),' + 
                           ' ContentVersion ('+visibilityFields+' ,Title, Description, TagCsv, Brand__c, Type__c, Products__c, Solutions__c, Role__c, CreatedDate, LastModifiedDate, FileType' + 
                           filter2 + ')';
            System.debug('>>> queryString = ' + queryString);
            
            List<List<sObject>> results = search.query(queryString);
            for (Integer k = 0; k < results.size(); k++) {
                records.addAll(results[k]);
            }
        } 

       return GlobalPRM_ManagementService.filterByVisibilityPOC(records,null);
    }
    
    global static String getSavedResourceIds () {
        String savedResourceIds = '('; 
        
        String fieldNames = 'Id, Partner_User__c, Resource_ID__c';
        String filter = 'WHERE Partner_User__c = \'' + UserInfo.getUserId() + '\'';
        Set<String> articleNumberSet = new Set<String>();
        Set<String> contentDocumentSet = new Set<String>();

         //Updated by JoJo 05/10/2016, get ArticleNumber or ContentDocumentId by Resource_ID__c  
        for (Saved_Resource__c sr : (List<Saved_Resource__c>)GlobalPRM_ManagementService.queryListByFieldNames(fieldNames, 'Saved_Resource__c', filter)) {
             String resourceId = sr.Resource_ID__c;
            if(resourceId.length()==18){
                if(resourceId.startsWithIgnoreCase('069')){
                 //sr.Resource_ID__c  => Content Document Id          
                contentDocumentSet.add(sr.Resource_ID__c); 
                }else{
                    savedResourceIds += '\'' + sr.Resource_ID__c + '\', ';
                }
            }else{
                 //sr.Resource_ID__c  => ArticleNumber          
               articleNumberSet.add(sr.Resource_ID__c);
            }
        }
        //Get the knowledge articl id which publishStatus is online by ArticleNumber           
        KnowledgeArticleVersion[] kavList =[Select Id from KnowledgeArticleVersion where PublishStatus='online' and language='en_US' and ArticleNumber in :articleNumberSet];
        for (KnowledgeArticleVersion kav :kavList) {
         
           savedResourceIds += '\'' + kav.id + '\', ';
        }
        
       //Get the content version id which is the LatestPublishedVersionId  by content document id           
       ContentDocument[] cdList= [Select LatestPublishedVersionId From ContentDocument where id in :contentDocumentSet];
       for (ContentDocument cd :cdList) {
         
           savedResourceIds += '\'' + cd.LatestPublishedVersionId + '\', ';
        }
        
        if (savedResourceIds.length() == 1) {
            savedResourceIds = '';
        } else {
            savedResourceIds = savedResourceIds.substring(0, savedResourceIds.length() - 2);
            savedResourceIds += ')';
        }
        
        System.debug('>>>savedResourceIds' + savedResourceIds);
        return savedResourceIds;
    }