+ Start a Discussion
MasahiroYMasahiroY 
I've successfully plotted the accounts on Google Map with Lightning Component and it works in Sandbox...but don't know how to write a test code for the ApexClass.

I describe the codes below and hope anyone can help with the test code part. Thank you!

Component (MapNearbyAccount.cmp)
<aura:component controller="MapNearbyAccountController" implements="flexipage:availableForAllPageTypes,force:hasRecordId">
    <aura:attribute name="mapMarkers" type="Object"/>
    <aura:attribute name="selectedMarkerValue" type="String" />
    
    <aura:handler name="init" value="{! this }" action="{! c.init }"/>
    
    <div class="slds-box slds-theme--default">
        <lightning:map 
                       mapMarkers="{! v.mapMarkers }"
                       selectedMarkerValue="{!v.selectedMarkerValue}"
                       markersTitle="accounts nearby"
                       listView="auto"
                       showFooter="false"
                       onmarkerselect="{!c.handlerMarkerSelect}" />
    </div>
</aura:component>
Controller (MapNearbyAccount.js)
({
    init: function (cmp, event, helper) {
        var recordId = cmp.get("v.recordId");     
        var action = cmp.get("c.getAccounts");
        action.setParams({recordId :recordId});
        cmp.set('v.mapMarkers', [{location: {}}]);

        action.setCallback(this, function(response){
            
            var accounts = response.getReturnValue();
            var markers = [];
            for(var i = 0; i < accounts.length; i++){
                var acc = accounts[i];
                markers.push({
                    location: {
                        Country : acc.BillingCountry,
                        State : acc.BillingState,
                        City: acc.BillingCity,
                        Street: acc.BillingStreet
                    },
    
                    icon : "standard:account",
                    value: acc.Id,
                    title: acc.Name,
                    description:acc.Description
                });
            }
            
            if(markers.length != 0){
                cmp.set('v.mapMarkers', markers);
            }
        });

        $A.enqueueAction(action);
    },

    handlerMarkerSelect: function (cmp, event, helper) {
        console.log(event.getParam("selectedMarkerValue"));
    }
});
ApexClass (MapNearbyAccountController)
public class MapNearbyAccountController {
    @AuraEnabled
    public static List<Account> getAccounts(String BillingCity, String BillingState, String recordId){
        Account acct = [SELECT Id, Name, BillingCountry, BillingState, BillingCity, BillingStreet, Industry FROM Account WHERE Id =:recordId];
        
        return [SELECT Id, Name, BillingCountry, BillingState, BillingCity, BillingStreet,Description
                FROM Account 
                WHERE BillingState = :acct.BillingState AND BillingCity LIKE :('%' + acct.BillingCity + '%') AND Industry = :acct.Industry LIMIT 10];
    }
}
TestClass
@isTest
public class MapNearbyAccountControllerTest {
@isTest
    static void testMapNearbyAccountController() {
        Account acc1 = new Account();
        acc1.Name='acc1';
        acc1.BillingCity='Shibuya';
        acc1.BillingState='Tokyo';
        insert acc1;
        
        MapNearbyAccountController ctrl = new MapNearbyAccountController();
        
        Test.startTest();
            List<Account> getAccounts = ctrl.getAccounts();
            System.assertEquals(false,getAccounts.isEmpty());
        Test.stopTest();
    }
    
}
Best Answer chosen by MasahiroY
Maharajan CMaharajan C
Hi  Masahiro,

Please use the below test class:
 
@isTest
public class MapNearbyAccountControllerTest {
    @isTest
    static void testMapNearbyAccountController() {
        Account acc1 = new Account();
        acc1.Name='acc1';
        acc1.BillingCity='Shibuya';
        acc1.BillingState='Tokyo';
        insert acc1;
                
        Test.startTest();
        List<Account> getAccounts = MapNearbyAccountController.getAccounts('Shibuya','Tokyo',acc1.Id);
        System.assertEquals(false,getAccounts.isEmpty());
        Test.stopTest();
    }
    
}

