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