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


  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 7
    Questions
  • 1
    Replies
Hello guys, I have the "Search and Post Publisher" component added to my builder page in Community Page but after save and publish when I try to preview wit it does not show up. COuld u let me know what I am missing? SS for Ref

BuilderPage
User-added imageUser-added image
-------------------
Preview Page 
I am aware of configuring the body of it from the dropdown by selecting the edit layout but there is no option to configure the Header via that way. Any suggestions or ideas ?
COMPONENT :-

<aura:attribute name="allegato" type="PT_Allegato__c" default="{'sobjectType':'PT_Allegato__c',
                    'SoftDelete__c': false}"/>

<lightning:buttonIcon iconName="utility:delete" variant="error" alternativeText="Elimina" onclick="{!c.deleteToBin}" size="medium"/> 

SERVER SIDE CONTROLLER :-

deleteToBin : function(component, event, helper) 
    {
    alert('Are you sure to delete?')
    console.log('SoftDelete__c');

        var all = component.get("v.allegato");
        var soft = component.get("v.allegato.SoftDelete__c"); 

        all.SoftDelete__c === true;   

        component.set("v.allegato",all);

        component.set("v.soft",true);     
       
    component.set("v.allegato.SoftDelete__c",true);
    }
})
Hello !
I want to set a field inside a object to true (Ref line : all.SoftDelete__c === true;  inside Server Contorller.

But it is not working as expected, Can any1 suggest what I am doing wrong ? 

 
Hello, I have a requirement where if I press the delete button, the record should be hidden from the table. It should not be deleted from the Database as such.
COMPONENT:-

<aura:component controller='ProvideAccounts'>
    <aura:handler name="init" value="{!this}" action="{!c.onLoad}"/>
    
    <aura:attribute name="accounts" type="Account"/>
    
    <H1>ACCOUNT LIST</H1>
    
    <table class="slds-table slds-table_cell-buffer slds-table_bordered slds-table_striped">
        <thead>
            <tr class="slds-line-height_reset">
                <th class="slds-text-title_caps" scope="col">
                    <div class="slds-truncate">Account Name</div>
                </th>
                <th class="slds-text-title_caps" scope="col">
                    <div class="slds-truncate" title="Account Name">Account Number</div>
                </th>
                <th class="slds-text-title_caps" scope="col">
                    <div class="slds-truncate" title="Close Date">Account Balance</div>
                </th>
                <th class="slds-text-title_caps" scope="col">
                    <div class="slds-truncate" title="Stage">Account isActive ?</div>
                </th>
                <th class="slds-text-title_caps" scope="col">
                    <div class="slds-truncate" title="Amount">Account Status</div>
                </th>
                <th class="slds-text-title_caps" scope="col">
                    <div class="slds-truncate" title="Contact">Operations</div>
                </th>
            </tr>
        </thead>      
        <!--
    <center>
        <table>
            <tr>
                <th><b>Account Name</b></th>
                <th><b>Account Number</b></th>
                <th><b>Account Balance</b></th>
                <th><b>Account isActive ?</b></th>
                <th><b>Account Status</b></th>
                <th><b>Operations</b></th>
            </tr><br/>   
            -->
        <aura:iteration items="{!v.accounts}" var='a'>
            
            <tr>
                <td>{!a.Name} - {!a.Id} </td>
                <td>{!a.AccountNumber}</td>
                <td>{!a.Account_Balance__c}</td>
                <td>{!a.Active__c}</td>
                <td>{!a.Status__c}</td> 
                
                <button class="button" onclick="{!c.delAcc}" id="{!a.Id}" style="vertical-align:middle" type="button"><span>Delete </span></button>              
                
            </tr>
        </aura:iteration>             
    </table>
    <!-- </center>    -->
</aura:component>

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

SERVER SIDE CONTORLLER :-

  delAcc:function(component, event, helper){
        alert('Are yu Sure about this ? If Yes Press "OK"')
        console.log('INSIDE clientSideController DEL OP JS');
        helper.deleteAcc(component,event);
    }
----------------------

HELPER :-

deleteAcc : function(component,event) {
        debugger;       
        var action = component.get("c.delAccount");        
        //console.log(cmp.getLocalId());
        //console.log('Current Target Id :'+event.target.abc);
        action.setParams({ accId:event.target.id });        
        action.setCallback(this,function(response){            
            component.set("v.accounts",response.getReturnValue());
        })        
        $A.enqueueAction(action);
    }

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

APEX CONTROLLER :-

 public static List<Account> delAccount(Id accId){
        try{
            System.debug('INSIDE DelAccount method ServerSideController APEX');
            Account dAcc = [SELECT Id 
                            FROM Account
                            WHERE id=:accId];                            
            System.debug('After query ServerSideController APEX');
            DELETE dAcc;
            System.debug('After DELETE OP ServerSideController APEX');
            return [SELECT Name,AccountNumber,Account_Balance__c,Active__c,Status__c 
                    FROM Account                               
                    LIMIT:5];
        }
        catch(QueryException e){
            System.debug('Query Exception has occured :'+e.getMessage());
            return null;
        }
    }

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


User-added image
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