• Deja Bond
  • NEWBIE
  • 20 Points
  • Member since 2019

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 7
    Questions
  • 12
    Replies
Hi all, I have been trying to figure this out for a while. I have this test and I keep getting that my list is out of bounds. I cannot tell what I am doing wrong.
Here is my class
@auraEnabled
    public static void saveValues(String lvFields, String dvSettings, String adSettings){

        List<Matrix_User_Setting__c> userSettings = MTX_MatrixAccessor.getSettingsForCurrentUser(UserInfo.getUserId());

        userSettings[0].Additional_Detail_Settings_Selected__c = adSettings;
        userSettings[0].Detail_View_Settings_Selected__c = dvSettings;
        userSettings[0].List_View_Fields_Selected__c = lvFields;

        update userSettings;
    }
Here is my test class
@isTest
    public static void savingSettings(){

        Test.startTest();


        List<Matrix_User_Setting__c> matrixuserSettings = [SELECT Id, Additional_Detail_Settings_Selected__c, Detail_View_Settings_Selected__c, List_View_Fields_Selected__c, Current_Matrix__c FROM Matrix_User_Setting__c];
        System.debug(matrixuserSettings);
        //add to the first user's setting
        matrixuserSettings[0].Additional_Detail_Settings_Selected__c = 'Highlight';
        matrixuserSettings[0].Detail_View_Settings_Selected__c = 'City';
        matrixuserSettings[0].List_View_Fields_Selected__c = 'Current Employer';
        update matrixuserSettings[0];

        System.assert('Highlight'== matrixuserSettings[0].Additional_Detail_Settings_Selected__c);

        Test.stopTest();
    }
Can someone help?
Hi all, 
so on click of the "Create New Matrix" button, I need my modal to appear
Usually I do an aura:if, but I don't think that would work for this case

<div class="slds-align_absolute-center slds-m-around_small">
        <lightning:button variant="brand" disabled="{!!v.hasMtxSelected}" label="Add" title="Add" onclick="{! c.doAddCandidateToMatrix }" />
        <lightning:button variant="brand" label="Create New Matrix" title="Create New Matrix" onclick="{! c.doCreate }" />
        <lightning:button variant="brand" label="Cancel" title="Cancel" onclick="{! c.doCancel }" />
    </div>
    
    <!-- Deja B.-->   
    <!--SLIDE 6 on Wireframe-->
    
       <!-- <lightning:button variant="brand" label="Create New Matrix"  --> }" 
        <div aura:id="CreateMatrixModalState" onclick="{!v.displayCreateMatrixModalState}">
            <section role="dialog" tabindex="-1" aria-labelledby="modal-heading-01" aria-modal="true"
                     aria-describedby="modal-content-id-1" class="slds-modal slds-fade-in-open">
                <div class="slds-modal__container">
                    <header class="slds-modal__header">
                        <lightning:buttonIcon iconName="utility:close"
                                              onclick="{! c.doShowHideCreateMatrixModalState }" alternativeText="close"
                                              variant="bare-inverse" class="slds-modal__close" />
                        <h2 id="modal-heading-01" class="slds-text-heading_medium slds-hyphenate">
                            New Matrix Information</h2>
                    </header>
                    <div class="slds-modal__content slds-p-around_medium" id="modal-content-id-1">
                        <lightning:input aura:id="matrixName" name="Matrix Name" maxlength="80"
                                         label="Matrix Name" placeholder="Matrix Name" />
                        <aura:if isTrue="{!not(empty(v.inputError))}">
                            {!v.inputError}
                        </aura:if>
                    </div>
                    <footer class="slds-modal__footer">
                        
                        <button class="slds-button slds-button_brand"
                                onclick="{!c.doBack}">{!$Label.c.Back}</button>
                        
                        <!--Using doCreate as defined above-->
                        <button class="slds-button slds-button_brand" 
                                onclick="{!c.doCreate}">{!$Label.c.Create_New_Matrix_State}</button>
                        
                        <button class="slds-button slds-button_neutral"
                                onclick="{!c.doShowHideCreateMatrixModalState}">{!$Label.c.Cancel}</button>
                    </footer>
                </div>
            </section>
            <div class="slds-backdrop slds-backdrop_open"></div>
        </div>

