HTML ReadyDoc loop index

Discussions related to ReadyDoc development.
Post Reply
kkirkfield
Posts: 27
Joined: Tue Jun 28, 2016 2:26 pm

HTML ReadyDoc loop index

Post by kkirkfield »

In my ReadyDoc I'm looping over a collection using a section. I'm then using IronPython to store and increment the index that I use in the doc.

Code: Select all

{{# .Root.Buyers}}
    {{& GetBuyerIndex}}]
    {{& IncrementBuyerIndex}}
{{/}}
Is there a better way to do this, possibly using some built-in function or construct? Handlebars syntax mentions {{@index}} but that doesn't seem to work.
brandon.ritchie
Posts: 7
Joined: Fri Jan 06, 2017 9:50 am
Contact:

Re: HTML ReadyDoc loop index

Post by brandon.ritchie »

{{# .Buyers.Count}} will give you how many buyers are on an order. Also for buyer or any contacts you can use the {{.Code}} to know which one it is. For buyers the 1st code is B, then B2, B3 and so one. It would depend on what you are trying to do with this index to know if you need to track that in python or not.
Brandon Ritchie
Reports Technical Team Lead
SoftPro
Post Reply