• punit tyagi 12
  • NEWBIE
  • 0 Points
  • Member since 2021

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 22
    Questions
  • 2
    Replies
Difference between Implicit vs wired based invocation of apex method

 Let’s say you want to process 1 million records using Batch Apex.

batch size is 200

a.)then how many batch are created.

b.) how many transaction are created.

c.) how many times batch are call

d.) how many times finish execute method are executed.

 

Error:  CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY: contacttrigger: execution of AfterInsert caused by: System.ListException: Duplicate id in list: 0015g00000bIctOAAS Class.counttriggercontact.countcontact: line 39, column 1 Trigger.contacttrigger: line 15, column 1 []

public class counttriggercontact {
    
    public static void countcontact (List<Contact> conlist)
    {
        system.debug('inside the method');
        Map<String,list<contact>> accountcontactmap = new map<String,list<contact>>();
        Set<id> accountidset = new set<id>();
        for(contact con:conlist)
        {
            accountidset.add(con.accountid);
        }
        List<contact> alreadyaccount = [select id,accountid from contact where accountid in:accountidset];
        for(contact c:alreadyaccount)
        {
            if(accountcontactmap.containskey(c.accountid))
            {
                list<contact> conlist1 = accountcontactmap.get(c.accountid);
                conlist1.add(c);
                accountcontactmap.put(c.accountid,conlist1);
            }
            else
            {
                list<contact> newlist = new list<contact>();
                newlist.add(c);
                accountcontactmap.put(c.accountid,newlist);
            }
        }
        list<account> acclist = new list<account>();
        for(contact cobj:conlist)
        {
            list<contact> presentcontact = accountcontactmap.get(cobj.AccountId);
            account acc = new account ();
            acc.id = cobj.AccountId;
            acc.No_of_Contact__c = presentcontact.size();
            acclist.add(acc);
           
            
        }
        update acclist;
        
        
    }

}

when we have to use wire method to call apex method

we can call apex method on connectedcallback or on event method like onchange or conclick 

then why we use wired  to call apex 
difference btw flow vs flow builder

Is calling wired method in lwc is good practices. or imperative method ?

 

 

 

can partner user login both  salesforce(internal) and  community.
Is their any solution to get records of trials ,trailmixes and modules from my salesforce org (trailmaker)
how to get user trailhead details(Badges completed,inprogress,userpoints) through apex
can we do gmail integration thru community.please advise
Add more than 1000  invitee(user) to an event  in salesforce

field value not show in report .

user have  field accessibility

here I am facing an issue in the report.

I have a report where a picklist field that does show any data in reports.

but if I create another report or apply the same filter then this report shows the value of that field in the report.

In dashboard  five records are show in reports.
but when user select view reports in dashboard or click DETAILED  button in bottom of page then it show the reports .but not show the exact same record .one record are not show why??

when lwc component call in aura app NavigationMixin.Navigate does not work. but on recordpage it work

 Let’s say you want to process 1 million records using Batch Apex.

batch size is 200

a.)then how many batch are created.

b.) how many transaction are created.

c.) how many times batch are call

d.) how many times finish execute method are executed.