Relationships on Configure Entity form not available

Hello,

I have been attempting to generate CRUD pages and consistently receive the same error on add/edit forms for all FK fields:

Found a malformed 'RadzenFormField' tag helper. Tag helpers must have a start and end tag or be self closing.
and
Found a malformed 'ChildContent' tag helper. Tag helpers must have a start and end tag or be self closing.

The generated source code for the Add page is


<PageTitle>Add CompanyAttendanceauthorization</PageTitle>
    <RadzenColumn SizeMD=12>
        <RadzenAlert Shade="Shade.Lighter" Variant="Variant.Flat" Size="AlertSize.Small" AlertStyle="AlertStyle.Danger" Visible="@errorVisible">Cannot save CompanyAttendanceauthorization</RadzenAlert>
        <RadzenTemplateForm TItem="MWAdmin.Server.Models.MW_Dev.CompanyAttendanceauthorization" Data="@(companyAttendanceauthorization)" Visible="@(companyAttendanceauthorization != null)" Submit="@FormSubmit">
          <RadzenStack>
            <RadzenFormField Text="User Key Navigation" Variant="Variant.Outlined">
                  <ChildContent>
            <RadzenFormField Text="Department Key Navigation" Variant="Variant.Outlined">
                  <ChildContent>
            <RadzenFormField Text="Shift Key Navigation" Variant="Variant.Outlined">
                  <ChildContent>
          </RadzenStack>
          <RadzenStack style="margin-top:1rem;" Orientation="Orientation.Horizontal" AlignItems="AlignItems.Center" JustifyContent="JustifyContent.End" Gap="0.5rem">
                    <RadzenButton ButtonStyle="ButtonStyle.Primary" ButtonType="ButtonType.Submit" Icon="save" Text="Save" Variant="Variant.Flat" />
                    <RadzenButton ButtonStyle="ButtonStyle.Light" Text="Cancel" Variant="Variant.Flat" Click="@CancelButtonClick"  />
          </RadzenStack>
        </RadzenTemplateForm>
    </RadzenColumn> 

Additionally none of the FKs generated dropdown datagrids as I would expect.

Assuming I did something wrong, I watched the CRUD tutorial and realized I do not have the Relationships options available on the Configure Entity form:

Whereas the tutorial does:

My database has functioning FKs and I have already used the same database to generate an app in Radzen Studio that I am attempting to recreate in Radzen Blazor Studio. I included all FK tables when inferring the schema and have encountered this with every CRUD page I have attempted so far.

Please let me know if I am doing something wrong or if this is a bug. Thanks!

Zach

We can’t tell why the relationships are not listed unless we examine your database schema. Please send us your schema as SQL script at info@radzen.com.

I've checked your schema and looks like the relations are retrieved properly and the relevant code is generated for both DbContext and CRUD pages (FK are represented by DropDowns):


We will check Configure Entity dialog to see why relations are not listed and we will provide fix in our next update.

Excellent, thank you very much!

Hello,

I have installed the latest version of RBS today and all of the issues listed above still remain for me. I cannot see entity relations on the configure entity form and all FK fields do not generate correctly on the add and edit razor files. The razor.cs files are correct, but the razor files generate the code I provided earlier and require manual adjustment.

Please let me know if you if you need any more information. I am running RBS 1.49.0.

Thanks,

Zach

Sorry @Zach.E, we were unable to fix the issue - we will do our best to include fix in one of your upcoming updates.

I am still having this issue. I am using the latest version of RBS and have even installed it on a completely different computer and the issue still persists. I can see the relationships when generating the page, but it still doesn’t correctly generate the form fields. Any ideas on how to fix this? Manually fixing every add and edit form field that has a dropdown datagrid linked to a foreign key certainly makes development more tedious than it should be with a tool like this. I love the tool, but fixing this issue would be extremely helpful.

Here is what I see using latest version of RBS and the schema you’ve sent us on 9 July:

The generated razor is also correct:

Yes, I would expect so. This works correctly for my co-worker as well. But for me, ever since I have switched from Legacy Radzen to RBS it has not worked, regardless of RBS version or database schema (every project I have done in RBS). I have tried on Windows 10 and 11. I have even tried on an entirely new PC. I try the exact same steps as my co-worker and get different results. It is as if the error is tied to my account specifically, which I know probably has nothing to do with it.

Even though the relationships are visible on the Configure Entity form, all FK fields on Add and Edit forms generate with the dropdown datagrid and end tags missing and I receive the errors:

Found a malformed 'RadzenFormField' tag helper. Tag helpers must have a start and end tag or be self closing.
and
Found a malformed 'ChildContent' tag helper. Tag helpers must have a start and end tag or be self closing.

If you want me to send a video of me doing each step along with providing you whatever code you need I will. I have grown accustom to working around this and building the dropdown datagrids myself (the razor.cs code is still correct), but it would save me a lot of time if it worked.

Your SQL Server account indeed might have different privileges and as a result you might not be able to access and infer the database properly.

The schema is inferred correctly. The razor.cs code for the add and edit form is generated correctly. It is simply the razor file that does not inject the dropdown datagrid. I can manually add the dropdown datagrid myself and insert the parameters the razor.cs generated. My co-worker and I connect the database using the exact same sql server login.

Is this a legacy app created by Radzen Studio? Can you try to scaffold new application using RBS to see if everyone works normally?

They are apps created from scratch, not migrated from Radzen Studio. One of them is using the same data source and SQL Server login as an existing Radzen Studio app that I recreated in RBS from scratch, and I had no issue generating Add/Edit forms with this setup in Radzen Studio. I figured it was an issue with my computer, but I recently got a new computer and started an entirely new RBS project and the issue remained, so I returned to this post.

The form fields for FKs always generate in the razor file as shown in my original post. I need to manually close the and tags and drop in the dropdown datagrid myself. But the razor.cs file has all of the expected code for the dropdown, I just have to apply it to the component.

I can’t think of or find a setting in RBS that would cause this specifically, but the fact it has happened on two different PCs and databases makes me wonder if it has to do with my Radzen account or the way the application was configured on install.

Can you send us the entire application to test it locally? We have already the database schema.

I have probably changed the schema since then. I can generate any schema/project and have this issue though. Would you like me to make a simple example project? It could just be two tables and I will have this problem.

Yes, please send us the example project along with the database schema as SQL script.