Goals
Xplan coding to xmerge out everything from the standard Xplan goals element:
Setec Astronomy
<:for item in $client.goals:>
Goal Owner: <:=item.owner:>
Goal Description: <:=item.description:>
<:end:>
Goal Group Fields
All the fields below can be used in the loop above:
Field |
Type |
Syntax |
---|---|---|
Owner | Choice | <:=item.owner:> |
Status | Choice | <:=item.status:> |
Objective | Choice | <:=item.objective:> |
Advice Type | Choice | <:=item.advice_type:> |
Category | Choice | <:=item.category:> |
Description | String | <:=item.description:> |
Supplementary |   |   |
Scaled Advice Flag | Bool | <:=item.scaled_advice_goal:> |
Timeframe | Choice | <:=item.term_timeframe:> |
Capture Date | Date | <:=item.capture_date:> |
Target Date | Date | <:=item.target_date:> |
Target Amount | Multicurrency | <:=item.target_amount:> |
Target Type | Choice | <:=item.target_type:> |
Target Timeframe Type | Choice | <:=item.target_timeframe_type:> |
Funding Type | Choice | <:=item.funding_type:> |
Goal Level Risk Profile | Choice | <:=item.goal_level_risk_tolerance:> |
Regular Savings |   |   |
Initial Investment | Multicurrency | <:=item.initial_investment:> |
Regular Savings | Multicurrency | <:=item.regular_saving:> |
Regular Savings Frequency | Choice | <:=item.frequency:> |
Saving Start Date | Date | <:=item.saving_start_date:> |
Saving End Date | Date | <:=item.saving_end_date:> |
Regular Drawdown |   |   |
Regular Drawdown | Multicurrency | <:=item.regular_drawdown:> |
Regular Drawdown Frequency | Choice | <:=item.drawdown_frequency:> |
Drawdown Start Date | Date | <:=item.drawdown_start_date:> |
Drawdown End Date | Date | <:=item.drawdown_end_date:> |
Comments |   |   |
Comments | String | <:=item.comments:> |
Risk Profile Reason | String | <:=item.risk_profile_reason:> |
Relevance on Capital | String | <:=item.rp_reliant_on_capital:> |
Relevance on Income | String | <:=item.rp_reliant_on_income:> |
Check for Goals
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.goals):>
<:for item in $client.goals:>
Goal Description: <:=item.description:>
<:end:>
<:else:>
No Goals have been recorded
<:end:>
Filtering Goals
Use the syntax below as a guide for filtering group data like this.
In the example below we are filtering the goals down to only shown ones that are for the Client and have a status of unfulfilled:
Setec Astronomy
<:if len($client.goals.filter(‘owner=Client’).filter(‘status=2’)):>
<:for item in $client.goals.filter(‘owner=Client’).filter(‘status=2’):>
Goal Status: <:=item.status:>
Goal Description: <:=item.description:>
<:end:>
<:end:>
An alternative approach to coding that can give you some more flexibility is as follows:
Setec Astronomy
<:for item in [x for x in $client.goals if str(x.owner.text)==’Client’ and str(x.status.value) not in [‘1′,’4’]]:>
Goal Status <:=item.status:>
Goal Description: <:=item.description:>
<:end:>
Notes
But what are goals?
Goals are all the individual, measurable steps that go towards achieving an objective. Multiple goals can be linked to individual objectives.