First, sorry for the long post, but I've tried just about all I can think of to solve this problem and still am having no success.
I've read the manuals and searched the forum for ideas to solve this problem but haven't managed to come up with any workable solution as yet.
This is my best shot… any thoughts comments or better ideas will be a great help.
The setup:
In Squiz I have a site that displays a clients pension plan details. The site has metadata attached that holds values applied to the whole site. Eg Client name, pension type, pension plan, AMC etc. In the site I have a folder that contains a number of Data Record assets. These data record assets contain all fund data details for the pension plan. This fund information is built as a Data Record asset with a metadata attached for the fund details. Eg sedol code, mex code fund AMC etc.
The problem:
I need to display all the funds for the pension plan in a table. The table needs to show the Total AMC for each fund. The total AMC is a sum of the fund AMC and the pension plan AMC. The fund AMC is held in fund metadata %asset_metadata_Fund_AMC%. The pension plan AMC is held in the site metadata as %globals_site_metadata_Pension_AMC%
The solution so far:
The table is built with an asset listing asset. This displays a list of Data Record assets for a given folder. The page contents of the asset listing page contain the html open and close tags of the table. The type formats section contains a format type for a data record and this contains the open and close table row tags and 5 table data tags. This all works fine and I can display the fund name from the Data Record by using the variable %asset_name% and I can display the pension plan AMC by using the global variable %globals_site_metadata_Pension_AMC% and I can display the fund AMC by using the variable %asset_metadata_Fund_AMC% all in the same row.
Within one of the data tags in the data row I have nested content.
This nested content is an asset listing asset that list the assets of type Data Source Record set. The data source record set is built from a DB Data Source. The DB Data source has the following SQL to generate the record set:
select %%fundamc%% + %%pensionamc%% as totalamc from dual;
I am using an Oracle data base to sum two dynamic inputs. Fundamc and pensionamc. Using the Data Mapping in the dynamic inputs section of the DB Data Source I am mapping the data inputs to the GET variable inputs. These input values are then set via the Variable Name fields in the nested content section.
Now…
If I hard code the nested content inputs to static values I get the sum of the two static values displayed in my table row along with the other data %asset_name%, %globals_site_metadata_Pension_AMC%, %asset_metadata_Fund_AMC%
If I hard code one of the nested content inputs and set the other to a global value ie %globals_site_metadata_Pension_AMC% The site metadata for the pension plan AMC I get the sum of the static value and the global AMC displayed in my table.
However if I set one of the nested content inputs to the global value %globals_site_metadata_Pension_AMC% and the other nested content input to %asset_metadata_Fund_AMC% I do not get the sum of the two values. The problem seems to be that the %asset_metadata_Fund_AMC% value is not getting passed into the nested asset listing.
The question is how can I add the two values, one the global value %globals_site_metadata_Pension_AMC% and one the changing value per nested asset %asset_metadata_Fund_AMC% to get the sum to display in the table row?
Is my approach wrong? Is there a better way to sum two values, one being a global value and one being a value in an asset list?
Thanks for reading.

If I were you I would just use javascript. You could set your global value in a variable, and then just check each table cell that has the other value and add your variable to that.
Sounds much easier to me than trying to do it the way you described.
We’ve done something similar to what you are describing to calculate a total price of a sale with Jquery. We based the coding on this handy Calculation plugin. Where MySource ends, Jquery begins
Goodluck.
Hi Guys
Thanks for the quick replys.
Duncan Robertson: Thanks for the pointer, I'll have a look into this.
nnhubbard: Thanks for the advice. This was one of my first thoughts but the method was dismissed as the individual values would be available to the end user. Sorry I should have put that in the post, but it was getting rather long and I thought no one would read such a monologue
Thanks for your time.
Cheers
[quote]If I hard code one of the nested content inputs and set the other to a global value ie %globals_site_metadata_Pension_AMC% The site metadata for the pension plan AMC I get the sum of the static value and the global AMC displayed in my table.
However if I set one of the nested content inputs to the global value %globals_site_metadata_Pension_AMC% and the other nested content input to %asset_metadata_Fund_AMC% I do not get the sum of the two values. The problem seems to be that the %asset_metadata_Fund_AMC% value is not getting passed into the nested asset listing.
The question is how can I add the two values, one the global value %globals_site_metadata_Pension_AMC% and one the changing value per nested asset %asset_metadata_Fund_AMC% to get the sum to display in the table row?[/quote]
Thats a known issue. Currently %asset_% keywords are not being passed into nested content GET variables. Should have a resolution soon I hope.
Hi Justin
Thanks for the information. Any idea on how soon the bug fix will take as I'm developing a site currently that I'm being pushed for a deadline on?
Are we talking days, weeks or months?
Cheers.
[quote]Hi Justin
Thanks for the information. Any idea on how soon the bug fix will take as I’m developing a site currently that I’m being pushed for a deadline on?
Are we talking days, weeks or months?
Cheers.[/quote]
Hi baseman,
This seems to be described in the final paragraph of Bug 3523: %nested_asset_% keywords not working. I have re-opened this report as this issue was only partially resolved. We will have a resolution for this by the end of the week, for inclusion in our May releases of 3.20.4 and 3.22.0.
We have since assessed this report and determined that support for %asset_% keywords is a feature as it was not previously functioning, even though there seemed to be intent in doing so due to some code lines remaining.
The issue discovered when attempting the change was that the %asset_% keywords are bringing through the Nested Content Bodycopy Type as the asset, instead of the page asset under which it resides. Therefore the approach used to obtain the required functionality needs to be assessed further.
My previous post may have been premature in the assessment of this issue and for that I apologise.
The %nested_asset_*% aspect of Bug 3523 has been resolved.