Prevent Posting to Inactive GL Account

Body
Title
Prevent Posting to Inactive GL Account
URL Name
649123877
Skip Feed
  1. Almost.

    I added a "Last Active Day" date field and used a process builder process (for both GL Account and GLAV) to populate it with the last day of the related Accounting Period so I didn't have to look through the accounting period object in my validation rules.


  2. My solution: I added a lookup to the  Accounting Period on the GL Account called "Inactive as of", and added a validation rule that requires that it be populated if active = false.  Then  on each of the above objects  I created a validation rule that checks whether the  GL Account is active  AND  whether  the end date of the Accounting period for the transaction is > than the end date of the "Inactive as of" period.

    AcctSeed__Expense_GL_Account__r.AcctSeed__Active__c =false && AcctSeed__Account_Payable__r.AcctSeed__Accounting_Period__r.AcctSeed__End_Date__c > AcctSeed__Expense_GL_Account__r.Inactive_as_of__r.AcctSeed__End_Date__c

    Edit: I've found  this approach to be problematic to use with both the GL Account and the GLAV variables.  If there is more than one GL  Account ((Like on Billing lines or SRE) just the validation rules max out the 15 object link limit. It's frustrating that the link to each separate GLAV (1-4) counts as a separate object against the limit even though it's 4 separate links to the same object.

    Expand Post

  3. My solution: I added a lookup to the  Accounting Period on the GL Account called "Inactive as of", and added a validation rule that requires that it be populated if active = false.  Then  on each of the above objects  I created a validation rule that checks whether the  GL Account is active  AND  whether  the end date of the Accounting period for the transaction is > than the end date of the "Inactive as of" period.

    AcctSeed__Expense_GL_Account__r.AcctSeed__Active__c =false && AcctSeed__Account_Payable__r.AcctSeed__Accounting_Period__r.AcctSeed__End_Date__c > AcctSeed__Expense_GL_Account__r.Inactive_as_of__r.AcctSeed__End_Date__c

End of Feed
7 Chatter Feed Items