Thanks,
Maharajan.C
Siva SakthiSiva Sakthi 
Hi, I am new to LWC ​​​​​​, trying dynamically add/remove rows for a table scenario. I can able to add the row by click on the + button. After added that rows I want to enter some values in text boxes and save into account object by click on save buttton. Also do the delete action as well to delete the specific row by click on delete button. 

I am facing issue with save & delete records. How I can solve this? Can anyone give me some guidence to solve.

AddDeleteRow
dynamicAddRow.html

<template>
                  
    <div class="slds-m-around--xx-large">
        <div class="slds-float_right slds-p-bottom_small">
            <h1 class="slds-page-header__title">Add Row
                <lightning-button-icon icon-name="utility:add"  size="large" variant="bare" alternative-text="Add" onclick={addRow}> </lightning-button-icon>
            </h1>
        </div>
        <div class="container-fluid">        
            <table class="slds-table slds-table_bordered slds-table_cell-buffer"> 
                <thead>
                    <tr class="slds-text-title_caps">
                        <th scope="col">
                            <div class="slds-truncate">#</div>
                        </th>
                        <th scope="col">
                            <div class="slds-truncate" title="Account Name">Account Name</div>
                        </th>
                        <th scope="col">
                            <div class="slds-truncate" title="Account Number">Account Number</div>
                        </th>
                        <th scope="col">
                            <div class="slds-truncate" title="Phone">Phone</div>
                        </th>
                        <th scope="col">
                            <div class="slds-truncate" title="Action">Action</div>
                        </th>
                    </tr>
                </thead>   
                <tbody>      
                    
                    <template for:each={accountList} for:item="acc" for:index="index">
                        <tr key={acc.Id}> 
                            <td>{index}</td>                                                  
                            <td>
                                <lightning-input label="Name" value={acc.Name} onchange={handleNameChange}></lightning-input>                               
                            </td>
                            <td>
                                <lightning-input label="Account Number" value={acc.AccountNumber} onchange={handleAccountNumberChange}></lightning-input>                        
                            </td>
                            <td>
                                <lightning-input label="Phone" value={acc.Phone} onchange={handlePhoneChange}></lightning-input>
                            </td>
                            <td>
                                <a onclick={removeRow}> 
                                    <lightning-icon icon-name="utility:delete" size="small" style="margin-top: -4px; margin-right: 0px;" ></lightning-icon>
                                    <span class="slds-assistive-text">Delete</span>
                                </a>
                            </td> 
                        </tr>
                    </template>
                     
                </tbody>
            </table>
            <div class="slds-align_absolute-center slds-p-top_small">                
                <lightning-button name="Save" label="Save" onclick={saveRecord} ></lightning-button>
            </div>
        </div>
    </div>

</template>
 
dynamicAddRow.js

import { LightningElement, track,api } from 'lwc';
import ACCOUNT_OBJECT from '@salesforce/schema/Account';
import NAME_FIELD from '@salesforce/schema/Account.Name';
import ACCOUNTNUMBER_FIELD from '@salesforce/schema/Account.AccountNumber';
import PHONE_FIELD from '@salesforce/schema/Account.Phone';
import saveAccounts from '@salesforce/apex/AccountController.saveAccounts';
import { ShowToastEvent } from 'lightning/platformShowToastEvent';
export default class CreateDynamicRecord extends LightningElement {
    @track accountList = []; 
    @track index = 0;
    @api recordId;
    @track name = NAME_FIELD;
    @track industry = ACCOUNTNUMBER_FIELD;
    @track phone = PHONE_FIELD;

    @api record = {
        firstName : '',
        lastName : '',
        Email : '',
        Phone : '',
        Title : ''
    }

    addRow(){

        this.index++;
   
        this.accountList.push ({
            sobjectType: 'Account',
            Name: '',
            AccountNumber : '',
            Phone: ''
        });

        console.log('Enter ',this.accountList);
        
       // this.accountList.push(this.record);
        //console.log(' After adding Record List ', this.accountList);
    }
    