Hence, when this button is clicked Create New Matrix
User-added image
This modal appears, 
User-added imageI think my onclicks are off because the modal appears without me clicking the button
 
Hi, I need help converting this method into an sobject, so it can accept two different types of objects

So currently the method is returning a lead activity record, but I want it to return a candidate record if the object is a contact, so I was thinking to add another condition to return something like return new LightningActivity(candidateRecord) if this isn't a RH_Lead__c object
public static LightningActivity fetchTestActivity(RH_Lead__c leadRecord) {
        if(leadRecord == null){
            system.debug('got a null');
            return fetchTestActivity();
        }
        return new LightningActivity(leadRecord);
    }
Hi all, 
I am trying to have my Candidate Lookup field on my UI to default to the current user
public LightningActivity(Contact candidateRecord){
        this();
        system.debug(candidateRecord);
        string userid = UserInfo.getUserID(); // getting current user info
        List<MTX_Matrix_Candidate__c> user= [SELECT Id, Name, Candidate__c FROM MTX_Matrix_Candidate__c 
        WHERE Id =: userid]; //storing the query into list for user

        if(candidateRecord.Candidate__c == null) //checking to see if  the lookup is populated
        {
            candidateRecord.Candidate__c = user.candidateName; //default to the current user
        }
    }
User-added imageRight now the Candidate Look up is blank, can someone help me with my code?
Hi, all 
I have this modal in which contains a dropdown list, of matrices that s user has acccess to. I want the available matrices to be displayed in the dropdown and not checkboxes. I need assistance with intertwining the two.
User-added imageSo the list that is shown in checkboxes should be contained in the dropdown. I want to remove the checkboxes completely.
Here's my code

<!--Add to Matrix Modal created by Deja B.-->
            <aura:if isTrue="{!v.displayAddtoMatrixModal}">
                <div aura:id="AddtoMatrixModal">
                    <section role="dialog" tabindex="-1" aria-labelledby="modal-heading-01" aria-modal="true"
                             aria-describedby="modal-content-id-1" class="slds-modal slds-fade-in-open">
                        <div class="slds-modal__container">
                            <header class="slds-modal__header">
                                <lightning:buttonIcon iconName="utility:close"
                                                      onclick="{! c.doShowHideAddtoMatrixModal }" alternativeText="close"
                                                      variant="bare-inverse" class="slds-modal__close" />
                                <h2 id="modal-heading-01" class="slds-text-heading_medium slds-hyphenate">Add Matrix
                                </h2>
                            </header>
                            <div class="slds-modal__content slds-p-around_medium" id="modal-content-id-1">
                                
                                <div class="slds-modal__content slds-p-around--medium">
                                    <label class="slds-form-element__label" for="select-01">Add
                                        {!v.data.candidates.length} candidates from shared
                                        "{!v.data.currentMatrix.Name}"
                                        matrix to</label>
                                    <lightning:select aura:id="select" name="select" label="Select a pie" onchange="{! c.onChange }">
                                        <option value="">choose one...</option>
                                        <option value="apple">apple</option>
                                        <option value="pumpkin">pumpkin</option>
                                        <option value="cherry">cherry</option>
                                        <option value="blueberry">blueberry</option>
                                        <option value="pickle">pickle</option>
                                    </lightning:select>
                                    <aura:iteration items="{!v.data.matrices}" var="matrix">
                                        <aura:if isTrue="{!matrix.CreatedById == v.data.currentUserId}">
                                            <lightning:input type="checkbox" value="{!matrix.Id}" label="{!matrix.Name}" aura:id="addedMatrixbx"/>
                                            <aura:set attribute="else">
                                                <lightning:input type="checkbox" value="{!matrix.Id}" label="{!matrix.Name}"
                                                                 iconName="utility:groups" />
                                            </aura:set>
                                        </aura:if>
                                    </aura:iteration>
                                </div>
                                <footer class="slds-modal__footer">
                                    <button class="slds-button slds-button_brand"
                                            onclick="{!c.doShowHideAddtoMatrixModal}">{!$Label.c.Cancel}</button>
                                    <button class="slds-button slds-button_neutral"
                                            onclick="{!c.doAddtoMatrix}">{!$Label.c.Add}</button>
                                </footer>                                
                            </div>
                        </div>
                    </section>
                    <div class="slds-backdrop slds-backdrop_open"></div>
                </div>
            </aura:if>

Any help, would be greatly appreciated.
Hi, so I have thid lightning dropdown menu, and upon selection of a menu item, I would like to display a modal. I have the code for the menu and the modal, I just do not understand how to connect the two, i.e display the modal when I am selecting an item.User-added image
And this is my modal code
User-added image
So the goal is that when the Add Candidate menu item is selected, the modal appears... any help would be greatly appreciated.
public class DuplicateLexController {
    
    public static Case cas {get;set;}
    public static String caseId{get;set;}
    public static String message {get;set;}
    
    public DuplicateLexController(ApexPages.StandardController s) {
        cas = (Case)s.getRecord();
        caseId = cas.id;
        System.debug('caseId'+caseId);
        
    }
    public PageReference updateCaseRecord(){
        List<Case> caseList = [SELECT RecordType.Name, Status, Tone__c, Category__c , SSR_Category__c , Reason
                               FROM Case 
                               WHERE Id = :caseId limit 1];
        if(caseList!=null && caseList.size()>0){
            if(caseList.get(0).RecordType.Name=='Support'){
                caseList.get(0).Status='Closed - Duplicate';
                caseList.get(0).Tone__c='Neutral';
                caseList.get(0).Category__c = 'Duplicate';   
            }else if(caseList.get(0).RecordType.Name=='SSR'){
                caseList.get(0).Status='Closed - Duplicate';
                caseList.get(0).Tone__c='Neutral';
                caseList.get(0).Category__c = 'Duplicate';
                caseList.get(0).SSR_Category__c = 'Duplicate';
                caseList.get(0).Reason='Duplicate';
            }
            update caseList.get(0);
        }
        Pagereference redirect =new Pagereference('/'+caseId);
        redirect.setRedirect(true);
        return redirect;
    }
}
Hi all, I have been trying to figure this out for a while. I have this test and I keep getting that my list is out of bounds. I cannot tell what I am doing wrong.
Here is my class
@auraEnabled
    public static void saveValues(String lvFields, String dvSettings, String adSettings){

        List<Matrix_User_Setting__c> userSettings = MTX_MatrixAccessor.getSettingsForCurrentUser(UserInfo.getUserId());

        userSettings[0].Additional_Detail_Settings_Selected__c = adSettings;
        userSettings[0].Detail_View_Settings_Selected__c = dvSettings;
        userSettings[0].List_View_Fields_Selected__c = lvFields;

        update userSettings;
    }
Here is my test class
@isTest
    public static void savingSettings(){

        Test.startTest();


        List<Matrix_User_Setting__c> matrixuserSettings = [SELECT Id, Additional_Detail_Settings_Selected__c, Detail_View_Settings_Selected__c, List_View_Fields_Selected__c, Current_Matrix__c FROM Matrix_User_Setting__c];
        System.debug(matrixuserSettings);
        //add to the first user's setting
        matrixuserSettings[0].Additional_Detail_Settings_Selected__c = 'Highlight';
        matrixuserSettings[0].Detail_View_Settings_Selected__c = 'City';
        matrixuserSettings[0].List_View_Fields_Selected__c = 'Current Employer';
        update matrixuserSettings[0];

        System.assert('Highlight'== matrixuserSettings[0].Additional_Detail_Settings_Selected__c);

        Test.stopTest();
    }
Can someone help?
Hi all, 
so on click of the "Create New Matrix" button, I need my modal to appear
Usually I do an aura:if, but I don't think that would work for this case

<div class="slds-align_absolute-center slds-m-around_small">
        <lightning:button variant="brand" disabled="{!!v.hasMtxSelected}" label="Add" title="Add" onclick="{! c.doAddCandidateToMatrix }" />
        <lightning:button variant="brand" label="Create New Matrix" title="Create New Matrix" onclick="{! c.doCreate }" />
        <lightning:button variant="brand" label="Cancel" title="Cancel" onclick="{! c.doCancel }" />
    </div>
    
    <!-- Deja B.-->   
    <!--SLIDE 6 on Wireframe-->
    
       <!-- <lightning:button variant="brand" label="Create New Matrix"  --> }" 
        <div aura:id="CreateMatrixModalState" onclick="{!v.displayCreateMatrixModalState}">
            <section role="dialog" tabindex="-1" aria-labelledby="modal-heading-01" aria-modal="true"
                     aria-describedby="modal-content-id-1" class="slds-modal slds-fade-in-open">
                <div class="slds-modal__container">
                    <header class="slds-modal__header">
                        <lightning:buttonIcon iconName="utility:close"
                                              onclick="{! c.doShowHideCreateMatrixModalState }" alternativeText="close"
                                              variant="bare-inverse" class="slds-modal__close" />
                        <h2 id="modal-heading-01" class="slds-text-heading_medium slds-hyphenate">
                            New Matrix Information</h2>
                    </header>
                    <div class="slds-modal__content slds-p-around_medium" id="modal-content-id-1">
                        <lightning:input aura:id="matrixName" name="Matrix Name" maxlength="80"
                                         label="Matrix Name" placeholder="Matrix Name" />
                        <aura:if isTrue="{!not(empty(v.inputError))}">
                            {!v.inputError}
                        </aura:if>
                    </div>
                    <footer class="slds-modal__footer">
                        
                        <button class="slds-button slds-button_brand"
                                onclick="{!c.doBack}">{!$Label.c.Back}</button>
                        
                        <!--Using doCreate as defined above-->
                        <button class="slds-button slds-button_brand" 
                                onclick="{!c.doCreate}">{!$Label.c.Create_New_Matrix_State}</button>
                        
                        <button class="slds-button slds-button_neutral"
                                onclick="{!c.doShowHideCreateMatrixModalState}">{!$Label.c.Cancel}</button>
                    </footer>
                </div>
            </section>
            <div class="slds-backdrop slds-backdrop_open"></div>
        </div>

Hence, when this button is clicked Create New Matrix
User-added image
This modal appears, 
User-added imageI think my onclicks are off because the modal appears without me clicking the button
 
Hi, I need help converting this method into an sobject, so it can accept two different types of objects

So currently the method is returning a lead activity record, but I want it to return a candidate record if the object is a contact, so I was thinking to add another condition to return something like return new LightningActivity(candidateRecord) if this isn't a RH_Lead__c object
public static LightningActivity fetchTestActivity(RH_Lead__c leadRecord) {
        if(leadRecord == null){
            system.debug('got a null');
            return fetchTestActivity();
        }
        return new LightningActivity(leadRecord);
    }
Hi, all 
I have this modal in which contains a dropdown list, of matrices that s user has acccess to. I want the available matrices to be displayed in the dropdown and not checkboxes. I need assistance with intertwining the two.
User-added imageSo the list that is shown in checkboxes should be contained in the dropdown. I want to remove the checkboxes completely.
Here's my code

