Skip to main content
Create two field on Account: 1 - Amount X (Number), 2 - Amount Y (Number).

Create a two fields on Contact: 1 - Amount Type (Picklist: Amount X, Amount Y), 2 - Amount (Number)

You have to rollup amount in the correct field on account record and it depends on the Amount Type field on Contact.

I also need to bulkify this code.
8 respuestas
  1. 28 nov 2019, 11:02
    Hi Nabeel,

    Please modify the lines I gave you with this code - 

     

    if(acct.AmountX__c == Null) {

        acct.AmountX__c = 0;

    }

    if(acct.AmountY__c == Null) {

        acct.AmountY__c = 0;

    }

    I hope you find the above solution helpful. If it does, please mark as Best Answer to help others too.

    Thanks and Regards,

    Ajay Dubedi

    www.ajaydubedi.com