# Code generation error when creating master/detail template page

**URL:** <https://forum.radzen.com/t/code-generation-error-when-creating-master-detail-template-page/5987>\
**Category:** Blazor Server\
**Created:** [December 10, 2020, 9:32pm UTC](https://forum.radzen.com/t/code-generation-error-when-creating-master-detail-template-page/5987 "2020-12-10T21:32:10Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![pat.stave](https://forum.radzen.com/user_avatar/forum.radzen.com/pat.stave/32/4923_2.png) [@pat.stave](https://forum.radzen.com/u/pat.stave)\
**Post date:** [December 10, 2020, 9:32pm UTC](https://forum.radzen.com/t/code-generation-error-when-creating-master-detail-template-page/5987/1 "2020-12-10T21:32:10Z")

</div>

I have some simple REST JSON data like this:

```
[  
   {
      "articleCode":208,
      "articleName":"Milk",
      "todaysCount":100,
      "totalCount":155,
      "olderCount":55,
      "todaysVolume":1000,
      "totalVolume":1550,
      "olderVolume":550,
      "lanes": 
         [
            {
               "laneId":1,
               "closed":false,
               "maintenance":true,
               "todaysCount":100,
               "totalCount":100,
               "olderCount":0,
               "todaysVolume":1000,
               "totalVolume":1000,
               "olderVolume":0
            },
            {
               "laneId":4,
               "closed":false,
               "maintenance":true,
               "todaysCount":0,
               "totalCount":55,
               "olderCount":55,
               "todaysVolume":0,
               "totalVolume":550,
               "olderVolume":0
            }            
         ]
   },
   {
      "articleCode":210,
      "articleName":"Honey",
      "todaysCount":200,
      "totalCount":0,
      "olderCount":0,
      "todaysVolume":2000,
      "totalVolume":0,
      "olderVolume":0,
      "lanes": 
         [
            {
               "laneId":5,
               "closed":false,
               "maintenance":true,
               "todaysCount":50,
               "totalCount":0,
               "olderCount":0,
               "todaysVolume":500,
               "totalVolume":500,
               "olderVolume":0
            },
            {
               "laneId":6,
               "closed":false,
               "maintenance":true,
               "todaysCount":150,
               "totalCount":0,
               "olderCount":0,
               "todaysVolume":1500,
               "totalVolume":0,
               "olderVolume":0
            }            
         ]
   }
]

```

I have defined my dataset like this in Radzen (all the data source methods work fine):

 ![image](https://forum.radzen.com/uploads/default/original/2X/b/ba0eb4fea35f702f8b02058450bc83ab57be9bab.png)  
 ![image](https://forum.radzen.com/uploads/default/original/2X/8/8574b1b2479d3db2c387968beb3d020040f71089.png)

I want to display this data in a master / detail fashion. I try to create a master/detail template page like this;

 ![image](https://forum.radzen.com/uploads/default/original/2X/0/0304b8516e5893cce8fea6465326e22c5b81cefd.png)

When i try to save / create the template page, i get this error:

 ![image](https://forum.radzen.com/uploads/default/original/2X/8/8e3a47747022ba84c839b89738faac13b0ea9532.png)

Why do i get this code generation error?

---

<div class="post-metadata">

**Author:** ![enchev](https://forum.radzen.com/user_avatar/forum.radzen.com/enchev/32/16_2.png) [@enchev](https://forum.radzen.com/u/enchev)\
**Post date:** [December 11, 2020, 8:16am UTC](https://forum.radzen.com/t/code-generation-error-when-creating-master-detail-template-page/5987/2 "2020-12-11T08:16:50Z")

</div>

Hi,

Unfortunately we are not sure what's causing the error. Is just with master/detail templates or you get the same with CRUD pages template? If you are Radzen subscriber you can send us your app at [info@radzen.com](mailto:info@radzen.com) to debug it.

---

<div class="post-metadata">

**Author:** ![pat.stave](https://forum.radzen.com/user_avatar/forum.radzen.com/pat.stave/32/4923_2.png) [@pat.stave](https://forum.radzen.com/u/pat.stave)\
**Post date:** [December 11, 2020, 8:24am UTC](https://forum.radzen.com/t/code-generation-error-when-creating-master-detail-template-page/5987/3 "2020-12-11T08:24:56Z")

</div>

Hi

I do get the same error when i select the CRUD pages template.  
I'm not a subscriber.

I will try to recreate everything from scratch to see if that helps. If not, maybe i should try to downgrade some versions? Can this be a bug that has been introduced lately?

---

<div class="post-metadata">

**Author:** ![enchev](https://forum.radzen.com/user_avatar/forum.radzen.com/enchev/32/16_2.png) [@enchev](https://forum.radzen.com/u/enchev)\
**Post date:** [December 11, 2020, 8:26am UTC](https://forum.radzen.com/t/code-generation-error-when-creating-master-detail-template-page/5987/4 "2020-12-11T08:26:36Z")

</div>

Sounds more like unsupported REST schema - downgrading most probably will not help much.

---

<div class="post-metadata">

**Author:** ![pat.stave](https://forum.radzen.com/user_avatar/forum.radzen.com/pat.stave/32/4923_2.png) [@pat.stave](https://forum.radzen.com/u/pat.stave)\
**Post date:** [December 11, 2020, 8:28am UTC](https://forum.radzen.com/t/code-generation-error-when-creating-master-detail-template-page/5987/5 "2020-12-11T08:28:33Z")

</div>

If you look at how the raw data looks, and how i have defined it in the IDE, have i defined everything correctly? Or are you saying that this is a format that is not supported by Radzen?

---

<div class="post-metadata">

**Author:** ![pat.stave](https://forum.radzen.com/user_avatar/forum.radzen.com/pat.stave/32/4923_2.png) [@pat.stave](https://forum.radzen.com/u/pat.stave)\
**Post date:** [December 11, 2020, 8:31am UTC](https://forum.radzen.com/t/code-generation-error-when-creating-master-detail-template-page/5987/6 "2020-12-11T08:31:23Z")

</div>

By the way this is the console output when the code generation fails:  
 ![image](https://forum.radzen.com/uploads/default/original/2X/6/64fb1c4cc1e8b45ebff010059cef5f6ade955af6.png)

---

<div class="post-metadata">

**Author:** ![enchev](https://forum.radzen.com/user_avatar/forum.radzen.com/enchev/32/16_2.png) [@enchev](https://forum.radzen.com/u/enchev)\
**Post date:** [December 11, 2020, 8:41am UTC](https://forum.radzen.com/t/code-generation-error-when-creating-master-detail-template-page/5987/7 "2020-12-11T08:41:16Z")

</div>

> [@pat.stave](#):
>
> If you look at how the raw data looks, and how i have defined it in the IDE, have i defined everything correctly?

Yes, this is what I'm referring to however our support, debugging, etc. is available for paid customers only.

---

<div class="post-metadata">

**Author:** ![pat.stave](https://forum.radzen.com/user_avatar/forum.radzen.com/pat.stave/32/4923_2.png) [@pat.stave](https://forum.radzen.com/u/pat.stave)\
**Post date:** [December 11, 2020, 9:14am UTC](https://forum.radzen.com/t/code-generation-error-when-creating-master-detail-template-page/5987/8 "2020-12-11T09:14:16Z")

</div>

Absolutely understand your point on 1-1 support.

However this seems to be a bug that is easily replicated:

1. Create a new REST data source defined like this:  

2. Create a template page (master/detail).  
Code generation will fail.

Attached is my meta data JSON file for the datasource:  
[ParentChildTest.zip](https://forum.radzen.com/uploads/short-url/boyU0neGYkZTMUGl3Z71Ki6pMts.zip) (452 Bytes)