<!--Add to Matrix Modal created by Deja B.-->
            <aura:if isTrue="{!v.displayAddtoMatrixModal}">
                <div aura:id="AddtoMatrixModal">
                    <section role="dialog" tabindex="-1" aria-labelledby="modal-heading-01" aria-modal="true"
                             aria-describedby="modal-content-id-1" class="slds-modal slds-fade-in-open">
                        <div class="slds-modal__container">
                            <header class="slds-modal__header">
                                <lightning:buttonIcon iconName="utility:close"
                                                      onclick="{! c.doShowHideAddtoMatrixModal }" alternativeText="close"
                                                      variant="bare-inverse" class="slds-modal__close" />
                                <h2 id="modal-heading-01" class="slds-text-heading_medium slds-hyphenate">Add Matrix
                                </h2>
                            </header>
                            <div class="slds-modal__content slds-p-around_medium" id="modal-content-id-1">
                                
                                <div class="slds-modal__content slds-p-around--medium">
                                    <label class="slds-form-element__label" for="select-01">Add
                                        {!v.data.candidates.length} candidates from shared
                                        "{!v.data.currentMatrix.Name}"
                                        matrix to</label>
                                    <lightning:select aura:id="select" name="select" label="Select a pie" onchange="{! c.onChange }">
                                        <option value="">choose one...</option>
                                        <option value="apple">apple</option>
                                        <option value="pumpkin">pumpkin</option>
                                        <option value="cherry">cherry</option>
                                        <option value="blueberry">blueberry</option>
                                        <option value="pickle">pickle</option>
                                    </lightning:select>
                                    <aura:iteration items="{!v.data.matrices}" var="matrix">
                                        <aura:if isTrue="{!matrix.CreatedById == v.data.currentUserId}">
                                            <lightning:input type="checkbox" value="{!matrix.Id}" label="{!matrix.Name}" aura:id="addedMatrixbx"/>
                                            <aura:set attribute="else">
                                                <lightning:input type="checkbox" value="{!matrix.Id}" label="{!matrix.Name}"
                                                                 iconName="utility:groups" />
                                            </aura:set>
                                        </aura:if>
                                    </aura:iteration>
                                </div>
                                <footer class="slds-modal__footer">
                                    <button class="slds-button slds-button_brand"
                                            onclick="{!c.doShowHideAddtoMatrixModal}">{!$Label.c.Cancel}</button>
                                    <button class="slds-button slds-button_neutral"
                                            onclick="{!c.doAddtoMatrix}">{!$Label.c.Add}</button>
                                </footer>                                
                            </div>
                        </div>
                    </section>
                    <div class="slds-backdrop slds-backdrop_open"></div>
                </div>
            </aura:if>

Any help, would be greatly appreciated.
Hi, so I have thid lightning dropdown menu, and upon selection of a menu item, I would like to display a modal. I have the code for the menu and the modal, I just do not understand how to connect the two, i.e display the modal when I am selecting an item.User-added image
And this is my modal code
User-added image
So the goal is that when the Add Candidate menu item is selected, the modal appears... any help would be greatly appreciated.
public class DuplicateLexController {
    
    public static Case cas {get;set;}
    public static String caseId{get;set;}
    public static String message {get;set;}
    
    public DuplicateLexController(ApexPages.StandardController s) {
        cas = (Case)s.getRecord();
        caseId = cas.id;
        System.debug('caseId'+caseId);
        
    }
    public PageReference updateCaseRecord(){
        List<Case> caseList = [SELECT RecordType.Name, Status, Tone__c, Category__c , SSR_Category__c , Reason
                               FROM Case 
                               WHERE Id = :caseId limit 1];
        if(caseList!=null && caseList.size()>0){
            if(caseList.get(0).RecordType.Name=='Support'){
                caseList.get(0).Status='Closed - Duplicate';
                caseList.get(0).Tone__c='Neutral';
                caseList.get(0).Category__c = 'Duplicate';   
            }else if(caseList.get(0).RecordType.Name=='SSR'){
                caseList.get(0).Status='Closed - Duplicate';
                caseList.get(0).Tone__c='Neutral';
                caseList.get(0).Category__c = 'Duplicate';
                caseList.get(0).SSR_Category__c = 'Duplicate';
                caseList.get(0).Reason='Duplicate';
            }
            update caseList.get(0);
        }
        Pagereference redirect =new Pagereference('/'+caseId);
        redirect.setRedirect(true);
        return redirect;
    }
}
I am implementing lightning:tabset and lightning:tab to display tabs in a lightning component -- I am trying to conditionally display one particular tab based on a value returned by the controller -- but it is not rendering the tab. Does anyone have any insight into how to achieve this functionality? Also, when I try to set the selectedTabId in the init function, I get an error saying the tab does not exist.

