• bhanu_prakash
  • SMARTIE
  • 633 Points
  • Member since 2015
  • Salesforce Developer
  • Dquotient

  • Chatter
    Feed
  • 11
    Best Answers
  • 5
    Likes Received
  • 0
    Likes Given
  • 113
    Questions
  • 207
    Replies
How to write in trigger when the Opportunity is Closed Won the related Child Record’s Amount field will be equal to Opportunity’s Amount field.
Once I click on Submit button on a visualforce page, a Browser message should open which should have the option of "Agree" and "Disagree" and Save Button. How do I go about doing this?
<aura:component controller="MyContactListController" implements="force:lightningQuickAction" access="global">
    
    <aura:attribute name="recordId" type="Id" />
    <aura:attribute name="Account" type="Account" />
    <aura:attribute name="Contacts" type="Contact" />
     <aura:attribute name="Opportunities" type="Opportunity" />  
    <aura:attribute name="Columns" type="List" />
    <aura:attribute name="MyColumns" type="List"/>
    <aura:handler name="init" value="{!this}" action="{!c.myAction}" />
    <aura:handler name="AddRowEvt" event="c:AddNewRowEvt" action="{!c.addNewRow}"/>

    
    <force:recordData aura:id="accountRecord"
                      recordId="{!v.recordId}"
                      targetFields="{!v.Account}"
                      layoutType="FULL"
                      />
    <lightning:card iconName="standard:contact" title="{! 'Contact List for ' + v.Account.Name}">
        <!-- Contact list goes here -->
        <lightning:datatable data="{! v.Contacts }" columns="{! v.Columns }" keyField="Id" hideCheckboxColumn="true"/>
         <aura:iteration items="{!v.contactList}" var="item" indexVar="index">
                <c:dynamicRowItem ContactInstance="{!item}" rowIndex="{!index}" />
            </aura:iteration>

    </lightning:card>
    <div class="slds-modal__footer">
        <div class="slds-x-small-buttons--horizontal">
          <button class="slds-button slds-button--neutral">Create Contact</button>
          
        </div>
      </div>
    
    <lightning:card iconName="standard:opportunity" title="{! 'Opportunity List for ' + v.Account.Name}">
        <!-- Opportunity list goes here -->
        <lightning:datatable data="{! v.Opportunities }" columns="{! v.MyColumns }" keyField="Id" hideCheckboxColumn="true"/>
        <br/>
    </lightning:card>
    
    <div class="slds-modal__footer">
        <div class="slds-x-small-buttons--horizontal">
          <button class="slds-button slds-button--neutral">Create Opportunity</button>
          
        </div>
      </div>
</aura:component> this is my component ,any suggestions?
Hi All,

We have client who has its own website. When the user clicks in a link he is redirected to force.com site. But he is redirected to site URL which is is in HTTP. My requirement is that the URL should be changed from HTTP to HTTPS. The HTTPS setting checkbox in session settings is enabled. In the login settings of site, the secure web address is given as HTTPS. Is there any way that when user click on the link, it opens HTTPS instead of HTTP site URL. I tried to change to HTTPS in href tag of the website but its not working.

Thanks,
Anuj
I have trield almost every code and solution from forum still stuck into this challange.
Challange
Refactor Components and Communicate with Events
Refactor the input form for camping list items into its own component and communicate with component events.
Replace the HTML form in the campingList component with a new campingListForm component that calls the clickCreateItem JavaScript controller action when clicked.
The campingList component listens for a c:addItemEvent event and executes the action handleAddItem in the JavaScript controller. The handleAdditem method saves the record to the database and adds the record to the items value provider.
The addItemEvent event is of type component and has a Camping_Item__c type attribute named item.
The campingListForm registers an addItem event of type c:addItemEvent.
The campingListFormController JavaScript controller calls the helper's createItem method if the form is valid.
The campingListFormHelper JavaScript helper creates an addItem event with the item to be added and then fires the event. It then resets the newItem value provider with a blank sObjectType of type Camping_Item__c.

I am not pasting entire code as it is too lengthy.

I am trying from past 2 days, many hours ... still no luck.
Tried with every possible solution from Forum and StackExchange tried with fresh Trailhead Org, nothing worked.
with each try .. getting new errors.
Can someone please try the solution in their system and provide it in the comment ssection. That would be a great help.
Thanks in advance,
Manoj
 
Hello ,

I have a ligthning:dataTable not displaying correctly.

There is no header visible and also data is not visible.
Please explain why.
 
<aura:if isTrue="{!v.showCsResults}">          	
            <lightning:datatable data="{!v.csResults}" columns="{!v.csResultsColumns}" keyField="siret" hideCheckboxColumn="true" onrowaction="{!c.siretiser}" />
        </aura:if>
 
init: function (component, event, helper) {
        //This method is called on initialization
        //It formats the lightning:dataTable that will display the CS results with the appropriate columns and data types
        
         var actions = [
            { label: 'Sirétiser', name: 'siretiser' },
        ];
        
        component.set('v.csResultsColumns', [
             		{label: 'Siret', 							fieldName: 'siret', 	type: 'text'},
            		{label: 'Nom du Compte', 					fieldName: 'nomCompte', type: 'text'},
                    {label: 'Rue', 								fieldName: 'rue', 		type: 'text'},
            		{label: 'CP', 								fieldName: 'cp', 		type: 'text'},
            		{label: 'Ville', 							fieldName: 'ville', 	type: 'text'},
            		{ type: 'action', typeAttributes: { rowActions: actions } }
                ]);
    }


 
var csresults = new Array();
                    
					for (var item of results.companies) {
                        var csresult = new Object();
                        csresult.siret = item.regNo;
                        csresult.nomCompte = item.name;
                        csresult.rue = item.address.street;
                        csresult.cp = item.address.postalCode;
                        csresult.ville = item.address.city;
                        
                        csresults.push(csresult);
                    }
                    
                    
                    component.set('v.csResults', csresults);
                    component.set('v.showCsResults', true);


 
Hi All,
how to schedule batch class for  every 2 minuets

My Batch class :
global class InsertIterableBatch  implements database.Batchable<Slot__c> {
global Iterable<Slot__c> start (database.Batchablecontext bc){
        list<Slot__c> slotReclist = new list<Slot__c>(); 
        for(integer i=0;i<100;i++){
        Slot__c  slotRe = new Slot__c();
        slotre.RecordTypeId = '01228000000SxvX';
        slotRe.Duration__c = 1;
        slotRe.start_date_time__c = Datetime.newInstance(2018,5,1,15,0,0);
        slotRe.End_Date_Time__c =   Datetime.newInstance(2018,5,1,15,0,0);  
        slotRe.Max_No_Of_Students__c = 10;
        slotReclist.add(slotRe);
        }
        return slotReclist;
        }
global void execute (database.BatchableContext bc, list<Slot__c> slotreclist){
        insert slotReclist;
        }
global void finish (database.Batchablecontext bc){
        }
        }

how to schedule batch class for every 2 minuets

Visualforce Page and the corresponding peview.
HelloWorld VF page with HTML Headers
VF preview

Lightning Componet and its preview

Lightning Component with HTML Headers

Lightning component preview

Lightning Component preview

In lightning line break is applied automatically for each header tag where as in visualforce line break needs to applied to get content in new line.
And in visualforce and lightning the headers tags are rendered correctly all have same size even the headers are different




 

Hello,

I am looking for way for below two things
1) associate a lead with the a existing contact
2) associate a account with the existing contact

Thank you for guiding
I'm sure I might be missing something but I'm trying to enable or confirm whether the Ant Migration Tool is enabled in my Connected Apps. In the "Lightning Experience", if I go to setup, Manage Apps under Administration Setup, I see the Ant Migration Tool listed with no 'Start URL' defined, but under Setup, App Setup, Apps, I don't see it listed anywhere. The Force.com REST API Developer Guide doesn't explicitly state what to do in this situation, but I wanted to know if based on my settings whether the Ant Migration Tool is already setup for Oauth2.
I have developed a VisualForce page on one staging sandbox. I would like to make a package of it and deploy it on another staging sandbox. What would be a procedure I must follow?

Thank you
Hi Team,
Iam using javascript button on click custom button on lead object, when lead status is new need to redirect into a visualforce page with id. 
below code is working in classic 
{!REQUIRESCRIPT("/soap/ajax/29.0/connection.js")}
{!REQUIRESCRIPT("/soap/ajax/29.0/apex.js")}
var status = '{!Lead.Status}';
if (status != 'New') {
    alert('Please ensure this Lead is at the New Status prior generating the reservation form');
}
else{
   window.open('/apex/Downloadaspdf?retURL={!Lead.Id}&id={!Lead.Id}&noopptt={!Lead.LastName&", "&Lead.FirstName}'); 
}
I have idea that javascript buttons will not work in lightning 
how can i move it into lightning  without using lightning component

any help :) 

Thanks for advance 
Hi,

I have two visualforce pages and 1 vf page iam showing filter page and on click on show table button. Dispaly of table need to display in another vf page
Hi,

I have added dynamic table supporting nice in visual force page , now i need to modift rgem to support in lightning too 
Visual force Page 
<apex:page controller="DynamicTableController" showHeader="false" sidebar="false" lightningStylesheets="true">
    <html lang="en">

    <head>
        <meta charset="utf-8" />
        <meta name="viewport" content="width=device-width, initial-scale=1" />
        <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" />
        <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
        <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
    </head>
<apex:pageBlock >
    <apex:form >
        <apex:actionFunction name="ObjectFileds" action="{!ObjectFields}"/>
        
        <apex:commandButton value="Show Table" action="{!ShowTable}"/>
        
        <apex:pageBlockSection >
            <apex:pageBlockSectionItem >
                <apex:outputLabel value="Select Object" id="obj"/>
                <apex:selectList multiselect="false" size="1" value="{!SelectedObject}" onchange="ObjectFileds();">
                    <apex:selectOption itemLabel="--None--" itemValue="--None--"/>
                    <apex:selectoptions value="{!supportedObject}" />
                </apex:selectlist>
            </apex:pageBlockSectionItem>
            
            <apex:pageBlockSectionItem >
                <apex:outputLabel value="Select Field" rendered="obj"/>
                <apex:selectList multiselect="true" size="5" value="{!SelectedFields}">
                    <apex:selectOption itemLabel="--None--" itemValue="--None--"/>
                    <apex:selectoptions value="{!fieldLableAPI}" />
                </apex:selectlist>
            </apex:pageBlockSectionItem>
            
            <apex:pageBlockTable rendered="{!IF(ObjectList.size > 0 , true , false)}" value="{!ObjectList}" var="rec">
                <apex:column value="{!rec.Id}" rendered="{!IF(SelectedFields.size == 0 , true, false)}"/>
                <apex:repeat value="{!SelectedFields}" var="FieldLable">
                    <apex:column value="{!rec[FieldLable]}" rendered="{!IF(FieldLable != '--None--' , true, false)}"/>
                </apex:repeat>
            </apex:pageBlockTable>
            
            <apex:outputPanel rendered="{!IF(ObjectList.size < 1 , true , false)}">
                <apex:pageMessage severity="ERROR" summary="No records to display"/>
            </apex:outputPanel>
            
        </apex:pageBlockSection>
        
    </apex:form>
</apex:pageBlock>
</html>
</apex:page>

Controller
 
public class DynamicTableController
{
    //List displayed on UI
    public List<selectoption> supportedObject {get; set;}
    
    //Selected Object
    public String SelectedObject {get; set;}
    
    //Global describe
    Map<String, Schema.SObjectType> gd = Schema.getGlobalDescribe();
    Set<String> objectKeys = gd.keySet();
    
    //Field Select List
    public List<SelectOption> fieldLableAPI {get; set;}
    
    //Selected fields to be displayed in table
    public List<String> SelectedFields {get; set;}
    
    //List to maintain dynamic query result
    public List<sObject> ObjectList {get; set;}
    
    
    //Constructor
    public DynamicTableController()
    {
        //Initialize
        supportedObject = new List<selectoption>() ;
        SelectedObject = '' ;
        fieldLableAPI = new List<SelectOption>() ;
        SelectedFields = new List<String>() ;
        ObjectList = new List<sObject>() ;
        
        //Get only reference to objects
        for(Schema.SObjectType item : ProcessInstance.TargetObjectId.getDescribe().getReferenceTo())
        {
            //Excluding custom setting objects
            if(!item.getDescribe().CustomSetting)
            {
                //Adding to list
                supportedObject.add(new SelectOption(item.getDescribe().getLocalName().toLowerCase() , item.getDescribe().getLabel() ));
            }
        }
        
    }
    
    //Get fields of selected object
    public void ObjectFields()
    {
        if(SelectedObject != '--None--')
        {
            //Creating sObject for dynamic selected object
            Schema.SObjectType systemObjectType = gd.get(SelectedObject);
            //Fetching field results
            Schema.DescribeSObjectResult r = systemObjectType.getDescribe();
                
            Map<String, Schema.SObjectField> M = r.fields.getMap();
            //Creating picklist of fields
            for(Schema.SObjectField fieldAPI : M.values())
            {
                fieldLableAPI.add(new SelectOption(fieldAPI.getDescribe().getName() , fieldAPI.getDescribe().getLabel())) ;
            }
        }
    }
    
    public void ShowTable()
    {
        //Creating dynamic query with selected field
        String myQuery = 'Select Id ' ;
        
        for(String field : SelectedFields)
        {
            if(field.toLowerCase() != 'id' && field.toLowerCase() != '--none--')
            myQuery += ','+ field + ' ' ;
        }
        
        //Limit is 100 for now you can change it according to need
        myQuery += ' from ' + SelectedObject + ' LIMIT 100' ;
        
        //Executing the query and fetching results
        ObjectList = Database.query(myQuery) ;
    }
}

I have tried to move into lightning functions are not working fine  stuck with script
 
<apex:page controller="DynamicTableController" showHeader="false" sidebar="false" lightningStylesheets="true">
    <body>
        <apex:form >
        <div class="slds-form-element" style="text-align;" id="myBtn">
            <apex:commandButton styleClass="slds-button slds-button_neutral" value="Back"/>
        </div>
        <div class="container">
            <div class="panel panel-default">
                <div class="panel-heading">Choose an Object</div>
                <div class="panel-body">
                    <div class="row">
                        <div class="form-group">
                            <div class="col-sm-6">
                                <select class="form-control" id="meal">
                              <option value="" selected="true">--Select--</option>
                           </select>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            
        </div>
        <!-- Second Section -->
        <div class="container">
            <div class="panel panel-default" id="panel_2">
                <div class="panel-heading">
                    Choose Set of Fields (hold shift to select more than one):
                </div>
                <div class="panel-body">
                    <div id="pickList_2">
                    </div>
                </div>
            </div>
        </div>
        
        <!-- Third Section -->
        <div class="container">
            <div class="panel panel-default" id="panel">
                <div class="panel-heading">
                    Choose Unique Identifier1 (hold shift to select more than one):
                </div>
                <div class="panel-body">
                    <div id="pickList">
                    </div>
                </div>
            </div>
        </div>        
        </apex:form>
    </body>
    </html>
</apex:page>

 
Hi,

Iam looking to fetch all list of custom settings and need to display in Vfpage 
i have verifed and found that we can call one custom settings and refer in vf page 
https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_objects_custommetadatatype__mdt.htm
https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_methods_system_custom_settings.htm#apex_methods_system_custom_settings

But I need to fetch list of custom setttings .. How can i acheive it ?

 
Hi Team,

Need to display popup with contains account and contact button ..  If i click on contact need to display list of contacts with pagination .
if i click on accounts need to display list of accounts with pagination
need to support both lightning and classic.

Thanks for advance
Hi team,
I have tried to create a trigger to find dupilcate insertation and it is working fine. But it need to modify as per best practice 
trigger LeadDuplicateFinder on Lead (before insert, before update) {  
  	list <lead> lead = new list <lead>();
    for (lead a: trigger.new) {
        lead = [select id, name, email, phone from lead where email =: a.email AND Phone =: a.Phone];
        if (lead.size() > 0) {
            a.email.adderror('Email contains already exist');
            a.Phone.adderror('Phone Number contains already exist');
        }   
	}
}
Thanks for advance
 
Hi,

I need to design approval process we need to send approval for 5 users, 
If 1st user accepts then it need to more 2nd approval then 3rd then 4th then 5th
if any one reject that need to move back 
ex: if 3th rejects need to go to 2nd to approval.

How can we acheive these ?
Hi Team,

I have created lightning communty in my org. user has custom field type__c is gold, platinum, silver. If user is gold need to show on template, if user is platinum need to show another template.
1. How can i created same template with different UI 
2. How can i send user that particluar template based on type__c ?

Thanks
Hi Team,

Need to update Jira ticket fields when salesforce case field got update . How can we acheive it ?
we are using Custom Jira connector . Need help how to acheive via apex code ?

Thanks for advance
Hi Team,

How to design Jira integration with salesforce (without any connector or third party tools). Help me to design it.

 
I have designed trigger of Asset__c object , I was stucked it need to be use with trigger handler and with test class need help on that
 
trigger AssetTrigger on Asset__c (after insert, after update, after delete) {
    
    Set<Id> acctIds = new Set<Id>();
    if(trigger.isAfter){
        if(Trigger.isInsert || Trigger.isUpdate)
        for(Asset__c assetItem : Trigger.new){
            if(assetItem.Name != Trigger.oldMap.get(assetItem.Id).Name && assetItem.BillToAcc__c != null)
                acctIds.add(assetItem.BillToAcc__c);
        }

        if(Trigger.isDelete)
        for(Asset__c assetItem : Trigger.old){
            if(assetItem.BillToAcc__c != null)
            acctIds.add(assetItem.BillToAcc__c);
        }

        if(!acctIds.isEmpty()){
            
            List<Account> acctList = [Select Id, Count__c, (Select Id from BillToItem__c) from Account where Id in: acctIds];
            for(Account acc : acctList ){
                acc.Count__c= acc.BillToItem__c.size();                
            }
            system.debug('acctList'+acctList);
            update acctList;
        
        }

    }else if(trigger.isBefore){

    }       
    
}

 
Hi Team,

when ever I created new report and click on close need to new report and it need to dynamic for all new report created. so i need to bypass close button . ?
If yes- how can i achieve that and it need to support lightning too 
 
Hi team,

I have tried to design vf page to fetch list of accounts with pagination. Unable to pull account information .
vf page
<apex:page standardController="Account" recordSetVar="Accounts" extensions="PaginationAcc" lightningStylesheets="true" showHeader="false" sidebar="false" tabStyle="Account">
  <apex:form >
      <apex:pageBlock title="Accounts">
          <apex:pageBlockTable value="{!acList}" var="ac"  id="pgTaAcc">
              <apex:column width="10px">
                    <input type="radio" name="group1" />
                    <apex:actionSupport event="onclick" action="{!showContact}" ReRender="lab" >
                        <apex:param assignTo="{!accId}" name="accname" value="{!ac.id}"/>
                    </apex:actionSupport>
                </apex:column>
              <apex:column >
                 <apex:facet name="header">AccountName</apex:facet><apex:outputField value="{!ac.name}" />
              </apex:column>
              <apex:column >
                  <apex:facet name="header">Type</apex:facet><apex:outputField value="{!ac.Type}"/>
              </apex:column>
              <apex:column >
                  <apex:facet name="header">BillingCity</apex:facet><apex:outputField value="{!ac.BillingCity}"/>
              </apex:column>
              <apex:column >
                  <apex:facet name="header">BillingState</apex:facet><apex:outputField value="{!ac.BillingState}"/>
              </apex:column>
              <apex:column >
                  <apex:facet name="header">BillingCountry</apex:facet><apex:outputField value="{!ac.BillingCountry}"/>
              </apex:column>
          </apex:pageBlockTable>
          
          <apex:pageBlock id="lab">
              <apex:outputPanel rendered="{!conList.size == 0}">
                  <b>No records for this account</b>
              </apex:outputPanel>
              
              <apex:outputPanel rendered="{!conList.size != 0}">  
                  <apex:pageBlock title="Contacts">
                      <apex:pageBlockTable value="{!conList}" var="cn">
                          <apex:column >
                              <apex:facet name="header">First Name</apex:facet><apex:outputField value="{!cn.firstname}" />
                          </apex:column>
                          <apex:column >
                              <apex:facet name="header">Last Name</apex:facet><apex:outputField value="{!cn.lastname}" />
                          </apex:column>                      
                      <apex:column ><apex:facet name="header">Title</apex:facet><apex:inputField value="{!cn.Title}" /></apex:column>                                                                                           
                      <apex:column ><apex:facet name="header">Leadsource</apex:facet><apex:inputField value="{!cn.leadsource}"/></apex:column>                      
                      <b><apex:param name="em" value="{!eml}" assignTo="{!em}"/></b>
                  </apex:pageBlockTable>
                  </apex:pageBlock>
          </apex:outputPanel>          
          <apex:commandButton value="Save" action="{!save}" reRender="lan"/>          
          </apex:pageBlock>
          <apex:pageBlockButtons >
              <apex:commandButton value="First" action="{!first}"/> 
              <apex:commandButton value="Previous" action="{!previous}"/>
              <apex:commandButton value="Next" action="{!next}" reRender="pgTaAcc,lab" />
              <apex:commandButton value="Last" action="{!last}" reRender="pgTaAcc,lab"/> 
           <!-- <apex:outputText >{!(setcon.pageNumber * size)+1-size}   -    {!IF((setcon.pageNumber * size)>noOfRecords, noOfRecords,(setcon.pageNumber * size))} of {!noOfRecords}</apex:outputText> -->
          </apex:pageBlockButtons> 
      </apex:pageBlock>
  </apex:form>
</apex:page>

class
 
global class PaginationAcc {
    public PaginationAcc(ApexPages.StandardSetController setcon) { }    
    public List<Account> acList {get;set;}
    public List<Contact> conList {get;set;}   
    public string accId {get;set;}
    public string eml {get;set;}
    Public Integer noofRecords {get; set;}
    public integer size {get; set;}
    
    public Apexpages.standardsetController setcon{
        get{
            if(setCon == null){
                size = 10;
                String queryString = 'Select Name, Type, BillingCity, BillingState, BillingCountry from Account order by Name';
                setcon = new apexpages.standardsetController(Database.getquerylocator(queryString));
                setcon.setpagesize(size);
                noofRecords = setcon.getResultsize();
            }
            return setcon;
        }
         set;
    }
    Public list<Account> getAccounts(){
        list<Account> acclist = new list<Account>();
         for(Account ac : (list<Account>)setcon.getrecords()){
             acclist.add(ac);
         }
        return accList;
       
      
    }
   
    Public PageReference Refresh(){
       
        setcon=null;
        getAccounts();
        setcon.setpageNumber(1);
       
        return null;
    }
    
    public void showContact()
    {
        conList = new List<Contact>();
        for(contact c : [select id,firstname,lastname,Title,leadsource from contact where accountid =: accId])
        {
            conList.add(c);
        }      
    }
    
    public void save()
    {
        update conList;
    }
}
Thanks for advance
Hi Team,

I trying to design vf page which shows route map between two cities using google maps
ex: From__c : Bangalore
      To__c     : Hyderabad

Thanks for advance
Hi Team,

How to design test class as per best practices for these trigger handler with code coverage 

class
public without sharing class ContactTriggerHandler {
		public static void onAfterUpdate(list<Contact> newList,Map<Id,Contact> oldMap){
			list<account> filerAccountList = filerAccounts(newList);
			if(!filerAccountList.isEmpty()){
				update filerAccountList;
			}
		}
		
		public static void onAfterInsert(list<Contact> newList){
			list<account> filerAccountList = filerAccounts(newList);
			if(!filerAccountList.isEmpty()){
				update filerAccountList;
			}
		}
	
		public static void onAfterDelete(Map<Id,Contact> oldMap){
			list<account> filerAccountList = filerAccounts(oldMap.values());
			if(!filerAccountList.isEmpty()){
				update filerAccountList;
			}
		}
		
		private static list<account> filerAccounts(list<contact> contactList){
		 set<id> accountIdSet = new set<id>();
			for(contact con : newList){
				if(con.accountId != null){
					accountIdSet,add(con.accountId);
				}
			}
			list<account> accountToUpdateList = new list<account>();
			date latestdate = Date.newInstance(2008, 1, 1);
			for(account acc : [select Id, Date__c,(select Id,Date__c from contacts order by Date__c desc limit 1) from account]){
					for(contact con : acc.contacts){
						if(latestdate < con.Date__c){
							acc.Date__c = con.Date__c;
							accountToUpdateList.add(acc);
						}
					}
			}
			return accountToUpdateList;
		}
}



trigger
trigger LatestDateContact on Contact (after insert,after update,after delete) {
 if(Trigger.isAfter){
		if(Trigger.isUpdate) {   
	         ContactTriggerHandler.onAfterUpdate(trigger.new,trigger.oldMap);      
	    }else if(Trigger.isInsert) {
	         ContactTriggerHandler.onAfterInsert(Trigger.new);
	    }else if(Trigger.isDelete) {
	         ContactTriggerHandler.onAfterDelete(trigger.OldMap);
	    }
	}
}

Thanks for advance.
 
Hi team,

I have designed a trigger to update date__c field of contact on account object Date__c . Now i want to modify code with help of trigger handler class . How can I acheive it ?
trigger LatestDateContact on Contact (after insert,after update,after delete) {    
    List<Account> updAcc = new List<Account>();  
    Map<id,account> mapacc = new Map<id,account>( [select id,name,Date__c,(select id,Date__c from contacts) from account]);
    if(Trigger.isDelete) {
        List<Contact> oldContatcs = Trigger.Old;
        for(Contact con: oldContatcs) {
            Id accID = con.AccountID;
            date latestdate = Date.newInstance(2008, 1, 1);
            Account acc = mapacc.get(accID);
            for(Contact c: acc.Contacts) {
                if(latestdate < c.Date__c ) {
                    latestdate = c.Date__c;
                }
            }
            acc.Date__c = latestdate;
            updAcc.add(acc);
        }
        update updAcc;
    }
    if(Trigger.isInsert || Trigger.isUpdate) {
        List<Contact> newContacts = Trigger.New;
        for(Contact con: newContacts) {
            Id accID = con.AccountID;
            date latestdate = con.Date__c;
            if(latestdate == null) {
                latestdate = Date.newInstance(2008, 1, 1);
            }
            Account acc = mapacc.get(accID);
            for(Contact c: acc.Contacts) {
                if(latestdate < c.Date__c ) {
                    latestdate = c.Date__c;
                }
            }
            acc.Date__c = latestdate;
            updAcc.add(acc);
        }    
        update updAcc;
    }    
}


Thanks for advance 
 
How to create custom clone button. need to update parent and child records and it need to dynamic which can be used in any object 

like account, oppournity, case ..etc .

Thanks for advance
Hi Team,

I have amount__c in both contact and account . if account has many contacts  and i need to update highest amount of contacts and update that into account amount field ?

Ex : ABC account   Amount__c  =

       Contact1 :  T -- Amount__c = 500$
       Contact2 :  A -- Amount__c = 700$
       Contact3 :  B -- Amount__c =300$

now account amount__c need to update with 700$ . how can i acheive it using trigger
Hi Team,

How can we update child record information from vf page and need to add pagination
controller :
public with sharing class DiplayRelatedContacts {
   public List<Account> accList{get;set;}
   public list<Contact> conList{get;set;}
   public String accId{get;set;}
   public DiplayRelatedContacts(){
       accList=[SELECT Id,Name,AccountNumber FROM Account LIMIT 10];
   
   }
    public PageReference dispalyContact() {
       if(accId != null)
        conList=[SELECT id,FirstName,LastName,Phone,Department,Birthdate FROM COntact WHERE AccountId=:accId];
        update conList;
        return null;
    }    

     public pagereference save() {
     	update accList;
     	update conList;
     	return null;
	}   
}
Vf page 
 
<apex:page controller="DiplayRelatedContacts" id="pg" lightningStylesheets="true">
    <apex:form id="frm">
        <apex:pageBlock id="pgblk" >
            <apex:pageBlockTable value="{!accList}" var="ac">
                <apex:column width="10px">
                    <input type="radio" name="group1" />
                    <apex:actionSupport event="onclick" action="{!dispalyContact}" ReRender="conpgblk" >
                        <apex:param assignTo="{!accId}" name="accname" value="{!ac.id}"/>
                    </apex:actionSupport>
                </apex:column>
                <apex:column value="{!ac.Name}" />
                <apex:column value="{!ac.AccountNumber}" />
            </apex:pageBlockTable>
        </apex:pageBlock>
        
        
        <div id="globaSearch" class="modal fade" role="dialog" width="100%">
            <div class="modal-dialog">
               <div class="modal-content">
                    <div class="modal-header">
                       <!-- <button type="button" class="close" data-dismiss="modal">&times;</button> -->
                        <h4 class="modal-title">Contacts</h4>
                    </div>
                    <div class="modal-body">      
                        <apex:pageBlock id="conpgblk" >
                            <apex:outputPanel rendered="{!conList.size == 0}">
                                <b> NO RELATED CONTACTS FOR THIS ACCOUNT .</b>
                            </apex:outputPanel>
                            <apex:outputPanel rendered="{!conList.size != 0}">
                                <apex:pageBlockTable value="{!conList}" var="con">
                                    <apex:column value="{!con.FirstName}" />
                                    <apex:column value="{!con.LastName}" />                                   
                                    <apex:column ><apex:facet name="header">Birthdate</apex:facet> <apex:inputField value="{!con.Birthdate}"/></apex:column>
                                    <apex:column ><apex:facet name="header">Department</apex:facet> <apex:inputField value="{!con.Department}"/></apex:column>
                                    <apex:column ><apex:facet name="header">Phone</apex:facet> <apex:inputField value="{!con.Phone}"/></apex:column>        
                                </apex:pageBlockTable>
                            </apex:outputPanel>
                         
                            <apex:commandButton value="Save" id="save"/> 
                        </apex:pageBlock>
                        
                    </div>
                    
                </div>
                
            </div>
        </div>
        
    </apex:form>
</apex:page>

It is fetching information of related contacts and unable to update save functionality .
 
Hi Team,

Need to design to vf page which shows list of contacts assocaited with accounts and it need to be pagination and inline editing with save and delete button with supports slds

Thanks for advance.
Hi,

I need to design approval process we need to send approval for 5 users, 
If 1st user accepts then it need to more 2nd approval then 3rd then 4th then 5th
if any one reject that need to move back 
ex: if 3th rejects need to go to 2nd to approval.

