{{.Self}} use

Discussions related to ReadyDoc development.
Post Reply
cklahr
Posts: 71
Joined: Tue Oct 27, 2009 3:32 am

{{.Self}} use

Post by cklahr »

Hi,

Where is the {{.Self}} field located? and what purpose does it serve? I noticed it on documents and am wondering how I can identify or utilize it.

Thank you so much!
vmrvichin
Posts: 27
Joined: Thu Jul 22, 2021 11:50 am

Re: {{.Self}} use

Post by vmrvichin »

{{.Self}} references the type being generated. For example if you have a readybloc holding exceptions that could apply to a number of documents (policies commitments) the {{.Self}} field can be used to test the type <IF ({{.Self}}="Commitment")> and only apply that exception if the document type is a Commitment.

It can also be used as a sort of 'where am I check' at any point in the document, such as within a for loop it can tell you what field/multiple you are on in there.
Vlad Mrvichin, Senior Software Developer, Custom Dev, SoftPro
cklahr
Posts: 71
Joined: Tue Oct 27, 2009 3:32 am

Re: {{.Self}} use

Post by cklahr »

Thank you so much for the explanation!
Post Reply