Controller:
({
	doInit : function(component, event, helper) {
        var action = component.get("c.getSearchFromId");
        action.setParams({
            "recordId": component.get("v.recordId")
        });
        action.setCallback(this, function(response) {
            var state = response.getState();
            if(state === "SUCCESS"){
                if(response.getReturnValue().Candidates_Visible__c == true){
                    component.set('v.displayCandidates',true);
                } else {
                    component.set('v.displayCandidates',false);
                }
                component.set('v.search',response.getReturnValue());
            }
        });
        $A.enqueueAction(action);
	}
})
Component:
 
<aura:component controller="SecureSiteController" implements="force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId,forceCommunity:availableForAllPageTypes" access="global" >

    <ltng:require styles="/resource/slds_2_1_3/assets/styles/salesforce-lightning-design-system-vf.css" />
    
    <aura:attribute name="recordId" type="String" access="global" />
    <aura:attribute name="search" type="Search__c" access="global" />
    <aura:attribute name="displayCandidates" type="Boolean" default="false" />

    <aura:handler name="init" value="{!this}" action="{!c.doInit}" access="global" />
    
    <!-- Display secure site tabs -->
    <lightning:tabset variant="default" selectedTabId="{!v.selTabId}">
		<aura:if isTrue="{!v.displayCandidates == true}">
            <lightning:tab aura:id="candidates" tabindex="1" id="candidates" title="Candidates" label="Candidates">
                <c:CandidateViewer recordId="{!v.recordId}" />
            </lightning:tab>
        </aura:if>
        <lightning:tab aura:id="searchmaterials" tabindex="2" id="searchmaterials" title="Search Materials" label="Search Materials">
            <c:SearchMaterials recordId="{!v.recordId}" />
        </lightning:tab>
        <lightning:tab aura:id="keydates" tabindex="3" id="keydates" title="Key Dates" label="Key Dates">
            <c:SearchKeyDates recordId="{!v.recordId}" />
        </lightning:tab>
        <lightning:tab aura:id="consultants" tabindex="4" id="consultants" title="Consultants" label="Consultants">
            <c:SearchConsultants recordId="{!v.recordId}" />
        </lightning:tab>
        <lightning:tab aura:id="securemessage" tabindex="5" id="securemessage" title="Send a Message" label="Send a Message">
            <c:SecureSiteMessage recordId="{!v.recordId}" />
        </lightning:tab>
    </lightning:tabset>
    
</aura:component>


 
Hi,

I have a situation where I need to dynamically set the default tab in a tab panel. I have a parameter in my controller that I'm trying to use but for some reason the default tab isn't being set. If I hard code the name of the tab it works but once I try to use a visual force parameter the default tab doesn't get set properly. Here's sample code that illustrates the problem:

Code:
public class TabTest {


 public String ActiveTab {get; set;} 
 
 
 public TabTest() {
  this.ActiveTab = 'Tab2'; 
 }


}

Code:
<apex:page controller="TabTest">
 <apex:tabPanel switchType="client" selectedTab="{!ActiveTab}" id="slipTabPanel">
    <apex:tab label="Tab 1" name="tab1" id="tab1">
      Tab1
    </apex:tab>
    <apex:tab label="Tab 2" name="tab2" id="tab2">
      Tab2 
    </apex:tab>
    <apex:tab label="Tab 3" name="tab3" id="tab3">
      Tab3
    </apex:tab>
 </apex:tabPanel>
</apex:page>

 If I hard code to selectedTab="tab2" then it works fine but if I try to use a controller parameter it doesn't work. Any ideas what I might be doing wrong?
 

  • September 10, 2008
  • Like
  • 0