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

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 13
    Questions
  • 10
    Replies
I have a requirement on Status field. If previous value of status field  is "Story Definition" the value we can update must be only "Ready for DEv" or "Dev in Progress" if any other value is selected it must throw an error.
I have requirement to create a LWC Component to retrieve related master contact(custom object) which has a lookup relation to contact object. the LWC componenet must consist of two search filter one for searching contact name and retrieve its related master contact and another search box to search account name and retrieve its related contact's master contact. there is no relation between account and master contact. Based on these two filters i want to retrieve corresponding master contact.Eg: if i am searching an account name 'test' which has two contact test1 and test 2 and in contacts search box i m entering 'test1' the 'test1' 's  master contact must be retrieved in form of datatable
I have a requirement in which i have to retrieve accounts related to contact where contact name matches the keyword entered by user.
string keySearch = '%' + 'T' + '%';
        List<Contact>conList=[SELECT Name,AccountId FROM Contact WHERE Name LIKE: keySearch];
        List<Account>accList= new List<Account>();
        for(Contact con: conList){
            if(con.AccountId!=null){
                accList=[Select id,Name, Industry From Account where id =: con.AccountId];
                
            }
            
        }
system.debug(conList);
system.debug(accList);
Its not working properly
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;
    }  
    
}
I have a requirement in which i have to retrieve accounts related to contact where contact name matches the keyword entered by user.
string keySearch = '%' + 'T' + '%';
        List<Contact>conList=[SELECT Name,AccountId FROM Contact WHERE Name LIKE: keySearch];
        List<Account>accList= new List<Account>();
        for(Contact con: conList){
            if(con.AccountId!=null){
                accList=[Select id,Name, Industry From Account where id =: con.AccountId];
                
            }
            
        }
system.debug(conList);
system.debug(accList);
Its not working properly
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;
    }  
    
}