• Abhishek AS 3
  • NEWBIE
  • 10 Points
  • Member since 2021

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 10
    Questions
  • 8
    Replies
write trigger for:
Creates the number of contacts which are equal to the number which we will enter in the Number of Locations field on the Account Object.
Create Custom field called “Number of Locations” on the Account Object (Data Type=Number). can anyone provide code for this requirement
 
With lightning-record form want to create a lwc component to view and edit account records with 5 fields. Can u provide me code for this
My requirement is that there is a email field on contact. i have created a custom email field on Account. I want to search all accounts that have a matching email with a contact and add that account to the contacts lookup account field. If no such account exists with the same email then create a new account and add that account under the contact.
Using map in trigger. If account has more than one contact it should display like this. abc@gmail.com,xyz@gmail.com.
I have to display related cases (like 3 fields of case) of a contact on case record using lwc component. 
I have a requirement that i want to  autopopulate contacts account lookup field when the contact is created
How to show success message after executing a flow which is invoked by a list button and want to redirect it into same listview. Is there any solution?
I want to create a custom button on list view page using visual force page to update mass records of account and also I want to hide that button from certain users. How can I achieve it using code
I have a custom mass update button for mass updating fields of records. But I want to hide it from certain users. How can I do it?
 trigger EUCOBBrochureCount on Opportunity_Brochure__c (after insert, after delete, after undelete) {
    Set<Id> quoteIDs = new Set<Id>();
    if(Trigger.isInsert || Trigger.isUndelete){
        for(Opportunity_Brochure__c OB : Trigger.New){
            quoteIDs.add(OB.Quote__c);
        }
        EUCOBBrochureCountHandler.updateQuote(quoteIDs);
    }
    else if(Trigger.isDelete){
        for(Opportunity_Brochure__c opp : Trigger.old){
            quoteIDs.add(opp.Quote__c);
        }
        EUCOBBrochureCountHandler.updateQuote(quoteIDs);
    }
}



public with sharing class EUCOBBrochureCountHandler {
    public static List<Quote> updateQuote(Set<Id> quoteIds){
            Integer TotalCount = [select count() from Opportunity_Brochure_c where Quote_c in :quoteIds];
            List<Quote> quoteList = [select id, Brochure_Count__c from Quote where id in :quoteIds];
        
            for(Quote qt : quoteList){
                qt.Brochure_Count__c= TotalCount;
            }
        try{
            update quoteList;
        }
        catch(Exception e){ 
            ApexException.LogException(e);
        }
        return quoteList;
    }  
    
}
write trigger for:
Creates the number of contacts which are equal to the number which we will enter in the Number of Locations field on the Account Object.
Create Custom field called “Number of Locations” on the Account Object (Data Type=Number). can anyone provide code for this requirement
 
I have a custom mass update button for mass updating fields of records. But I want to hide it from certain users. How can I do it?
 trigger EUCOBBrochureCount on Opportunity_Brochure__c (after insert, after delete, after undelete) {
    Set<Id> quoteIDs = new Set<Id>();
    if(Trigger.isInsert || Trigger.isUndelete){
        for(Opportunity_Brochure__c OB : Trigger.New){
            quoteIDs.add(OB.Quote__c);
        }
        EUCOBBrochureCountHandler.updateQuote(quoteIDs);
    }
    else if(Trigger.isDelete){
        for(Opportunity_Brochure__c opp : Trigger.old){
            quoteIDs.add(opp.Quote__c);
        }
        EUCOBBrochureCountHandler.updateQuote(quoteIDs);
    }
}



public with sharing class EUCOBBrochureCountHandler {
    public static List<Quote> updateQuote(Set<Id> quoteIds){
            Integer TotalCount = [select count() from Opportunity_Brochure_c where Quote_c in :quoteIds];
            List<Quote> quoteList = [select id, Brochure_Count__c from Quote where id in :quoteIds];
        
            for(Quote qt : quoteList){
                qt.Brochure_Count__c= TotalCount;
            }
        try{
            update quoteList;
        }
        catch(Exception e){ 
            ApexException.LogException(e);
        }
        return quoteList;
    }  
    
}