Method Community


Multi-Tenancy Accounts - Reports

Last post 12-20-2016 4:24 PM by Method_Ben. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 12-08-2016 11:13 AM

    Multi-Tenancy Accounts - Reports

    I have a question for you regarding the multi-tenancy accounts

    We have a multi-tenancy account set up for our Method. Our USA office runs as the "parent" account and our European office as the "child" account. Under our Sales Order screen we've set up buttons that will print off our customer's Order Acknowledgment, Pick List and Packing Slip reports.  


    The issue I'm having is that for each report it's customized based off of whether it’s for our USA office or our European office (for example, the USA reports are in USD and have our USA location on the header… whereas our European office is in Euros and has our European location on the header). When I set a USA report to one of the buttons under the "parent" (USA) account's Sales Order screen… it then sets it to the "child" (European) account's Sales Order screen too and vice versa. It’s not able to allow me to have different reports for the two different accounts. Is there anyway around this? 

    The multi-tenancy account works perfectly for our needs... the only issue I'm having is the reporting.


    Please let me know if you have any questions.



  • 12-20-2016 4:24 PM In reply to

    Re: Multi-Tenancy Accounts - Reports

    Hi Justin,

    We discussed this one offline - but for the reference of anyone else curious how to get this working;

    This is happening because the account is Multi-Tenancy, and the report generation actions aren't accommodating for that. Multi Tenancy only logically separates data by using a 'Tenant ID' field on every record, All the data for all tenants is ultimately still in the same database.

    So when you create an action (in this scenario, the 'Generate Report'), and the action is retrieving the 'First' result, its going to grab the preference setting for that record with TenantId '1' (which is the Parent account)
    The Fix for this is fairly straightforward - and there a few ways to approach it;
    Firstly (and easiest) - Nesting the generate report action within a Conditional Statement (ie - IF Tenant ID = 1 (Parent Tenant) Then Generate Report xyz) . Utilizing this method however will require you to customize the screen any time the name of the report changes, or you add new tenants.

    A slightly more complicated way (but more scalable) - would be to add a 'Default Preferences' entry your account, and have this value retreived before generating the report.

    The Report preferences screen is called CRM_PreferencesReports - and is based off the PreferencesMethod Table. On this Table - there are fields appropriately named things like DefaultTemplatePurchaseOrder which contains the default report preferences for different transactions.
    These Fields are all linked fields to the ReportName Field of the ReportMethod Table.
    Basically you will need to 
    - Add fields to the PreferencesMethod Table - These Fields will be DropDown Fields (Linked specifically to ReportMethod.ReportName)
    - Add these fields to the CRM_PreferencesReports screen
    - on the Screen Generating the reports - Add a 'Retrieve Value from table' action before the Generate Report - and have this retreive the relevant Preferences Entry based on TenantID.

    Ben Hargreaves
    Senior Support Specialist
    Toll Free: 1.888.925.6238
    Local & Overseas: 416.847.0400
    Fax: 416.640.6027
Page 1 of 1 (2 items)