I am trying to set a party as observer, with that observer argument taking from another template argument which defined as array. Please find the below snippet of my code:
template Roles
with
subscriber: Party
signeddate : Time
where
signatory subscriber
template Deal
with
deal: Users_Deal
actor : [Roles]
where
signatory deal.agent
observer actor.subscriber <--- here I am getting an error
template Users_Deal
with
dealId: Text
agent: Party
If you look at the error it will look something like this
What the compiler is trying to say here is that the type
[Roles]does not have a field calledsubscriber. This is correct.Roleshas a field but[Roles]is a list of those types.What you can do is to get the
subscriberof eachRoles(you might want to call itRoleinstead ofRoles) in the list and set all of those as observers. You can do that by callingmapon theactorlist: