Annual Compliance Standard Coding Patterns

Doc Auto Team
Doc Auto Team
  • Updated

In this article, we will go over the standard coding patterns and best practices when coding an annual compliance document.

To begin, please upload the attached documents to Athennian (for assistance with uploading, please refer to our help center article for details).

Create a new Annual Compliance task and generate the documents within to learn more!  Clicking the links below will download these documents to your downloads folder on your local drive.

See the table below for a broken out explanation of the coding used in the above resolutions to increase your understanding of the code and allow you to manipulate the coding to use when coding your very own documents.

See detail of coding specifics below:

Pattern Name

Code Snippets 

Code Explanation

Entity (General)

Entity Name

{entities | grab:1:'entityName'

| upper}
  • Using ‘grab’ function retrieving entityName from entities collection.
  • It is highly unlikely that an entity would have no recorded name in the database, making the use of the 'grab' function optimal in this scenario.

  • The ‘| upper’ code will make the entityName appear in the document as uppercase. Remove the ‘| upper’ if this is not the desired result.

Business Corporations Act for Canadian jurisdictions

{#(entities | grab:1:’jurisdictionRegion’)=='Nova Scotia'}Companies Act{/}{#(entities | grab:1:’jurisdictionRegion’)=='Canada (Federal)’}Canada {/}{#((entities | grab:1:’jurisdictionRegion’)=='Manitoba') || ((entities | grab:1:’jurisdictionRegion’)==’Saskatchewan’)}The {/}{#((entities | grab:1:’jurisdictionRegion’)!='Nova Scotia') && ((entities | grab:1:’jurisdictionRegion’)!='Manitoba') && ((entities | grab:1:’jurisdictionRegion’)!='Newfoundland and Labrador')}Business Corporations Act{/}{#((entities | grab:1:’jurisdictionRegion’)=='Manitoba') || ((entities | grab:1:’jurisdictionRegion’)=='Newfoundland and Labrador')}Corporations Act{/}{#(entities | grab:1:’jurisdictionRegion’)!=’Canada (Federal)’} ({entities | grab:1:’jurisdictionRegion’}){/}

Using conditional logic with comparison operators ‘==’, ‘!=’ to output correct act names. The content inside {#condition} ... {/} is executed if the condition is true, otherwise, it's skipped.

Entity waived Auditor button is not checked

{#(entities | grab:1:’waivedAuditor’)!=true}

{/}

  • Use this coding as the logic to decide whether any clauses that need to appear in the document when the waived auditor button is not checked.
  • As this initiates an 'if' statement logic opening {#}, it is essential to include a corresponding closing tag.{/}
  • It is best practice to code booleans as “not = true” (!=true) rather than “equal to false” (==false). Specifying that the boolean is equal to false is very specific and will not work if the variable is equal to blank or Null.

Entity’s Next Annual General Meeting date

____Version 1 _____

{#(entities | grab:1:’nextAGM’)!=’’}{entities | grab:1:’nextAGM’ | time:'MMMM D, YYYY'}{/}

____Version 2 _____

{entities | grab:1:’nextAGM’ | time:'MMMM D, YYYY'}

____Version 3_____

the shareholders of the Company hereby selects{entities | grab:1:'nextAGM' | time:'_MMMM D, YYYY'} as the annual meeting date for the Company;

Version 1:

  • Using an ‘if' statement, to check if the 'Next AGM date' field for a company is not empty. If this condition is met, we then extract and format the 'Next AGM date' value from the entities 'collection’.

  • Additionally, there is a combination of code that can be utilized in conjunction with this snippet. For further details, please reference to the 'Task Annual General Meeting Date' section in this document.

Version 2:

  • Using the 'grab' function we retrieve ‘Next AGM date’ value from entity and then employ the 'time format' function to present it in the 'MMMM D, YYYY' format.

  • :warning: When utilizing the 'grab' function, it may result in an empty space if it returns an empty string. To prevent this, it's advisable to enclose the code within an 'if' statement (as shown in Version 1). Alternatively, you can use it in conjunction with the '||' function to ensure that one of the statements between the 'OR' functions returns a value, thus avoiding empty spaces.

Version 3:

  • If you choose not to use the 'OR' function or enclose the code within an 'if' statement, an alternative workaround to avoid empty spaces is to merge the opening curly bracket with the last character of the preceding text, while still maintaining an empty space in the formatting.

Entity Fiscal Year End date - Year Only

{#(entities | grab:1:’fiscalYearEnd’)!=’’}{entities | grab:1:’fiscalYearEnd’ | time:’YYYY’}{/}

  • Prints entity’s Fiscal Year End date in YYYY format.

  • :warning: This code may result in an empty space if it returns an empty string. However, please refer to the code explanation for potential workaround for “Entity’s Next Annual General Meeting date”.

Entity Fiscal Year End date - Month and Year

{entities | grab:1:’fiscalYearEnd’ | time:’MM YYYY’}

  • Prints entity’s Fiscal Year End date in MM YYYY format.

  • :warning: This code may result in an empty space if it returns an empty string. However, please refer to the code explanation for potential workaround for “Entity’s Next Annual General Meeting date”.

Directors

Plural Directors

{#(RES_affiliations) || (affiliations | status:’!inactive’) | filter:’role’:’Director’ | uniqBy:’participant_profileID’ | except:(tasks | grab:1:‘outgoingAffiliations’):’affiliationID’ | count | gt:1}All of the Directors{/}

This code is a powerful tool for managing affiliations and tasks in a specific context:

  • It filters out only the active records with the role of Director from either the RES_affiliations or affiliations collections.

  • Next uses the ‘uniqBy’ function to obtain distinct records based on the 'participant_profileID'.

  • It then applies the ‘except’ operator to remove any selected outgoing records (Directors) from the tasks collection, effectively excluding directors from those records

  • Finally, it employs the 'count' function to ascertain whether at least one director is being pulled in this expression.

Singular Director

{#(RES_affiliations) || (affiliations | status:’!inactive’) | filter:’role’:’Director’ | uniqBy:’participant_profileID’ | except:(tasks | grab:1:‘outgoingAffiliations’):’affiliationID’ | count | lt:2}Sole Director{/}

This code outputs the text ‘Sole Director’ when there are fewer than two Director records being accessed.

List of all Active Directors' Full Name(s)

{#(RES_affiliations) || (affiliations | status:’!inactive’) | filter:’role’:’Director’ | uniqBy:'participant_profileID' | except:(tasks | grab:1:‘outgoingAffiliations’):’affiliationID’}{participant_fullName}

{/}

Retrieve the full names of currently active directors as a list format, excluding those selected as outgoing in the task.

Officers

Active Officers List(Not Grouped, Ordered by Rank)

{#RES_affiliations || (affiliations | status:’!inactive’) | filter:’role’:’Officer’ | uniqBy:’participant_profileID’ | except:(tasks | grab:1:‘outgoingAffiliations’):’affiliationID’ | orderBy_B:'rank'}

{participant_fullName} {#(title!=type)&&(type!=’Other’)}{type} – {title}{/}{#type==’Other’}{title}{/}{#title==type}{type}{/}

{/}

The logical if statement:

  • It filters out only the active records with the role of Officer from either the RES_affiliations or affiliations collections.

  • Next uses the ‘uniqBy’ function to obtain distinct records based on the 'participant_profileID'.

  • It then applies the ‘except’ operator to remove any selected outgoing records (Directors) from the tasks collection, effectively excluding directors from those records

  • Finally, it utilizes the 'sort' (orderBy_B) function to ensure that all officers being output are sorted by their rank in their respective office titles.

Handling Custom Officer Types and Custom Titles

{#…}

{#(title!=type)&&(type!=’Other’)}{type} – {title}{/}{#type==’Other’}{title}{/}{#title==type}{type}{/}

{/}

Output Context When the Logical 'If' Statement Returns Officer Records:

  • If an officer record uses one of the predefined 'Office Roles' from the standard pick list, but the 'Custom Title' field for the officer contains custom data, it results in the variable {title} being replaced by the custom data. This means that the {type} and {title} variables are no longer identical.

  • Additionally, there is an option to select "Other" in the Officer Role field when the standard pick list does not include the desired office title. In such cases, it is recommended to choose "Other" from the list and enter custom data in the "Custom Title" field. Here, the variable {type} stores "Other", and we simply need to print the value from the {title} variable.

  • The final statement is straightforward: only retrieve the value of the {type} variable when both variables are identical.

Active Officers (grouped)

{#(RES_affiliations) || (affiliations | status:'!inactive') | filter:’role’:’Officer’ | except:(tasks | grab:1:’outgoingAffiliations’):'affiliationID' | orderBy_B:’rank' | groupBy:’participant_profileID’}{group | grab:1:’participant_fullName’}

{group | toSentence:’title’}{/}

In this code, an additional operation we employ is the 'groupBy' function. This function is to segment all the officers retrieved in the expression. The benefit of using 'groupBy' here is to avoid duplicating each office occurrence for an individual officer. This means a person can hold multiple office titles, and with 'groupBy', we can print the values from each group without redundancy.

If you'd like to delve deeper into the 'groupBy' operator, you can refer to the post on the difference between UniqBy and GroupBy."

Singular Officer

{#tasks | grab:1:’incomingAffiliations’ | filter:’role’:’Officer’ | count | equal:1}{tasks | grab:1:’incomingAffiliations’ | filter:’role’:’Officer’ | grab:1:’participant_fullName’}

{tasks | grab:1:’incomingAffiliations’ | filter:’role’:’Officer’ | toSentence:’title’}{/}

This code prints an officer’s full name and title from the incoming affiliations that are selected in the task.

:warning: Please refer to “Handling Custom Officer Types and Custom Titles” code snippet to cover more case scenarios. Using Assignment method is always recommended to improve the code readability and re-usability. If you'd like to delve deeper into the Assignment function, you can refer to this link."

Registered Office

Registered Office Address

{(RES_affiliations) || (affiliations | status:'confirmed') | filter:’title’:’Registered Office’ | grab:1:’addresses’ | filter:’addressStatus’:’!inactive’:'!outgoing' | grab:1:’address’}

  • The code's purpose is to print the 'active' address information for a confirmed Registered Office record. Assuming there is only one Registered Office address in an entity, the code can be modified by adding more filters or functions.

  • This code can also be wrapped by logical if statement(s).

  • Address information is being pulled from the {address} single variable that contains static string data. There are more address components that can construct this variable allowing you to be creative by accessing the {components} sub-collection within the addresses collection.

Auditor

Auditor's name

{#(RES_affiliations) || (affiliations | status:'!inactive') | filter:’role’:'Other Professional' | filter:'type':'Auditor' | count | gt:0}{(RES_affiliations) || (affiliations | status:'!inactive' ) | filter:’role’:'Other Professional' | filter:'type':'Auditor' | grab:1:’participant_fullName’}{/}{#(RES_affiliations) || (affiliations | status:'!inactive') | filter:’role’:'Other Professional' | filter:'type':'Auditor' count | lt:1}_____________________{/}

  • If there is an auditor, insert the first active auditor’s name. Otherwise, leave a blank line.

  • Alternatively, you can employ it in combination with the 'OR' functions to capture the code represented by ('______') as the default when the first statement doesn't meet the criteria.

Active Auditor Count

{#(RES_affiliations || affiliations | status:'!inactive' ) | filter:’role’:'Other Professional' | filter:'type':'Auditor' | count | gt:0}

{/}

  • This statement is used to validate whether there is at least one auditor.

  • As this initiates an 'if' statement logic opening {#}, it is essential to include a corresponding closing tag.{/}

{#(RES_affiliations) || (affiliations | status:'!inactive') | filter:’role’:'Other Professional' | filter:'type':'Auditor' count | lt:1}

{/}

  • This statement is used to validate whether there are NO auditors at all.

  • As this initiates an 'if' statement logic opening {#}, it is essential to include a corresponding closing tag.{/}

Accountants

Accountants Name

{#(RES_affiliations || affiliations | status:'!inactive') | filter:’role’:'Other Professional' | filter:'type':'Accountant' | count | gt:0}{(RES_affiliations || affiliations | status:'!inactive') | filter:’role’:'Other Professional' | filter:'type':'Accountant' | grab:1:’participant_fullName’}{/}

  • This code pulls an Accountant name when there is at least one Accountant record in an entity.

  • Can be simplified by using Assignment or even an alternative workaround by enclosing it in an if statement.

  • Please refer to Tasks section - ‘Entity’s Next Annual General Meeting date’ code explanation as a potential workaround.

Shareholders

Plural Shareholders

{#(RES_shareholdings || shareholdings) | filter:'totalShares':'!0' | uniqBy:'participantID' | count | gt:1}All Shareholders{/}

  • This code accesses two collections: RES_shareholdings and shareholdings.

  • It filters out records where the ‘totalShares’ is not equal to zero, making sure that the shareholder is active and holds share(s) in the entity.

  • Also ensures that each shareholder is unique by its id number ‘participantID’.

  • Then it counts the number of unique records available.

  • Finally if the count is greater than one, it outputs the text "All Shareholders".

Singular Shareholder

{#(RES_shareholdings || shareholdings) | filter:'totalShares':'!0' | uniqBy:'participantID' | count | lt:2}Sole Shareholder{/}

  • This code accesses two collections: RES_shareholdings and shareholdings.

  • It filters out records where the ‘totalShares’ is not equal to zero, making sure that the shareholder is active and holds share(s) in the entity.

  • Also ensures that each shareholder is unique by its id number ‘participantID’.

  • Then it counts the number of unique records available.

  • Finally if the count is less than 2 (basically 1 or none), it outputs the text "Sole Shareholder".

Non-Voting Shareholder Pluralization

{#(RES_shareholdings|| shareholdings) | filter:'shares':'!0' | filter:’votes’:’0’ | uniqBy:'participantID' | count | gt:1}All of the Non-Voting Shareholders{/}

  • This code accesses two collections: RES_shareholdings and shareholdings.

  • It filters out records where the ‘shares’ is NOT equal to zero, making sure that a shareholder is active and holds share(s) in the class.

  • Next it filters out records where the ‘votes’ IS equal to zero, basically retrieving all shareholders that have NO voting rights.

  • It ensures that each shareholder is unique by its id number ‘participantID’.

  • Then it counts the number of unique records available.

  • Finally, if the count is greater than 1, it outputs the text “All of the Non-Voting Shareholders”.

Voting Shareholder Pluralization

{#(RES_shareholdings|| shareholdings) | filter:'shares':'!0' | filter:’votes’:’!0’ | uniqBy:'participantID' | count | gt:1}All of the Voting Shareholders{/}

  • This code accesses two collections: RES_shareholdings and shareholdings.

  • It filters out records where the ‘shares’ is NOT equal to zero, making sure that a shareholder is active and holds share(s) in the class.

  • Next it filters out records where the ‘votes’ is NOT equal to zero, basically retrieving all shareholders that HAVE voting rights.

  • Ensures that each shareholder is unique by its id number ‘participantID’.

  • Then it counts the number of unique records available.

  • Finally if the count is greater than 1, it outputs the text “All of the Voting Shareholders”.

Tasks

Resolution Date

{tasks | grab:1:’resolutionDate’ | time:’MMMM D, YYYY’}{#(tasks | grab:1:’resolutionDate’)==’’}_____________________{/}

________Version 2_______

{(tasks | grab:1:’resolutionDate’ | time:’MMMM D, YYYY’) || ('_____________________')}

  • If the resolution date is not completed in the task, leave a blank.

  • In Version 2, we can use || (OR) function and ('__') to pull the Resolution Date from the task if the date is recorded, OR print an underline or any text when the 1st parameter returns with no value.

Task Annual General Meeting Date

_______Version 1________

{#(entities | grab:1:’nextAGM’)!=’’}{entities | grab:1:’nextAGM’ | time:'MMMM D, YYYY'}{/}{#(entities | grab:1:’nextAGM’)==’’}{#tasks}{(agmDate || effectiveDate) | time:’MMMM D, YYYY’}{/}{/}{#((tasks | grab:1:’agmDate’)==’’)&&((tasks | grab:1:’effectiveDate’)==’’)}__________________{/}

________Version 2_______

{((entities | grab:1:’nextAGM’) || (tasks | grab:1:'agmDate') || (tasks | grab:1:'effectiveDate') | time:’MMMM D, YYYY’) || (‘____________________’)}

Version 1:

  • Dates the Annual General Meeting of the Shareholders will be held. If the next AGM date is blank AND the AGM date is blank AND the effective date is blank, then you will get a blank line.

Version 2:

  • Alternatively, you can use it in conjunction with the ‘OR’ functions to ensure that one of the statements between the 'OR' functions returns a value, thus avoiding empty spaces.

  • If none of the dates are available, it will present '______' as the default value derived from the final statement in the OR function.

Resigned Director Count

{#tasks | grab:1:’outgoingAffiliations’ | filter:’role’:’Director’ | filter:’endReason’:’Resigned’ | count | gt:0}

{/}

  • This is logic that will trigger if there is a director that has resigned and that director has been added to the outgoing affiliations section of the task.

  • Remember to set the End Reason field as ‘Resigned’ for a principal who is resigning in order for this code to work.

Resigned Directors Full Name(s)

{tasks | grab:1:’outgoingAffiliations’ | filter:’role’:’Director’ | filter:’endReason’:’Resigned’ | toSentence:’participant_fullName’}

This will list all the names of the resigning directors in the document (using toSentence will separate the names with commas and the word "and" before the last iteration).

Removed Director Count

{#tasks | grab:1:’outgoingAffiliations’ | filter:’role’:’Director’ | filter:’endReason’:’Removed’ | count | gt:0}

{/}

  • This is logic that will trigger if there is a director that has been removed and that director has been added to the outgoing affiliations section of the task.

  • Remember to set the End Reason field as ‘Removed’ for a principal who is being removed in order for this code to work.

Removed Directors Full Name(s)

{tasks | grab:1:’outgoingAffiliations’ | filter:’role’:’Director’ | filter:’endReason’:’Removed’ | toSentence:’participant_fullName’}

This will list all the names of the removed directors in the document (using toSentence will separate the names with commas and the word "and" before the last iteration)

Newly Elected Directors Full Name(s)

{tasks | grab:1:’incomingAffiliations’ | filter:’role’:’Director’ | toSentence:’participant_fullName’}

This will list all the names of the incoming directors in the document (using toSentence will separate the names with commas and the word “and” before the last iteration).

Newly Elected Directors Start Date

{tasks | grab:1:’incomingAffiliations’ | filter:’role’:’Director’ | grab:1:’startDate’ | time:’MMMM D, YYYY’}

This will grab the start date of the incoming directors.

Resigned Officer Count

{#tasks | grab:1:’outgoingAffiliations’ | filter:’role’:’Officer’ | filter:’endReason’:’Resigned’ | count | gt:0}

{/}

This is logic that will trigger if there is an officer that has resigned and that officer has been added to the outgoing affiliations section of the task.

Resignation of a Single Officer Name and Title(s)

{#tasks | grab:1:’outgoingAffiliations’ | filter:’role’:’Officer’ | filter:’endReason’:’Resigned’ | count | equal:1}{tasks | grab:1:’outgoingAffiliations’ | filter:’role’:’Officer’ | filter:’endReason’:’Resigned’ | grab:1:’participant_fullName’} has resigned as {tasks | grab:1:’outgoingAffiliations’ | filter:’role’:’Officer’ | filter:’endReason’:’Resigned’ | toSentence:’title’}{/}

This is used if you have different wording for a single officer versus multiple officers resigning in your document.

Resignation of Multiple Officers Names, Titles and End Dates

{#tasks | grab:1:’outgoingAffiliations’ | filter:’role’:’Officer’ | filter:’endReason’:’Resigned’ | groupBy:’participant_profileID’}{group | grab:1:’participant_fullName’} as {group | toSentence:’title’}{/} as of the Corporation, effective {tasks | grab:1:’outgoingAffiliations’ | filter:’role’:’Officer’ | filter:’endReason’:’Resigned’ | grab:1:’endDate’ | time:’MMMM D, YYYY’}{/}

  • This coding will list all the officers who have resigned. It will list their full name and then all the titles they are resigning from. Also included is the end date.

  • In this code, an additional operation we employed is the 'groupBy' function. This function is to segment all the officers retrieved in the expression. The benefit of using 'groupBy' here is to avoid duplicating each office occurrence for an individual officer. This means a person can hold multiple office titles, and with 'groupBy', we can print the values from each group without redundancy. If you'd like to delve deeper into the 'groupBy' operator, you can refer to this link."

Single Incoming Officer Name and Title(s)

{tasks | grab:1:’incomingAffiliations’ | filter:’role’:’Officer’ | grab:1:’participant_fullName’} is appointed {tasks | grab:1:’incomingAffiliations’ | filter:’role’:’Officer’ | toSentence:’title’}

This coding will list all incoming officers. It will list their full name and then all the titles they are appointed to.

 

 

Related to