    removeRow(){

        var index = this.index;
      
        if(this.accountList.length>1)
           this.accountList.splice(index, 1);

        //this.dispatchEvent(new CustomEvent('deleterow', {detail: this.index}));
        //console.log(' After adding Record List ', this.dispatchEvent);
    } 

    acc = {
        Name : this.name,
        AccountNumber : this.accNumber,
        Phone : this.phone
    }

    handleNameChange(event) {
        this.acc.Name = event.target.value;
        console.log("name", this.acc.Name);
    }
    
    handleAccountNumberChange(event) {
        this.acc.AccountNumber = event.target.value;
        console.log("AccountNumber", this.acc.AccountNumber);
    }
    
    handlePhoneChange(event) {
        this.acc.Phone = event.target.value;
        console.log("Phone", this.acc.Phone);
    }
    
    saveRecord(){        
        saveAccounts(this.acc.accountList)
            .then(result => {
                this.message = result;
                this.error = undefined;
                if(this.message !== undefined) {
                    this.acc.Name = '';
                    this.acc.AccountNumber = '';
                    this.acc.Phone = '';
                    this.dispatchEvent(
                        new ShowToastEvent({
                            title: 'Success',
                            message: 'Account created successfully',
                            variant: 'success',
                        }),
                    );
                }
                
                console.log(JSON.stringify(result));
                console.log("result", this.message);
                /*console.log(' After adding Record List ', result);
                this.accountList = result;
                console.log(' After adding Record List ', this.accountList);*/
            })
            .catch(error => {
                this.message = undefined;
                this.error = error;
                this.dispatchEvent(
                    new ShowToastEvent({
                        title: 'Error creating record',
                        message: error.body.message,
                        variant: 'error',
                    }),
                );
                console.log("error", JSON.stringify(this.error));
            });
    }
      
}
 
AccountController.apex  

public with sharing class AccountController { 
 
    @AuraEnabled( cacheable = true ) 
    public static List< Account > getAccounts() { 
      
        return [ SELECT Id, Name, Industry FROM Account LIMIT 10 ]; 
         
    } 
     
    @AuraEnabled( cacheable = true )
    public static void saveAccounts(List<Account> accList){
        Insert accList;
        /*if(accList.size()>0 && accList != null){
            insert accList;
        }*/
    } 
}
Thanks 
Siva
 
Best Answer chosen by Siva Sakthi
Danish HodaDanish Hoda
Hi Siva,
Please refer below code:
 
html:

<template>
    <div if:true={isLoaded} class="cstm-spinner">
		<lightning-spinner alternative-text="Loading..."></lightning-spinner>
	</div>
                  
    <div class="slds-m-around--xx-large container-fluid">
        <div class="slds-float_right slds-p-bottom_small">
            <h1 class="slds-page-header__title">Add Row
                <lightning-button-icon icon-name="utility:add"  size="large" variant="bare" alternative-text="Add" onclick={addRow}> </lightning-button-icon>
            </h1>
        </div>
        <div class="container-fluid">        
            <table class="slds-table slds-table_bordered slds-table_cell-buffer"> 
                <thead>
                    <tr class="slds-text-title_caps">
                        <th scope="col">
                            <div class="slds-truncate">#</div>
                        </th>
                        <th scope="col">
                            <div class="slds-truncate" title="Account Name">Account Name</div>
                        </th>
                        <th scope="col">
                            <div class="slds-truncate" title="Account Number">Account Number</div>
                        </th>
                        <th scope="col">
                            <div class="slds-truncate" title="Phone">Phone</div>
                        </th>
                        <th scope="col">
                            <div class="slds-truncate" title="Action">Action</div>
                        </th>
                    </tr>
                </thead>   
                <tbody>      
                    
                    <template for:each={accountList} for:item="acc" for:index="indx">
                        <tr key={acc.key} id={acc.key}> 
                            <td>{indx}</td>                                                  
                            <td>
                                <lightning-input data-id={indx} label="Name" value={acc.Name} onchange={handleNameChange}></lightning-input>                               
                            </td>
                            <td>
                                <lightning-input data-id={indx} label="Account Number" value={acc.AccountNumber} onchange={handleAccountNumberChange}></lightning-input>                        
                            </td>
                            <td>
                                <lightning-input data-id={indx} label="Phone" value={acc.Phone} onchange={handlePhoneChange}></lightning-input>
                            </td>
                            <td>
                                <lightning-button-icon icon-name="utility:delete"
																		  data-id={indx}       
																		  alternative-text="Delete"     
																		  class="slds-m-left_xx-small"
																		  onclick={removeRow} 
																		  title="Delete"></lightning-button-icon>
                            </td>
                        </tr>
                    </template>
                     
                </tbody>
            </table>
            <div class="slds-align_absolute-center slds-p-top_small">                
                <lightning-button name="Save" label="Save" onclick={saveRecord} ></lightning-button>
            </div>
        </div>
    </div>

