Objectives
Xmerge everything from the standard objective group in Xplan:
Setec Astronomy
<:for item in $client.objectives:>
Category: <:=item.category:>
Description: <:=item.description:>
<:end:>
Objective Group Fields
All the fields below can be used in the loop above:
Field |
Path |
Syntax |
---|---|---|
Owner | owner | <:=item.owner:> |
Description | description | <:=item.description:> |
Category | category | <:=item.category:> |
Status | status | <:=item.status:> |
Priority | priority | <:=item.priority:> |
Advice Type | advice_type | <:=item.advice_type:> |
Advice Scope | advice_scope | <:=item.advice_scope:> |
Capture Date | capture_date | <:=item.capture_date:> |
Targets |   |   |
Time Frame (Years) | time_frame_yrs | <:=item.time_frame_yrs:> |
Time Frame (months) | time_frame_mths | <:=item.time_frame_mths:> |
Target Amount | target_amount | <:=item.target_amount:> |
Target Age | target_age | <:=item.target_age:> |
Partner Target Age | partner_target_age | <:=item.partner_target_age:> |
Objective Level Risk Profile | objective_level_risk_tolerance | <:=item.objective_level_risk_tolerance:> |
Other |   |   |
Adviser Identified Need(AIN) | adviser_identified | <:=item.adviser_identified:> |
Comments | comment | <:=item.comment:> |
Consequences Explained | consequences_explained | <:=item.consequences_explained:> |
Adviser Comments | adviser_comments | <:=item.adviser_comments:> |
Other Considerations | other_considerations | <:=item.other_considerations:> |
Check for Objectives
The len() function is a simple method to check if any records exist and if none are found you can use the else to display other information or content as needed:
Setec Astronomy
<:if len($client.objectives):>
<:for item in $client.objectives:>
Description: <:=item.description:>
<:end:>
<:else:>
No objectives recorded
<:end:>
Filtering Objectives
Use the syntax below as a guide for filtering group data like this.
In the example below we are filtering the objectives down to open (status 1) retirement (category 5) objectives for the client only (owner):
Setec Astronomy
<:if len($client.objectives.filter(‘category=5’).filter(‘owner=Client’).filter(‘status=1’)):>
<:for item in $client.objectives.filter(‘category=5’).filter(‘owner=Client’).filter(‘status=1’):>
Category: <:=item.category:>
Description: <:=item.description:>
<:end:>
<:end:>
Alternative approach
A different approach that allows for a lot more flexibility when dealing with multiple conditions is shown below. You will note that code can also be more human friendly – instead of relying on knowing that status 1 = open we can easily write that as part of the filtering:
Setec Astronomy
<:for item in [x for x in $client.objectives if str(x.category.text)==’Retirement’ and str(x.status.text) == ‘Open’]:>
Description: <:=item.description:>
<:end:>
Notes
But what are objectives?
Objectives are the overarching aspirational sum of what the client is trying to achieve, for example a retirement objective might be “retire comfortably by 70”.