Salesforce tech info
Salesforce tech info
  • 7
  • 60 082

วีดีโอ

Trigger to update number of contacts associated with account
มุมมอง 14K3 ปีที่แล้ว
Hi all, This trigger will help you to clear After insert ,after delete concept with trigger for number of contacts associated with Account
Salesforce Practical Based Interview Questions
มุมมอง 3083 ปีที่แล้ว
Hi Everyone, Today I have shared a practical based salesforce interview question, which will be asked in Interviews Please Like share and subscribe to get more videos on this
Remove default record type from the profile || salesforce
มุมมอง 14K3 ปีที่แล้ว
Hi, To remove default record type from the profile like chatter, Guest user which we are not able to edit ,Here is the solution for you :)
Trigger scenario(when account address is updated related contact address also updates)
มุมมอง 18K4 ปีที่แล้ว
HI,everyone here you are going to learn about Trigger scenario(when account address is updated related contact address also updates) this is the most asked question in interview so like share and subscribe and don't forget to hit that bell icon
write trigger to upload same field value in account object
มุมมอง 1.1K6 ปีที่แล้ว
write trigger to upload same field value in account object
write trigger on account it automatically created on contact object
มุมมอง 10K6 ปีที่แล้ว
subscribe share like

ความคิดเห็น

  • @krupasagar5598
    @krupasagar5598 หลายเดือนก่อน

    If I have more profiles then wt to do

  • @gnicevids
    @gnicevids 2 หลายเดือนก่อน

    this was truly awesome and helpful

  • @gurubaburavula-c3f
    @gurubaburavula-c3f 3 หลายเดือนก่อน

    i never seen this type of explantion with writing and i easy understood how data have passing

  • @roopeshramaswamy4386
    @roopeshramaswamy4386 4 หลายเดือนก่อน

    Very Helpful thanks!!

  • @manzoorali8776
    @manzoorali8776 9 หลายเดือนก่อน

    Thanks a lot

  • @gopikarao9175
    @gopikarao9175 ปีที่แล้ว

    Thank you so much for the clear explanation. I was scratching my head with this for the past few hours and this very helped me to resolve the issues.

  • @apekshaborkar9090
    @apekshaborkar9090 ปีที่แล้ว

    What should do if there is only one record type present?

  • @IanCosgrove-z2z
    @IanCosgrove-z2z ปีที่แล้ว

    A million thank you's for helping solve my problem 🙏

  • @TalhaNadeem
    @TalhaNadeem ปีที่แล้ว

    Thanks for the help 😍

  • @oussamaboumhaout3619
    @oussamaboumhaout3619 ปีที่แล้ว

    Thank you, very helpful

  • @alexpc281
    @alexpc281 ปีที่แล้ว

    thank you so much

  • @srinivaspatil411
    @srinivaspatil411 ปีที่แล้ว

    Nice mam 💥

  • @sanketkuthe276
    @sanketkuthe276 ปีที่แล้ว

    But i need to none default record for that what will do?

  • @ShubhamSaini-pr9zr
    @ShubhamSaini-pr9zr ปีที่แล้ว

    thank you so much .

  • @crazyvlogs2366
    @crazyvlogs2366 ปีที่แล้ว

    Why do we need to fetch the deleted contacts here

  • @nikhilPUD01
    @nikhilPUD01 ปีที่แล้ว

    is trigger is most important to be a good SF developer?

  • @sudeep153
    @sudeep153 ปีที่แล้ว

    Contact's accountid should be mapped with account id also.

  • @abhijitjakate2352
    @abhijitjakate2352 ปีที่แล้ว

    Thank You !!!! It's really worked...Problem Solved.👍👍

  • @satishbangaram
    @satishbangaram ปีที่แล้ว

    Thank you for this video

  • @ayeshahowla9041
    @ayeshahowla9041 2 ปีที่แล้ว

    thanks much....

  • @justanime7912
    @justanime7912 2 ปีที่แล้ว

    This works Thanks for your help

  • @peterphasha863
    @peterphasha863 2 ปีที่แล้ว

    Super Helpful, thank you

  • @jamesturner672
    @jamesturner672 2 ปีที่แล้ว

    Thank you! This was so helpful! Problem solved.

  • @shahrukhkhan-ub5to
    @shahrukhkhan-ub5to 2 ปีที่แล้ว

    What if we edit the contact and chage its parent account to another account then what happen in count?it is still remains same or get decrease???

  • @arun6479
    @arun6479 2 ปีที่แล้ว

    Hello! explanation was absolutely great 👍 thank you... Could you please be little better louder ...

  • @amitbagade3277
    @amitbagade3277 2 ปีที่แล้ว

    After searching from hrs and hrs finally found solution. Thnks . Best video.

  • @Ohgituyahmm
    @Ohgituyahmm 2 ปีที่แล้ว

    ❤️

  • @tejasri4235
    @tejasri4235 2 ปีที่แล้ว

    Your voice is very nice

  • @Feel-2-Heal-Minds
    @Feel-2-Heal-Minds 2 ปีที่แล้ว

    This trigger not run in my org.

  • @Cyrus_Michael
    @Cyrus_Michael 2 ปีที่แล้ว

    You helped me a lot because with your video I solved a similar problem that I had at my internship. Thanks. May God Bless You

  • @hariharannatarajan7208
    @hariharannatarajan7208 2 ปีที่แล้ว

    Do you think it will work ?you didnt include the condition to check whether the address field has updated

    • @sudeep153
      @sudeep153 ปีที่แล้ว

      Yes i was also thinking about the same

  • @tanmaydeshpande2458
    @tanmaydeshpande2458 2 ปีที่แล้ว

    I think this can be done in a single for loop using Trigger.newMap -> Query all contacts where AccountId in Trigger.newMap.keySet() -> iterate on contacts { get the account sobject using contact.AccountId and trigger.newMap -> update the contact address info -> add contact to a list -> update DML after the loop. Also instead of hardcoding fields like MailingAddress and BillingAddress we can also a custom metadata type or custom setting to save the account to contact mapping so that in future if there are more fields to map we don't have to update the trigger every time. Hope this helps! thanks! Sample Code - trigger AccountTrigger on Account(after update){ try{ List<Sobject> listToUpdate = new List<Sobject>(); Map<Id,Account> accountMap = trigger.newMap; List<Contact> relatedContactList = [SELECT Id,AccountId From Contact WHERE AccountId in :accountMap.keySet()); List<AccountContactMapping__mdt> accountContactMappingList = getAccountContactMapping(); for(Contact relatedContact : relatedContactList){ Id accountId = relatedContact.AccountId; Account acc = accountMap.get(accountId); if(acc != null){ for(AccountContactMapping__mdt accConMapping : accountContactMappingList){ String accountFieldApiName = accConMapping.AccountFieldApiName__c; String contactFieldApiName = accConMapping.ContactFieldApiName__c; con.put(contactFieldApiName,account.get(accountFieldApiName)); } listToUpdate.add(con); } } if(!listToUpdate.isEmpty()){ update listToUpdate; } }catch (Exception e){ System.debug('e.getMessage()------>>>'+e.getMessage()); System.debug('e.getStackTraceString()------>>>'+e.getStackTraceString()); //Make an entry to an object called ErrorLog__c //Logger.logException('AccountTrigger','updateRelatedContacts',e.getMessage(),e.getStackTraceString(),System.now(),userInfo.getUserId()); } } static List<AccountContactMapping__mdt> getAccountContactMapping(){ if(!Test.isRunningTest()){ return AccountContactMapping__mdt.getAll().values(); }else{ return List<AccountContactMapping__mdt>{new AccountContactMapping__mdt(AccountFieldApiName__c='Billing Address',ContactFieldApiName__c='BillingAddress')} } }

  • @vishaladane8153
    @vishaladane8153 2 ปีที่แล้ว

    great

  • @pavankagitha2665
    @pavankagitha2665 2 ปีที่แล้ว

    for loop inside for loop is not the best practise, instead better to use map: map<id,account> accdata=new map<id,account>(); list<contact> tobeupdated=new list<contact>(); for(account acc: trigger.new) { if(acc.address!=trigger.newmap.get(acc.id).address) { accdata.put(acc.id,acc); } } for(contact con:[select id,name,address from contact where accountid in:accdata.keySet()]) { contact conobj=new contact(); if(accdata.containskey(con.accountid)) { conobj.id=con.id; conobj.address=accdata.get(con.accountid).address; tobeupdated.add(conobj); } } if(!tobeupdated.isEmpty()) { update tobeupdated; }

  • @chithraprakash8392
    @chithraprakash8392 2 ปีที่แล้ว

    Thank you for such an amazing video

  • @chithraprakash8392
    @chithraprakash8392 2 ปีที่แล้ว

    Great video

  • @chithraprakash8392
    @chithraprakash8392 2 ปีที่แล้ว

    Thank you for sharing this very nice video. Can you upload more videos on trigger for different scenarios

  • @chithraprakash8392
    @chithraprakash8392 2 ปีที่แล้ว

    Can you upload more videos on trigger for different scenarios

  • @chithraprakash8392
    @chithraprakash8392 2 ปีที่แล้ว

    Thank you for a very useful video

  • @surajkokare3383
    @surajkokare3383 2 ปีที่แล้ว

    your videos are so good but your voice is not clear.... please do something about it.

  • @saralapanda2201
    @saralapanda2201 2 ปีที่แล้ว

    Expecting '}' but was: '<EOF>' getting this error in insert line

  • @burthug
    @burthug 2 ปีที่แล้ว

    Thanks for the video instructions. This is exactly what I need to add to Account records. However, Count field doesn't update for existing Account records unless I delete or add new contacts. How can I push this trigger for all accounts so that existing account records get the contact count?

  • @aniketzade5046
    @aniketzade5046 2 ปีที่แล้ว

    can you please provide test class for this

  • @kartheeksreddy7116
    @kartheeksreddy7116 2 ปีที่แล้ว

    Hi ua trigger is working fine but writing for loop inside the for loop is not a best practice right

    • @dharmendrayadav-cn2fi
      @dharmendrayadav-cn2fi 2 ปีที่แล้ว

      Yes, for look inside for loop cause recursion in trigger

  • @srisadgurusairam1688
    @srisadgurusairam1688 2 ปีที่แล้ว

    How to write test class for this trigger?

  • @krishnamacharlawar2432
    @krishnamacharlawar2432 2 ปีที่แล้ว

    Nice scenario, please keep providing such examples but need some more explanation like how the flow of a program is going. Thank you.

  • @sevdadalklc8410
    @sevdadalklc8410 2 ปีที่แล้ว

    In line4 if we use Set for IDs it will be better instead of List

  • @hrishikeshsure6751
    @hrishikeshsure6751 2 ปีที่แล้ว

    Thank you mam. Nicely explained in such short time

  • @rohitpathak941
    @rohitpathak941 2 ปีที่แล้ว

    please help. insert 500 account records with related contacts apex program

  • @tusharsuyawanshi843
    @tusharsuyawanshi843 2 ปีที่แล้ว

    Please, do count trigger on parent to child.