Function SetupTenants

Sets up multiple tenants for use in the looping code

SetupTenants([LOOP_ID],[ID],[SOURCE],[TENANT_TYPE],[TENANCY_PERIOD],[DATE],[USE_HMO])

Parameters

#TypePassingDefaultNameDescription/Comments
1integerrequiredn/aLOOP_IDThe identifier of the looper that will be used during looping
2stringrequiredn/aIDThe identifier of the record based on SOURCE
3integeroptional1SOURCEThe source record type where 1=Property, 2=Tenancy
4integeroptional0TENANT_TYPEThe tenant type where:
0The lead or secondary tenants (not benefit agency or permitted occupier tenants)
1/2/3/4Only tenants where the tenant type matches this value
-1/-2/-3/-4Only tenants where the tenant type does not match this value
>4Includes guarantors and assumes the tenant type is the (value - 5) i.e. A tenant type of 5 will include guarantors and will run as if the tenant type was 0 when finding the tenants.
5integeroptional0TENANCY_PERIODThe tenancy period where:
0Ignore
1Tenants that are in the tenancy currently
2Tenants that are in the next tenancy
3Tenants that are in the previous tenancy

Note that this will only be applied if the [DATE] option is unset and running against a property

6datetimeoptionalnullDATEFinds tenants where the date lies within the tenancy if running against a property
7booleanoptionalfalseUSE_HMOWhether to use the hmo setting to perform the match where:
3Matches against the address
4Matches against the user field 1
5Matches against the user field 2
6Matches against the user field 3
7Matches against the user field 4
8Matches against the user field 5
9Matches against the user field 6
OtherMatches against the master property

Returns

n/a


Examples

Example to setup tenants for looping in a single tenancy

{{SetupTenants(1,ALIAS.CONCODE,2)}}

Example to setup tenants for looping in the current tenancy for the property

{{SetupTenants(1,ALIAS.PROPCODE,1,0,1)}}

Example to setup tenants for looping in the next tenancy for the property

{{SetupTenants(1,ALIAS.PROPCODE,1,0,2)}}

Notes

Ensure that this code is only added to the header and not the body as it sets up the looping before the body is processed.