Mod note: As of SDK 1.5.0 Scenarios have been superseded by the more powerful Daml Script. We now recommend using that for all purposes. For more information, and to learn how to use Script please check out @Andreas’ post on our blog.
Hi Team, I am running into the following issue while trying to setup the initialization script
Message:
daml\Main.daml:212:64: error:
Ambiguous occurrence ΓÇÿoperatorΓÇÖ
It could refer to
either the field ΓÇÿoperatorΓÇÖ, defined at daml\Main.daml:143:5
or the field ΓÇÿoperatorΓÇÖ, defined at daml\Main.daml:127:5
or the field ΓÇÿoperatorΓÇÖ, defined at daml\Main.daml:82:5
or the field ΓÇÿoperatorΓÇÖ, defined at daml\Main.daml:71:5
or the field ΓÇÿoperatorΓÇÖ, defined at daml\Main.daml:64:5
or the field ΓÇÿoperatorΓÇÖ, defined at daml\Main.daml:39:5
ERROR: Creation of DAR file failed.
DAML Code :
-- Product
data Product = Product
with
productId: Text
productName: Text
modelNumber: Text
productDetails : Text
productURL : Text
deriving (Eq, Show)
-- The System
template Network
with
operator : Party
where
signatory operator
controller operator can
nonconsuming CreateProductCard : ContractId ProductCard -- persist/not single use as need multiple
with
product : Product
do
create ProductCard with product, operator
-- ProductCard
template ProductCard
with
product : Product
operator : Party
where
signatory operator
-- Initialization Script
setup : Script ()
setup = do
let
product1 = Product with
productId = ""
productName = ""
modelNumber = ""
productDetails = ""
productURL = ""
operator1 <- allocatePartyWithHint "Operator" $ PartyIdHint with partyIdHint = "Operator"
network1 <- submit operator1 do createCmd Network with operator = operator1
submit operator1 do exercise network1 CreateProductCard with operator = operator1; product = product1
pure()