Activity Forums Salesforce® Discussions how to covert object dataType into decimal dataType.

  • Saddam

    Member
    September 20, 2019 at 10:28 am

    Hi,

    you can use this

    public static void NewcountyUpdate(List<id> countyIds){

    List<New_Company__c> newval = new List<New_Company__c>();

    for (AggregateResult ar : [select count(Id) totalCount, Company_Realign__c countyId From Contact where Company_Realign__c = :countyIds GROUP BY Company_Realign__c ] ){
    newval.add(new New_Company__c(
    Id = (Id) ar.get('countyId'),

    //This One
    Alumni_contact_count__c = (Decimal) ar.get('totalCount')
    ));
    }
    update newval;
    }

     

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos