Iterating to return contacts .ReferenceNumber value
Posted: Tue Oct 11, 2016 12:15 pm
Hi Everyone,
I am working on a regular formula and nobody seems to be able to help me. I am simply trying to get the .Name and .ReferenceNumber from the 1st contact in the file marked as the source of business. I am using the following:
Iterate {{Order.Contacts}} from 1 to #{{Order.Contacts}}
If(@.IsMarketingSource) Then
value = @.Name + " Is the marketing Source. "
value = value + "Reference #: " + {{Order.SettlementAgents[1].ReferenceNumber}}
endif
loop
Pretty simple code, except that the only way I can return the .ReferenceNumber is by actually naming the SettlementAgents[1] contact type. I do not know who the contact is or if it is [1] or [2] etc…. so I cannot figure out how to get at the .ReferenceNumber field which is not available the same as .Name is above. I thought that perhaps I needed another nested Iterate that looped the @.ContactType item but that doesn’t get me to the referencenumber either. Any Ideas?
Thanks
Dan
I am working on a regular formula and nobody seems to be able to help me. I am simply trying to get the .Name and .ReferenceNumber from the 1st contact in the file marked as the source of business. I am using the following:
Iterate {{Order.Contacts}} from 1 to #{{Order.Contacts}}
If(@.IsMarketingSource) Then
value = @.Name + " Is the marketing Source. "
value = value + "Reference #: " + {{Order.SettlementAgents[1].ReferenceNumber}}
endif
loop
Pretty simple code, except that the only way I can return the .ReferenceNumber is by actually naming the SettlementAgents[1] contact type. I do not know who the contact is or if it is [1] or [2] etc…. so I cannot figure out how to get at the .ReferenceNumber field which is not available the same as .Name is above. I thought that perhaps I needed another nested Iterate that looped the @.ContactType item but that doesn’t get me to the referencenumber either. Any Ideas?
Thanks
Dan