Open Closed

Parent- 2 Child forms missing id when no records for second child form. #7967


User avatar
0
rwright-ruhealth created
  • ABP Framework version: v8.3.0
  • UI Type: MVC
  • Database System: EF Core SQL Server
  • Tiered (for MVC) or Auth Server Separated (for Angular): Tiered MVC
  • Exception message and full stack trace: Uncaught Type Error Reading Properties of undefined (reading 'id')
  • Steps to reproduce the issue:

Create a Simple Company app in Abp Suite. First table is Company with coName field. build project and run. Add a few company records. Next, Add a Sites Table - Make it A Child of Company Add a SiteName field. Save and build. Add a site name record to one of your companies. No Problem. Add A Child Vehicle Table with make and model .

Save and Build.
Navigate to Company after build and login. Should see company records. Click the tab that has company sites. Should see Sites. Create an Employees table (ALL PKs are int) add column employeeName Save and build. Add a Many-to-Many navigation collection to Employees Table for the Company table in Navigation so we can have many employees. Save and Build. Load And add a Company OK. Add some employees OK.

Click the Vehicles tab.
Error: vehicle.id is null so is vehicle. OF COURSE! I want to add a vehicle. I did notice in forms that do not have a navigation collection or drop down, the data element is just named data.id not data.vehicle.id for the tab naming convention. later in code it pulls a reference to companyId I notice if I create a Company1, Site1, Vehicle1 and don't use NavigationCollection for many-to-many employees the correct code is produced. Is this a bug? How to work around it. Presently: I am changing vehicle ID on the tab to data.company.id in the actual page javascript. Solves the problem. But should I have to fix this?

Appreciate all of your support.

Error happens because Uncaught Type Error function initDataGrids(data) { initSiteGrid(data) $("#Vehicles-tab-" + data.vehicle.id).one("click", function (e) { initVehicleGrid(data); }); }

Click New Vehicle fails to show the Create Form for the New Vehicle.


2 Answer(s)
  • User Avatar
    0
    EngincanV created
    Support Team .NET Developer

    Hi, thanks for the detailed explanation. I'll try to reproduce the problem and let you know.

  • User Avatar
    0
    rwright-ruhealth created

    Hi, thanks for the detailed explanation. I'll try to reproduce the problem and let you know.

    Hi, any luck with a quick solution or even a work-around that will stick when project is rebuilt in ABP Suite/ABP Studio using customizations?

Made with ❤️ on ABP v9.0.0-preview Updated on September 27, 2024, 06:34