• Varun MK
  • NEWBIE
  • 10 Points
  • Member since 2016


  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 1
    Replies
Hello
I am getting the attached error. Has anyone resolved it without creating a new Org ?

User-added image
CMP:-

<aura:component controller="houseHoldServicesCtrl">      
    
    <aura:attribute name="Registration" type="Registration__c"/>
    <aura:attribute name="isMdlBxOpnLgn" type="boolean" default="false"/>
    <aura:attribute name="isMdlBxOpnReg" type="boolean" default="false"/>
    
    <!-- LOGIN MODAL BOX START -->
    
    <div class="RHS_button">         
        <lightning:button label="Login"
                          onclick="{!c.openModalBoxLgn}"
                          class="slds-button slds-button_outline-brand"
                          iconPosition="right"
                          />       
        
        <aura:if isTrue="{!v.isMdlBxOpnLgn}">            
            <!--###### MODAL BOX Start######--> 
            <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">
                    <!-- ###### MODAL BOX HEADER Start ######-->
                    <header class="slds-modal__header">
                        <lightning:buttonIcon iconName="utility:close"
                                              onclick="{!c.closeModalBox}"
                                              alternativeText="close"
                                              variant="bare-inverse"
                                              class="slds-modal__close"/>
                        <h2 id="modal-heading-01" class="slds-text-heading_medium slds-hyphenate">Login Page</h2>
                    </header>
                    
                    <div class="slds-modal__content slds-p-around_medium" id="modal-content-id-1">
                        <c:houseHoldServices_Login/>
                    </div>  
                    
                    <!--###### MODAL BOX FOOTER Part Start ######-->
                    <footer class="slds-modal__footer">
                        <lightning:button label="Login !"
                                          onclick=""
                                          class="slds-button slds-button_outline-brand"                          
                                          /> 
                        
                        <lightning:button label="Reset"
                                          onclick=""
                                          class="slds-button slds-button_outline-brand"                          
                                          />
                        
                        <lightning:button label="Go Back"
                                          onclick=""
                                          class="slds-button slds-button_outline-brand"                          
                                          />
                    </footer>
                </div>
            </section>
            <div class="slds-backdrop slds-backdrop_open"></div>
            <!--###### MODAL BOX Part END Here ######-->
            
        </aura:if>
    </div>
    <!-- LOGIN MODAL BOX END -->   
    
    
    
    <!-- REGISTRATION MODAL BOX START -->   
    <div class="RHS_button">                    
        <lightning:button label="Register / SignUp"
                          onclick="{!c.openModalBoxReg}"
                          class="slds-button slds-button_outline-brand"                        
                          />
    </div>   
    
    <aura:if isTrue="{!v.isMdlBxOpnReg}">            
        <!--###### MODAL BOX Start######--> 
        <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">
                <!-- ###### MODAL BOX HEADER Start ######-->
                <header class="slds-modal__header">
                    <lightning:buttonIcon iconName="utility:close"
                                          onclick="{!c.closeModalBox}"
                                          alternativeText="close"
                                          variant="bare-inverse"
                                          class="slds-modal__close"/>
                    <h2 id="modal-heading-01" class="slds-text-heading_medium slds-hyphenate">Registration Page</h2>
                </header>	
                
                <div class="slds-modal__content slds-p-around_medium" id="modal-content-id-1">
                    <lightning:input aura:id="EmaiL"
                                     
                                     value="{!v.Registration.EmaiL__c}"                          
                                     placeholder="Em@iL"/>
                    
                    <lightning:input aura:id="MobileNumber"
                                     
                                     value="{!v.Registration.Mobile_Number__c}"                          
                                     placeholder="Mobile Number"/>
                    
                    <lightning:input aura:id="Username"
                                     
                                     value="{!v.Registration.Username__c}"                         
                                     placeholder="Username"/> 
                    
                    <lightning:input aura:id="Password"                         
                                     value="{!v.Registration.Password__c}"                         
                                     placeholder="Password"/>
                </div>  
                
                <!--###### MODAL BOX FOOTER Part Start ######-->
                <footer class="slds-modal__footer">
                    <lightning:button label="Submit to Register !"
                                      onclick="{!c.registerUser}"
                                      class="slds-button slds-button_outline-brand"                          
                                      /> 
                    
                    <lightning:button label="Reset"
                                      onclick=""
                                      class="slds-button slds-button_outline-brand"                          
                                      />
                    
                    <lightning:button label="Go Back"
                                      onclick=""
                                      class="slds-button slds-button_outline-brand"                          
                                      />
                </footer>
            </div>
        </section>
        <div class="slds-backdrop slds-backdrop_open"></div>
        <!--###### MODAL BOX Part END Here ######-->
        
    </aura:if>
    
    <!-- REGISTRATION MODAL BOX END -->    
    
    <div class="LHS_button">
        <lightning:button label="Contact Us"
                          onclick=""
                          class="slds-button slds-button_outline-brand"
                          iconPosition="right"
                          />  | 
        
        <lightning:button label="About Us"
                          onclick=""
                          class="slds-button slds-button_outline-brand"                      
                          /> 
    </div>
    <div class="title">
        header
    </div>
