# You cannot use \`..' in a record update parser

**URL:** <https://forum.canton.network/t/you-cannot-use-in-a-record-update-parser/5996>\
**Category:** App Development\
**Tags:** features and bugs\
**Created:** [January 18, 2023, 3:30pm UTC](https://forum.canton.network/t/you-cannot-use-in-a-record-update-parser/5996 "2023-01-18T15:30:32Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![ktreply](https://avatars.discourse-cdn.com/v4/letter/k/779978/32.png) [@ktreply](https://forum.canton.network/u/ktreply)\
**Post date:** [January 18, 2023, 3:30pm UTC](https://forum.canton.network/t/you-cannot-use-in-a-record-update-parser/5996/1 "2023-01-18T15:30:32Z")

</div>

I am not able to resolve this. It shows this error at create tokenOffer with …

````plaintext
    with
        issuer: Party
        owner: Party
        description: Text
        userAdmin: Party --makes sure that issuer and owner are legit
        issued: Time
        lastPrice: Decimal
        currency: Text
        royaltyRate: Decimal
    where
        signatory issuer, userAdmin 

        choice Offer: (ContractId Offer, ContractId Payable)
            with
               newOwner: Party
               price: Decimal
            controller owner
            do 
                create tokenOffer 
                    with ..          
template tokenOffer
    with
        issuer: Party
        owner: Party
        description: Text
        userAdmin: Party --makes sure that issuer and owner are legit
        issued: Time
        newOwner: Party
        price: Decimal
        lastPrice: Decimal
        currency: Text
        royaltyRate: Decimal
    where
        signatory issuer, userAdmin, owner

        key (issuer, owner, description ): (Party, Party, Text)
        maintainer key._2

        choice AcceptToken: (ContractId Token, ContractId Payable, ContractId Payable)
            controller newOwner, userAdmin
            do 
                fromNewOwnerToOwner <- create Payable
                    with
                        from = newOwner
                        to = owner
                        amount = price
                        currency
                        reference = "Notional for `"<> description <> "`."

                royaltyPayment <- create Payable
                    with
                        from = newOwner
                        to = issuer
                        amount = price * royaltyRate
                        currency
                        reference = "Royalty for`" <> description <> "`."

                newToken <- create Token
                    with
                        owner = newOwner
                        lastPrice = price
                        ..
                return (newToken, fromNewOwnerToOwner, royaltyPayment) ```
````

---

<div class="post-metadata">

**Author:** ![cocreature](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/cocreature/32/36_2.png) [@cocreature](https://forum.canton.network/u/cocreature)\
**Post date:** [January 18, 2023, 4:22pm UTC](https://forum.canton.network/t/you-cannot-use-in-a-record-update-parser/5996/2 "2023-01-18T16:22:27Z")

</div>

Record constructors are always upper case just as type constructors. So in both your template definition as well as where you’re creating the record you need to use `TokenOffer` not `tokenOffer`.

The general rule in Daml is that names that start with an uppercase letter refer to concrete types or values whereas names that start with lowercase letters refer to variables.

---

<div class="post-metadata">

**Author:** ![ktreply](https://avatars.discourse-cdn.com/v4/letter/k/779978/32.png) [@ktreply](https://forum.canton.network/u/ktreply)\
**Post date:** [January 18, 2023, 8:09pm UTC](https://forum.canton.network/t/you-cannot-use-in-a-record-update-parser/5996/3 "2023-01-18T20:09:29Z")

</div>

Thank you. Now its this error at _create TokenOffer with …_  
• Couldn’t match type ‘ContractId TokenOffer’  
with ‘(ContractId Offer, ContractId Payable)’  
Expected type: Update (ContractId Offer, ContractId Payable)  
Actual type: Update (ContractId TokenOffer)  
• In a stmt of a ‘do’ block: create TokenOffer {…}  
In the expression: do create TokenOffer {…}  
In the expression: let \_ = arg in do create TokenOffer {…}typecheck

Apologies. I am trying to complete the DAML foundation certification and it’s aligned more with the older sdk version of DAML.

Thank you again

---

<div class="post-metadata">

**Author:** ![cocreature](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/cocreature/32/36_2.png) [@cocreature](https://forum.canton.network/u/cocreature)\
**Post date:** [January 19, 2023, 7:13am UTC](https://forum.canton.network/t/you-cannot-use-in-a-record-update-parser/5996/4 "2023-01-19T07:13:19Z")

</div>

The type of your `Offer` choice is `(ContractId Offer, ContractId Payable)` so you would need to return a tuple of a contract id for an `Offer` contract and a `Payable` contract. But your implementation returns `ContractId TokenOffer`.

You can either change the type or change the implementation to match. Which one makes more sense really depends on what you intend that choice to be doing.

---

<div class="post-metadata">

**Author:** ![ktreply](https://avatars.discourse-cdn.com/v4/letter/k/779978/32.png) [@ktreply](https://forum.canton.network/u/ktreply)\
**Post date:** [January 19, 2023, 10:58am UTC](https://forum.canton.network/t/you-cannot-use-in-a-record-update-parser/5996/5 "2023-01-19T10:58:16Z")

</div>

That really helped. Thank you 🙂
