Skip to main content
Abdullah Abdullah (Anonymous) a posé une question dans #Formulas

I have a formula field ,i want to prevent the update of this field based on the fields used in the formula.

eg: if formula field  , FF__c = X__c - Y__c

 

if X__c or Y__c changed the formula field shouldn't change ,after the field get value for the first time.

1 réponse
  1. 5 déc. 2022, 08:18

    Hi Abdullah,

     

    You won't be able to do it with a formula field.

    You would need a number field that you would populate through a record triggered flow.

    Your entry criteria could be:

    Number field - Is null - $GlobalConstant.False

    AND

    X -  Is null - $GlobalConstant.False

    AND

    Y - Is null - $GlobalConstant.False

     

    Make sure it is set to fast field update

    You can now add an Update records elment to update the trigeering record and in the fields section go with:

    Number field <- "+New Resource", then xselect formula returnign a number.

    In the formula box, go with

    {!$Record.X__c}-{!$Record.Y__c}

     

    CLick on Done and you should be back in the Update Records element. Click on Done again and activate the flow.

     

    Please bear in mind that this will only work for newly created/updated records. For existing ones, you'll need to manually update the Number field (maybe with the data loader), or create a scheduled flow that would run once on the object with the same elements.