</aura:component>

---------------------------------------------------------------------------------
clientSide Controller :-

 registerUser	:function(component,event,helper){
		debugger;        
        helper.regHelpr(component);
    }

----------------------------------------------------

helper:-

({
    regHelpr : function(component) {
        debugger;
        var strEmaiL		= component.find("EmaiL").get("v.value");
        var strMobileNumber	= component.find("MobileNumber").get("v.value");
        var strUsername		= component.find("Username").get("v.value");
        var strPassword		= component.find("Password").get("v.value");
        
        var action = component.get("c.submit");
        action.setParams({ 
            "EmaiL"			:strEmaiL,
            "MobileNumber"	:strMobileNumber,
            "Username"		:strUsername,
            "Password"		:strPassword
        });
        action.setCallback(this,function(response){            
            component.set("v.Registration",response.getReturnValue());            
        });

		component.set("v.isMdlBxOpnReg",false);        
        $A.enqueueAction(action); 
    }
})

----------------------------------------------------------

serverSide Controller APEX CLASS

public class houseHoldServicesCtrl {
    
    @AuraEnabled
    public static void submit(String EmaiL,String MobileNumber,String Username,String Password){
        
        Registration__c regstr = new Registration__c();
        
        regstr.EmaiL__c			= EmaiL;
        regstr.Mobile_Number__c	= MobileNumber;
        regstr.Username__c		= Username;
        regstr.Password__c		= Password;       
        
        Database.Insert(regstr);        
        
    }
}

User-added image

I have written the above code to insert a record from the page that I created. When I press the submit button I get the error below. 

Can any1 let me know what I am doing wrong?

User-added image
I have an Apex Class that returns the Count of Number of times a User Logs into an Org. Further, this Apex class is called from a flow.

I am facing trouble when I am calling this Apex class in the Flow. I have attached the SS's.

While choosing the output parameter,
  1. What should be the variable choices ? simple variable or collection variable ?
  2. What should be the Data Type ?
  3. I am getting the error attacehd as "The Data Type of the resource you entered doesnt match"
  4. How can I Test this flow, it is intended to create a record and disable a user.
----------------------Apex Class:--------------------------------------

public class UserLoginCount {   
    @InvocableMethod
    public static List<List<Integer>> CountOfUserLogin(){  
        List<AggregateResult> lstSession = [SELECT COUNT_DISTINCT(LoginHistory.UserId) totalCount 
                                            FROM AuthSession 
                                            WHERE LoginHistory.UserId=:UserInfo.getUserId()];
        
        Integer countOfLogin = lstSession.size() > 0 ? Integer.valueOf(lstSession[0].get('totalCount')) : 0;       
        
        List<Integer> authSes = new List<Integer>();
        authSes.add(countOfLogin);
        
        List<List<Integer>> wrapList = new List<List<Integer>>();
        wrapList.add(authSes);  
        
        System.debug('Count'+wrapList);
        
        return wrapList;
        
        
    }
}
-----------------XXXXXXXXXXXXXX--------------------------------------------
User-added image

User-added image

User-added image

User-added image
#Flows #Apex
I have an Apex Class that returns the Count of Number of times a User Logs into an Org. Further, this Apex class is called from a flow.

I am facing trouble when I am calling this Apex class in the Flow. I have attached the SS's.

While choosing the output parameter,
  1. What should be the variable choices ? simple variable or collection variable ?
  2. What should be the Data Type ?
  3. I am getting the error attacehd as "The Data Type of the resource you entered doesnt match"
  4. How can I Test this flow, it is intended to create a record and disable a user.
----------------------Apex Class:--------------------------------------

public class UserLoginCount {   
    @InvocableMethod
    public static List<List<Integer>> CountOfUserLogin(){  
        List<AggregateResult> lstSession = [SELECT COUNT_DISTINCT(LoginHistory.UserId) totalCount 
                                            FROM AuthSession 
                                            WHERE LoginHistory.UserId=:UserInfo.getUserId()];
        
        Integer countOfLogin = lstSession.size() > 0 ? Integer.valueOf(lstSession[0].get('totalCount')) : 0;       
        
        List<Integer> authSes = new List<Integer>();
        authSes.add(countOfLogin);
        
        List<List<Integer>> wrapList = new List<List<Integer>>();
        wrapList.add(authSes);  
        
        System.debug('Count'+wrapList);
        
        return wrapList;
        
        
    }
}
-----------------XXXXXXXXXXXXXX--------------------------------------------
User-added image

User-added image

User-added image

User-added image
#Flows #Apex