How can we acheive these ?
 I have 3 objects   expense report, Region and Resource and all have lookup fields need to update using trigger.
 
 1. Expesene report has fields
 
    Expense Report Name :
    Region                :
    Company                 :
 
 2. Region object has fields
    Region Name:
    Resource   :
 
 3. Resource object has fields
    Resource Name :
    Company       :
    
    
 I need to write trigger that when expense report has created need to update company name automatically from (Expesene_report__r.Region__r.Resource__r.Company__c
 
  1. Expesene report has fields
 
    Expense Report Name :  Travel to company
    Region                :  England
    Company                :
 
 2. Region object has fields
    Region Name:  England
    Resource   :    Rajeev
 
 3. Resource object has fields
    Resource Name :    Rajeev
    Company       : Sunny Industries
    
    
    If Expense report (Travel to comapny ) is saved i need to update company as (Sunny Industries ) automatically..
How to store 700 picklist fileds ?
How can i get only text from words
EX:  Sultan Road
output : Road
How to convert text output into picklist
Hi.
I have a quick Action in our production Org on the Contact object which creates a Custom Object.  I'd like to move it to an existing Sandbox to do some more work on it.

There are 4 predefined field values on the Action, one of which is a Date field and it is calculated using a DATE(year,month,day) formula and another is a Text field that uses some YEAR(TODAY()) etc functions to construct part of a string.

The formulas in the Action save fine with no errors and the action works and creates a record with an appropriately calculated predefined field values.

However, when I put the action in a deployment package, send it to a sandbox and try to deploy it I get the following error message "Formula result is data type (Text), incompatible with expected data type (Date)."

Wondering what the problem is?
so there`s custom object named term_of_payment__c, has a look up to opportunity.. I want to make a trigger that will automatically insert term of payment on opportunity.. this is what i`ve tried so far.. sry im new on salesforce need some teaching
 
trigger autoAddTOP on Opportunity (after insert, after update) {
   
        for (Opportunity opp : Trigger.new) {
        //get opportunity data
        List<Opportunity> oppList = [SELECT Id, Interval__c, Amount, Quantity__c FROM Opportunity WHERE Id = :opp.Id];
        List<Term_of_Payment__c> terms = [SELECT Id FROM Term_of_Payment__c WHERE Opportunity__c = :opp.Id];        
        //get all products from opportunity
        List<OpportunityLineitem> products = [SELECT Id, Quantity, TotalPrice, Name, UnitPrice
                                              FROM OpportunityLineitem
                                              WHERE OpportunityId = :opp.Id];
        
        List<Term_of_Payment__c> termsToInsert = new List<Term_of_Payment__c>();
        Integer seq = 1;
          
        //loop the term of payment based on frequency each product
        for (Opportunity oppty : oppList) {
            Decimal freq = 0;
            if (oppty.Interval__c != null) {
                freq = Decimal.ValueOf(oppty.Interval__c);
            }

            if (freq > 0) {
                Decimal amountTod = (oppty.Amount / freq).setScale(2);
                
                for (Integer i=1; i<=freq; i++) {
                    if (i == 1 && seq == 1) {
                    Term_of_Payment__c newTOP1 = new Term_of_Payment__c();
                    newTOP1.Sequence__c = 1;
                    newTOP1.Amount__c = amountTOD;
                    newTOP1.Document_Date__c = date.parse('02/05/2018') + 30;
                    termsToInsert.add(newTOP1);
                    
                    }
                    seq++;
                    
                }
            } 
        } insert termsToInsert;
    }
 }

 
Hi, I'm new here and just starting out so apologise if this seems like a remedial question,

I currently have a custom object for subscription packages (Subscription_Type__c) within the subscription there is a field that details the cost of the subscription (Estimated_Monthly_Cost__c). I want my users to be able to add mutiple subscriptions and the oppertunities amount field (Amount) automatically total all the subsriptions thus giving me a total income for an oppertunity?

Thanks for any help,

Mike
     This my code display image: 
 
<apex:image width="100p" height="100p" value="{!URLFOR($Resource.ProductImage, 'ProductImage/' & row.ImageName__c)}"></apex:image>


If i login to salesforce and run it display ok.
View html of control:
<img src="/resource/1528944622000/ProductImage/ProductImage/1.jpg" height="100p" width="100p">



If i not login to salesforce and run, it can't display image.
View html of control:
<img src="/demo1/resource/1528944622000/ProductImage/ProductImage/" height="100p" width="100p">

i had set Cache Control of  resource [ProductImage] is Public
Why can't display image on public site from Static Resouce?
                
              
I can't unblock some apps on my Salesforce connected app admin. How do I allow an app to be unblocked? I am a salesforce admin. This app is just an Salesforce OAuth app not an Salesforce App.

User-added image
So I am trying to integrate Google Drive into my SF org, and I have followed all of the steps correctly, but when we try to validate and sync the drive to SF, we get this response: 

No_Openid_Response: Bad response. Please contact your administrator. 

Am I missing something? Is there something else I need to do that is not listed in the documentation? 

Thank you! 
the problem is i am not able to update opportunity field meanss their is class which have some condtion. i write a test class to cover that class.
public with sharing class Sample{

    public static void lastThreeMonthsVolumeOnLead(List<Opportunity> opps, 
                                                    Map<Id, Opportunity> oldOpps){
        
        Map<String, BankVolumeInfoOnLeadWrapper> appIdWithBankInformation = 
                new Map<String, BankVolumeInfoOnLeadWrapper>();
		System.debug(opps);
        System.debug(oldOpps);                                                
        for(Opportunity opp : opps){
            //this condition which i want to make fullfill in test class
            if(opp.Volume_Last_Month__c != oldOpps.get(opp.Id).Volume_Last_Month__c || 
                    opp.Volume_Two_Months_Ago__c != oldOpps.get(opp.Id).Volume_Two_Months_Ago__c || 
                    opp.Volume_Three_Months_Ago__c != oldOpps.get(opp.Id).Volume_Three_Months_Ago__c ){
                System.debug('hello i m here');
                BankVolumeInfoOnLeadWrapper bankVolumeWrapper = new BankVolumeInfoOnLeadWrapper();
                bankVolumeWrapper.volumeLastMonth = opp.Volume_Last_Month__c;
                bankVolumeWrapper.volumeTwoMonthsAgo = opp.Volume_Two_Months_Ago__c;
                bankVolumeWrapper.volumeThreeMonthsAgo = opp.Volume_Three_Months_Ago__c;   

                appIdWithBankInformation.put(opp.Id, bankVolumeWrapper);
            }
        } 

        if(appIdWithBankInformation.size() != 0) updateLeadWithBankVolumes(appIdWithBankInformation);  
    }

    static void updateLeadWithBankVolumes(Map<String, BankVolumeInfoOnLeadWrapper> 
                                                appIdWithBankInformation){

        Map<Id, Lead> leadsToUpdate = new Map<Id, Lead>();

        for(Lead lead : [SELECT Id, Volume_Last_Month__c,
                                Volume_Two_Months_Ago__c, 
                                Volume_Three_Months_Ago__c, 
                                Renewal_App__c
                                FROM Lead WHERE IsConverted = false AND 
                                Renewal_App__c != null AND 
                                Renewal_App__c IN: appIdWithBankInformation.keySet()]){
            
            BankVolumeInfoOnLeadWrapper bankVolumeWrapper = 
                appIdWithBankInformation.get(lead.Renewal_App__c);
            
            lead.Volume_Last_Month__c = bankVolumeWrapper.volumeLastMonth;
            lead.Volume_Two_Months_Ago__c = bankVolumeWrapper.volumeTwoMonthsAgo;
            lead.Volume_Three_Months_Ago__c = bankVolumeWrapper.volumeThreeMonthsAgo;
            
            leadsToUpdate.put(lead.Id, lead);
        }

        if(leadsToUpdate.size() != 0) update leadsToUpdate.values();
    }

    public class BankVolumeInfoOnLeadWrapper{
        public Decimal volumeLastMonth = 0;
        public Decimal volumeTwoMonthsAgo = 0;
        public Decimal volumeThreeMonthsAgo = 0;
        public bankVolumeInfoOnLeadWrapper(){}
    }

}
In above code i made bold tht condition which i want to full fill in test class.

and here is my test class
@isTest
public class SampleTest{
    
    @isTest
    static void getlastThreeMonthsVolumeOnLead()
    {
        Test.startTest();
         insert UtilityTest.getTriggerExecutionCS();
       
        Account acc = UtilityTest.getAccountWithRecordLabel('Broker Account');
        insert acc;
        
        Account acc1=UtilityTest.getAccountWithRecordLabel('Merchant Accounts');
        acc1.Name= 'Tiger Funding';
        insert acc1;
        
        Opportunity opp=UtilityTest.getOpportunity(acc.Id);
        opp.Volume_Last_Month__c=5;
        opp.Volume_Two_Months_Ago__c=25;
        opp.Volume_Three_Months_Ago__c =20;
        opp.Name='Test1';
        insert opp;
        System.debug(opp);
        
        opp.Volume_Last_Month__c=60;
        opp.Volume_Two_Months_Ago__c=50;
        opp.Volume_Three_Months_Ago__c =40;
        opp.Name='Test12';
        update opp;
        
        System.debug(opp);
        
        
           
        
        Test.stopTest();
    }

}

When i debug oldOpp and newOpp both return same value mnss it cannot get newer one can someone help me why is it so..   
I'm trying to create a visualforce page on the contact that will first insert a related event and then open up a web page. For some reason, I can populate the field values of the record but when I try to insert the record it breaks my code.

Here is my code:
<apex:page id="pg" standardController="Contact">
    <script>
		function openPage (){
            var ev = new sforce.SObject("Event");
            ev.Subject = "Join.me Meeting w/ " + "{! Contact.FirstName}" + " " + "{! Contact.LastName}";
            ev.ActivityDate = "{! NOW()}";
            ev.DurationInMinutes = 30;
            ev.WhoId = "{! Contact.Id}";
            ev.JoinmeV2__Join_Me_Activity__c = true;
        	ev.JoinmeV2__Meeting_Code__c = "thewealthpool";
            
            sforce.connection.create([ev]);
            
            var win = window.open('https://www.join.me', '_blank');
            win.focus();            
        }

	</script>

    
    <apex:form >
        <apex:includeScript value="/soap/ajax/33.0/connection.js"/>
		<apex:includeScript value="/soap/ajax/33.0/apex.js"/>
        <apex:commandbutton image="{!URLFOR($Resource.JoinMeLogo)}" onClick="openPage()"/>
    </apex:form>
    	
</apex:page>

 

I am trying to create a formula in SALESFORCE that calculates the "Loan Amount" using the following fields:

Interest Rate [ 6.00% ]
Loan Term [ 30 ]
Annual Loan Instalments [ 52 ]
Total Loan Instalments [ 1,560 ]
Loan Repayment [ 300 ]
Loan Amount [ ? ]


Similar Microsoft Excel Formula: PV (rate, nper, pmt, [fv], [type])

Does anyone have the SALESFORCE formula that can calculate the "Loan Amount" using these fields?
 
Hello, 

I have this apex class:
public without sharing class Opp_CalculTotalForcast {

    public static void TotalForcast (List <Opportunity> oppList)
    {
        system.debug('debut: ' +oppList);  
        integer i;
        Decimal TotalForcastparc =0;
        Decimal TotalForcastcurrency = 0;
        Decimal TotalForcastDomPorc = 0;
        Decimal TotalForcastDomcurrency = 0;
        Decimal TotalForcastIntparc = 0;
        Decimal TotalForcastIntcurrency = 0;
        Integer Nb_BUs_participating = 1;
                
        list<Tender_BU_Response__c> allBUList = new list<Tender_BU_Response__c>();
        list<Opportunity> Opp = new list<Opportunity>();
       
        for(Opportunity o:oppList ){
          Id  Id= o.id;
         system.debug('idopp : ' +Id);  
            allBUList = [Select id,BU_Name__c,Total_Parcels_Forecast__c,Stage__c, Total_Revenues_Forecast__c, Domestic_Parcels_Forecast__c,Domestic_Revenues_Forecast__c,International_Parcels_Forecast__c,International_Revenues_Forecast__c    from Tender_BU_Response__c where Tender__c =:  Id];
                    system.debug('allBUList : ' +allBUList);  

            if (allBUList.size()>0)
           {
            for (i=0; i < allBUList.size(); i++)
             { 
               if (allBUList[i].Total_Parcels_Forecast__c != NULL)
               { TotalForcastparc = TotalForcastparc +allBUList[i].Total_Parcels_Forecast__c;}                             
               if (allBUList[i].Total_Revenues_Forecast__c != NULL)    
               {TotalForcastcurrency = TotalForcastcurrency +  allBUList[i].Total_Revenues_Forecast__c;}    
               if (allBUList[i].Domestic_Parcels_Forecast__c != NULL)
               {TotalForcastDomPorc = TotalForcastDomPorc +  allBUList[i].Domestic_Parcels_Forecast__c;} 
               if (allBUList[i].Domestic_Revenues_Forecast__c != NULL)
               {TotalForcastDomcurrency = TotalForcastDomcurrency + allBUList[i].Domestic_Revenues_Forecast__c;}
               if (allBUList[i].International_Parcels_Forecast__c != NULL)
               { TotalForcastIntparc = TotalForcastIntparc + allBUList[i].International_Parcels_Forecast__c;}
               if (allBUList[i].International_Revenues_Forecast__c != NULL)
               {TotalForcastIntcurrency = TotalForcastIntcurrency + allBUList[i].International_Revenues_Forecast__c;}
                
                 {Nb_BUs_participating = Nb_BUs_participating+i;}    
              }
               system.debug('TotalForcast: ' +TotalForcastparc);
           }
            Opp = [Select id,Parcels_Forecasted__c,Amount, Total_Forecast_Domestic_Parcels__c, Total_Forecast_Domestic__c,Total_Forecast_International_Parcels__c,Total_Foreast_International__c from Opportunity  where id =:  o.Id];
            system.debug('opp: ' +Opp);
    if (Opp.size()>0)
    {
          for (Opportunity Opport: Opp) 
          {
              system.debug('ok:' );
            Opport.Amount    = TotalForcastcurrency;
            Opport.Parcels_Forecasted__c    = TotalForcastparc;
            Opport.Total_Forecast_Domestic_Parcels__c = TotalForcastDomPorc;
            Opport.Total_Forecast_Domestic__c  = TotalForcastDomcurrency;
            Opport.Total_Forecast_International_Parcels__c =TotalForcastIntparc;  
            Opport.Total_Foreast_International__c  =  TotalForcastIntcurrency;
            Opport.Nb_BUs_participating__c =   Nb_BUs_participating;
            upsert (Opport);
             }  
    }
         }
        
    }
    
    
}


I created test class

@isTest
public class Opp_CalculTotalForcast_Test {
    
@isTest
static void Opp_CalculTotalForcast_Test()
    {
        //Profil admin pour lancer le trigger
        
        Profile p = [select id from profile where Name='System Administrator' limit 1];   
        
        User u = new User(alias = 'test3', email='testemail@gmail.com', emailencodingkey='ISO-8859-1', lastname='Testing', languagelocalekey='fr',   
        localesidkey='fr_FR_EURO', profileid = p.Id, timezonesidkey='Europe/Paris', username='test1834'+String.valueOf(date.today())+'@csc.com');   
        insert u;
          system.runAs(u){
        //debut test    
     system.test.startTest();
     DateTime myDateTime = DateTime.newInstance(2014, 12, 16, 12, 6, 13);
     Date myDate = myDateTime.date();
     Id RecordTypeIdBUtypeAccount = Schema.SObjectType.Account.getRecordTypeInfosByName().get('Account').getRecordTypeId();
        //Create new account  
     Account acc = new Account (Name = 'testdeaicha23', recordTypeId = RecordTypeIdBUtypeAccount);
     insert acc;
      Account acc1 = new Account (Name = 'testdeaicha2', recordTypeId = RecordTypeIdBUtypeAccount);
     insert acc1;
    
      //create new opportunity      
     Opportunity opp = new Opportunity (AccountId = acc.id, Name = 'opptestaicha', StageName = '0. Pre-Alert', CloseDate = myDate);
     opp.Date_Received__c=Date.today();
     opp.Deadline_to_respond__c=Date.today();
     insert opp;    
              // create new BU Response attached to Opportunity
     Tender_BU_Response__c  BURespons = new Tender_BU_Response__c (Tier__c = acc.id,Tender__c=opp.id,  Name= 'BUtestaicha1', Domestic_New_Business_Parcels__c= 100, Domestic_Revenues_Forecast__c= 200, International_Parcels_Forecast__c    = 400, International_Revenues_Forecast__c= 350 );
     insert BURespons;
       update opp;

        system.test.stopTest();
          }
    }
}

But covrage is 64%, can someone help me
  • June 14, 2018
  • Like
  • 0
Hello!

User-added image

When I try to train my bot with the Intent Management Beta, this error message shows up, "Looks like your training job didn’t complete. Try again." I have created a couple of Dialogs with at least 20 Customer Intents each, so I'm not sure where I went wrong.

If anyone has built a working Bot and knows how to solve this, I would appreciate your help!
Hi,

I wrote a batch to update the fields, i got the below errors for my code

User-added image
Code
global class updatezone implements Database.Batchable<sObject>,Database.stateful{
    
    //Start Method....   
    global Database.querylocator start(Database.BatchableContext bc){
        Query = 'SELECT id,No_of_Agents__c,No_of_Female_Agents__c,No_of_Male_Agents__c,Agents_40_years_and_above__c,Agents_below_40_years__c,X1_star_Agents__c,X2_star_Agents__c,X3_star_Agents__c,X4_star_Agents__c,X5_star_Agents__c'+
            				' FROM Zone__C ';
        return Database.getQueryLocator(query);
    }
    global void execute(Database.BatchableContext bc, List<Zone__C> scope){
                 for(zone__c z : [SELECT Id,Name__C,No_of_Agents__c,No_of_Female_Agents__c,No_of_Male_Agents__c,Agents_40_years_and_above__c,Agents_below_40_years__c,X1_star_Agents__c,X2_star_Agents__c,X3_star_Agents__c,X4_star_Agents__c,X5_star_Agents__c FROM 
                         Zone__C]){
                              z.No_of_Agents__C = [SELECT count() FROM Agent__C WHERE Zones__C =: z.Name__C];
                              z.Agents_below_40_years__C = [SELECT count() FROM Agent__C WHERE Age__C <=40 AND Zones__C =: z.Name__C ];
                              z.Agents_40_years_and_above__c = [SELECT count() FROM Agent__C WHERE Age__C > 40 AND Zones__C =: z.Name__C ];
                              z.No_of_Male_Agents__C = [SELECT count() FROM Agent__C WHERE Gender__C =: 'Male' AND Zones__C =: z.Name__C ];
                              z.No_of_Female_Agents__C = [SELECT count() FROM Agent__C WHERE Gender__C =: 'Female' AND Zones__C =: z.Name__C];
                              z.X1_star_Agents__c = [SELECT count() FROM Agent__C WHERE Ranking_Stars__C =1 AND Zones__C =: z.Name__C ];
                              z.X2_star_Agents__c = [SELECT count() FROM Agent__C WHERE Ranking_Stars__C =2 AND Zones__C =: z.Name__C ];
                              z.X3_star_Agents__c = [SELECT count() FROM Agent__C WHERE Ranking_Stars__C =3 AND Zones__C =: z.Name__C ];
                              z.X4_star_Agents__c = [SELECT count() FROM Agent__C WHERE Ranking_Stars__C =4 AND Zones__C =: z.Name__C ];
                              z.X5_star_Agents__c = [SELECT count() FROM Agent__C WHERE Ranking_Stars__C =5 AND Zones__C =: z.Name__C ];
                         }
upsert z;
    }
    public void finish(Database.BatchableContext bc){
         Id job= bc.getJobId();
         }
}

 
Can I use any Lightning component to create tables with multiediting mode?
Hello,

I have requirement to fetch the addresses using the lat,long. Also want to schedule the functionality i.e every half an hour wan to fetch the users current location(Lat,Long) and then addresses using google map APIs.
I have done with the funstionality but I'm not getting addresses(street,city,state,postal code etc..)

getting the below error:
"error_message" : "You have exceeded your daily request quota for this API. We recommend registering for a key at the Google Developers Console: https://console.developers.google.com/apis/credentials?project=_",

"status" : "OVER_QUERY_LIMIT" 
Is there any way to fix the error.

welcome to your suggestions!


Thanks,
Nilesh

Hello,

I have a react native app integrated with other services of other companies and I would like to integrate it with Live Agent Chat.

I am the developer.

How do I integrate my app with Live Agent Chat?

Regarts