</template>
 
js :

import { LightningElement, track,api } from 'lwc';
import ACCOUNT_OBJECT from '@salesforce/schema/Account';
import NAME_FIELD from '@salesforce/schema/Account.Name';
import ACCOUNTNUMBER_FIELD from '@salesforce/schema/Account.AccountNumber';
import PHONE_FIELD from '@salesforce/schema/Account.Phone';
import saveAccounts from '@salesforce/apex/AccountController.saveAccounts';
import { ShowToastEvent } from 'lightning/platformShowToastEvent';
export default class CreateDynamicRecord extends LightningElement {
    @track accountList = []; 
    @track index = 0;
    @api recordId;
    @track name = NAME_FIELD;
    @track accNumber = ACCOUNTNUMBER_FIELD;
    @track phone = PHONE_FIELD;
    isLoaded = false;

    @api record = {
        firstName : '',
        lastName : '',
        Email : '',
        Phone : '',
        Title : ''
    }

    acc = {
        Name : this.name,
        AccountNumber : this.accNumber,
        Phone : this.phone ? this.phone : "",
        key : ''
    }

    addRow(){

        this.index++;
        //var i = JSON.parse(JSON.stringify(this.index));
        var i = this.index;
   
        /*this.accountList.push ({
            sobjectType: 'Account',
            Name: '',
            AccountNumber : '',
            Phone: '',
            key : i
        });*/
        this.acc.key = i;
        this.accountList.push(JSON.parse(JSON.stringify(this.acc)));

        console.log('Enter ',this.accountList);
        
       // this.accountList.push(this.record);
        //console.log(' After adding Record List ', this.accountList);
    }
    
    removeRow(event){
        this.isLoaded = true;
        var selectedRow = event.currentTarget;
        var key = selectedRow.dataset.id;
        if(this.accountList.length>1){
            this.accountList.splice(key, 1);
            this.index--;
            this.isLoaded = false;
        }else if(this.accountList.length == 1){
            this.accountList = [];
            this.index = 0;
            this.isLoaded = false;
        }

        //this.dispatchEvent(new CustomEvent('deleterow', {detail: this.index}));
        //console.log(' After adding Record List ', this.dispatchEvent);
    } 

    

    handleNameChange(event) {
        var selectedRow = event.currentTarget;
        var key = selectedRow.dataset.id;
        var accountVar = this.accountList[key];
        this.accountList[key].Name = event.target.value;
        //this.acc.Name = event.target.value;
        //console.log("name", this.acc.Name);
    }
    
    handleAccountNumberChange(event) {
        /*this.acc.AccountNumber = event.target.value;
        console.log("AccountNumber", this.acc.AccountNumber);*/
        var selectedRow = event.currentTarget;
        var key = selectedRow.dataset.id;
        var accountVar = this.accountList[key];
        this.accountList[key].AccountNumber = event.target.value;
    }
    
    handlePhoneChange(event) {
        /*this.acc.Phone = event.target.value;
        console.log("Phone", this.acc.Phone);*/
        var selectedRow = event.currentTarget;
        var key = selectedRow.dataset.id;
        var accountVar = this.accountList[key];
        this.accountList[key].Phone = event.target.value;
    }
    
    saveRecord(){        
        saveAccounts({accList : this.accountList})
            .then(result => {
                this.message = result;
                this.error = undefined;
                if(this.message !== undefined) {
                    this.acc.Name = '';
                    this.acc.AccountNumber = '';
                    this.acc.Phone = '';
                    this.dispatchEvent(
                        new ShowToastEvent({
                            title: 'Success',
                            message: 'Account created successfully',
                            variant: 'success',
                        }),
                    );
                }
                
                console.log(JSON.stringify(result));
                console.log("result", this.message);
                /*console.log(' After adding Record List ', result);
                this.accountList = result;
                console.log(' After adding Record List ', this.accountList);*/
            })
            .catch(error => {
                this.message = undefined;
                this.error = error;
                this.dispatchEvent(
                    new ShowToastEvent({
                        title: 'Error creating record',
                        message: error.body.message,
                        variant: 'error',
                    }),
                );
                console.log("error", JSON.stringify(this.error));
            });
    }
      
}
 
AccountController.apex  

public with sharing class AccountController { 
 
    @AuraEnabled( cacheable = true ) 
    public static List< Account > getAccounts() { 
      
        return [ SELECT Id, Name, Industry FROM Account LIMIT 10 ]; 
         
    } 
     
//( cacheable = true ) doesn't support DML operations
    @AuraEnabled
    public static void saveAccounts(List<Account> accList){
        Insert accList;
        /*if(accList.size()>0 && accList != null){
            insert accList;
        }*/
    } 
}

 
MallikMallik 
I have been looking at other posts for my questions on how Apex batch works when there is an Error. Somehow I am not able to clear my self. I have couple of questions. Can someone please clarify.

1. Assume a batch process has 3 iterations processing 200 records each. The batch process is doing an insert and I am using Database.Insert with AllorNone parameter set to False. Assume there was an error during the second iteration while processing 101 record.I understand that all the records in the first iteration will be committed and also the 100 records in the second iteration. My question is will the batch process continue to process other records in the second iteration and also the third iteration.

2. Assume all the 3 iterations (execute method) completed without any error but some error occured in the Finish method. Finish method just sends an email. How does this work, considering that I am using Database.Insert and AllorNone parameter set to False. My understanding is that all the records will be committed to the database but user will not be receiving email that the batch was successfull or not. I am confused how this scenario will work in the real time.
Best Answer chosen by Mallik
Alexander TsitsuraAlexander Tsitsura
Hello Mallik,

1. OK. The first execute method successfully processed records, and this records committed to the database.
The second execute method successfully processed too, because of the "Database.Insert" method without the AllOrNone parameter is not throwing an exception. This method returns the list of SaveResults records. It means that successfully inserted only 199 records(1 fail #101).
But if you use the insert method or the Database.insert with AllOrNone parameter the second execute method failed, and all inserted/updated records in the second "execute" method will be rollback. And exceptions did not stop process "execute" method; this means that after an exception in the second batch execute method; the third batch "execute" method will process.

2. You are right. The start, execute and finish methods process in an asynchronous mode, and if the finish method failed, no an email message received. After each successfully processed "execute" methods, all records will have to be committed to the database. 

Thanks,
Alex
Sharad Chandra Maheshwari 1Sharad Chandra Maheshwari 1 
All examples that I have seen so far show how to add a custom button/action on Leads List View. I am looking for a way to launch a flow from a custom buttom/action from Account List View.

The Flow is to create account and related contact records and it needs to happen only through a flow, as the customer wants point and click customization.

User-added image

So far, I have only been able to launch the flow from within a record- by adding the action on the account page layout. However, my requirement is to launch the flow from the Account List View itself and not requiring the user to first have to select any other record. I have also tried creating a VF page to launch the flow from.


The issue that I am running into is

1- I do NOT see 'List View' as an option when I navigate to 'Search Layouts' on the Account Object and the 'Default Layout' does not have the custom button that I created

User-added image

Default Layout- supports only buttons that create or update a record

User-added image

2- I do see 'List View' listed when I navigate TO 'Search Layouts for Salesforce Classic' on the Account Object, however, the button to launch flow still does not show up under custom buttons and the only buttons that show up are related to either creating/updating a record. Also, I am sure if seeing the button to launch a flow under Search Layouts for Salesforce Classic would do me any good as I am working in Lightning
User-added image
User-added image


Direction on how to proceed ahead is greatly appreciated. Thank you in advance!
Best Answer chosen by Sharad Chandra Maheshwari 1
Sharad Chandra Maheshwari 1Sharad Chandra Maheshwari 1

My colleague @Maruthy Jakkam helped me solve this as follows-

There are 2 ways to go about it-
1- Using 'List Button' with content source as URL from 'Buttons, Links, and Actions' on Account object and add it to the custom button section for 'List View' layout under the 'Search Layouts for Salesforce Classic' as follows-

Fetch Flow URL:
User-added image

Create Custom List Button:
User-added image

User-added image

Add it to List View layout:
User-added image

User-added image

2- Second approach is to call embed the flow in a visualforce page and call it using a List Button as follows:

<apex:page standardController="Account" recordSetVar="sobjects">
<flow:interview name="Account_and_Contact_Creation_77946">
</flow:interview>
</apex:page>

Note: it is imperative to set the standardController and recordSetVar, otherwise, the vf page would not show up for list buttons.
 

@Shirisha- I had already exhausted all the resouces before posting it to the community and that video was one of those. It unfortunately does not solve the problem, but thank you for your help!

Samantha Lisk 10Samantha Lisk 10 
Hello All,

I'm setting up Embedded Services Chat. Is there a way to override the
embedded.svc.settings

parameters so that instead of text being displayed, an icon is displayed instead? For example, instead of 
embedded.svc.settings.defaultMinimizedText

we would have 
embedded.svc.settings.defaultMinimizedImage

. I've looked in the documentation and don't see any parameters like this, so would we have to build a LWC to override the default 
.embeddedServiceHelpButton

?
Best Answer chosen by Samantha Lisk 10
Samantha Lisk 10Samantha Lisk 10

Thanks, @Abhishek. It turns out that I was able to do this via styling. For anyone who has a similar issue, here is the styling that worked for me:

<style type='text/css'>
              .embeddedServiceHelpButton .helpButton .uiButton {
                background-color: #FFA400;
                border-radius: 50%;
                min-width: 5em;
               margin: 0 15px 15px 0;
            }
              .embeddedServiceHelpButton .helpButton .uiButton:focus {
                outline: 1px solid #FFA400;
                border-radius: 50%;
                min-width: 5em;
            }
              .embeddedServiceHelpButton .helpButton {
                margin: 0 15px 25px 0;
            }
              .embeddedServiceHelpButton .helpButton .uiButton .embeddedServiceIcon {
                margin: auto;
            }
              .embeddedServiceHelpButton .embeddedServiceIcon::before {
               font-size: 2.5em;
            }
              .embeddedServiceHelpButton .helpButton .uiButton .helpButtonLabel {
                display: none;
            }
             .embeddedServiceLiveAgentStateChatAvatar.isLightningOutContext .agentIconColor0 {
                background-color: #84bd00;
            }
</style>
Image attached for reference.
Circular orange chat button with large embedded service icon centered
Niraj Kr SinghNiraj Kr Singh 
My requirement is to create a field like "Related to" in this image.
Step1: Picklist with the Objects
Step2: On select of any one object, need to display all related records
Requirement to create a field like "Related to" field in this picture
Give me quick suggestion.

Thakns Niraj  
Best Answer chosen by Niraj Kr Singh
Rahul SharmaRahul Sharma
You would need to create custom functionality if you want to achieve something like that.
Create a picklist fields with available object names in related to and create custom lookup as mentioned in Jeff's blog (http://blog.jeffdouglas.com/2011/08/12/roll-your-own-salesforce-lookup-popup-window/).
In the javascript function: baseURL(refer blog post page: MyCustomLookup), add a parameter to dynamically load the pass the object name to the new page.
// Following is the url of Custom Lookup page. You need to change that accordingly
baseURL = "/apex/CustomAccountLookup?txt=" + txtId + '&objectName=' + objectApiName;

Then read objectApiName in CustomAccountLookupController to dynamically fetch the records using dynamic SOQL and List<sObject>.

Hope it helps!
Rick SF AdminRick SF Admin 
I have a formula field (Avg__c) that calculates the average of 4 custom fields (Base_Q1__c, Base_Q2__c, etc....) .

Formula:
(IF(ISNULL(Base_Q1__c),Null,Base_Q1__c) + IF(ISNULL(Base_Q2__c),Null,Base_Q2__c)+IF(ISNULL(Base_Q3__c),Null,Base_Q3__c) +IF(ISNULL(Base_Q4__c),Null,Base_Q4__c))
/
(IF(ISNULL(Base_Q1__c),Null,1) + IF(ISNULL(Base_Q2__c),Null,1)+IF(ISNULL(Base_Q3__c),Null,1) + IF(ISNULL(Base_Q4__c),Null,1)
The problem is that I'm trying to establish a “running average” but it only calculates the average if all 4 custom fields (Base_Q1__c...) contain a value. If one of the 4 fields are blank, then the formula field will not calcuate anything.  I need it to calculate the average no matter how value are displayed or blank. 

WITH ALL 4 VALUES - AVG Calculates:
User-added image

WITHOUT ALL 4 VALUES - No AVG Calculation:
User-added image
 
Please help!!!
 
Best Answer chosen by Rick SF Admin
Raj VakatiRaj Vakati
Use this one pls
 
(IF(ISNULL(Base_Q1__c),0,Base_Q1__c) + IF(ISNULL(Base_Q2__c),0,Base_Q2__c)+IF(ISNULL(Base_Q3__c),0,Base_Q3__c) +IF(ISNULL(Base_Q4__c),0,Base_Q4__c))
/
(IF(ISNULL(Base_Q1__c),0,1) + IF(ISNULL(Base_Q2__c),0,1)+IF(ISNULL(Base_Q3__c),0,1) + IF(ISNULL(Base_Q4__c),0,1)

 
User 444User 444 
1. If I deploy a profile from autorabbit from dev to qa sandbox, will it deploy apex classes access, vf page access and other object settings in qa? Do i need to do anything manually in qa box again?

2. Is there a way to assign apex classes to a profile through data loader?
Best Answer chosen by User 444
Sai PraveenSai Praveen (Salesforce Developers) 
Hi,

You may have to add those apex classes and Vf pages in additional to the Profiles because the profile metadata only get the basic details of the profiles. If you need any additional access like field-level permissions or Object permissions or Apex Class Access you have to add those as well in the deployment.


Regarding the second question Did you try data loading on SetUpEntityAccess object?

Let me know if you face any issues.

If this solution helps, Please mark it as best answer.

Thanks,





 
Christopher Bahr 4Christopher Bahr 4 
I'm looking through my event logs for calls to soon to be deprecated API versions. I have a list of calls and it shows the CONNECTED_APP_ID making these calls. How do I find the Connected App in my system that has that ID?
Best Answer chosen by Christopher Bahr 4
John Carey 15John Carey 15
Christopher, I was running into the same problem as you in that I did not get a return.  I found this article (https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_eventlogfile_apitotalusage.htm) and it mentions that if your Connected_App_Id starts with 888 you need to contact support.  That is what is happening to me so I am going to try contacting support to see what happens. 
Geeta ReddyGeeta Reddy 
Iam Unable to login to my developer login after taking professional edition my org ID is Org:  (00D2w00000O0COe 
.I am unable login to  throught forget password .
Please help me 
Best Answer chosen by Geeta Reddy
Sai PraveenSai Praveen (Salesforce Developers) 
Hi Geetha,

If the issue is log in flow you should be getting the email. By removing the login flow you will not  be  able to use that log in flow again and you may need to create a new.

Can you provide the consent that we can delete the log in flow and it anything breaks because of this it is your resposibility.

Can you just confirm the org Id and also domain name if possible just to confirm

Thanks,