0

I have Formula field called "Active" with output type as Checkbox on Contracts object.

There is checkbox field on Account object and the field name "Credit Hold". This credit hold field is used to control the contract i.e, when a credit hold is checked (set to TRUE) on an account, all its related Contract records should turn inactive. Even though the End date of the contract is greater than today, we still want to make the contract inactive (we are changing the end date though).

So I setup a formula on the "Active" Field in such a way that if someone checks the credit hold checkbox on an account record, all its related Contracts will turn inactive.

In the same way, When i un-check the credit hold checkbox on the account record it should turn all the inactive contracts to active if the end date is greated than today. This part of the logic is not working with my current formula.

This is the formula i have on the Active field now:

IF(ISNULL(Project_Account__c), End_Date__c > TODAY(), 
End_Date__c > TODAY() && NOT(Project_Account__r.Credit_Hold__c))

What other condition do i have to add to make the formula work in both ways?

7
  • 1
    Can you please clarify what behavior you observe? – Adrian Larson Jun 9 '17 at 15:20
  • You run process builder on account level and can update related contract records.Any specific use case with formula field – Pavan tej Jun 9 '17 at 15:24
  • @AdrianLarson So when i un-check the credit hold field on an account record and saved it, it saved properly. After that when i open its related inactive contract, i still see it as in-active. – Avinash babu Jun 9 '17 at 15:30
  • So you want when Active field is true in parent account all its child accounts should be false like unchecked what about End date of the contract date is less than today @Avinashbabu – Pavan tej Jun 9 '17 at 15:33
  • @Pavantej Active field on contract is a formula field from the beginning. The initial logic behind the active field is: it looks for the end date and if it is greater than or equal to today then the contract is active. if not, the contract is in-active. I modified the underlying formula to make it work for the new requirement. what i want to know here is can we update a formula field using process builder? If so then i can build a process easily. – Avinash babu Jun 9 '17 at 15:37
0

As per my understanding about your requirement like if active field in account is checked related contract field needs to uncheck if contract end date >today.

Change your formula like

IF( NOT(AND(Account.Parentaccountfield = true,Datefield>=TODAY())), true, false)

Please modify as per your fields and let me know if it works for you or not

2
  • 1
    You can always replace IF(condition, false, true) with simply NOT(condition). – Adrian Larson Jun 9 '17 at 15:44
  • 1
    And you can always replace IF(condition, true, false), with condition. You should never have IF(condition, bool, bool) of any sort. – Adrian Larson Jun 9 '17 at 16:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.