- ABP Framework version: v4.4.2
- UI type: MVC
- DB provider: EF Core
- Tiered (MVC) or Identity Server Separated (Angular): yes
- Exception message and stack trace:
- Steps to reproduce the issue:"
Hi,
we have added state entity to organization unit by referring this https://support.abp.io/QA/Questions/295/Extending-Abp-entities-by-adding-navigation-properties
Now we want to override organization unit create/edit page to display StateLookupList ?
10 Answer(s)
-
0
Hi,
I think you can do it by following this document.
I just created a test project and did what you are trying to do by following the document:
-
0
-
0
Can you share the relevant logs?
-
0
2021-09-30 14:55:57.166 +05:30 [INF] Request starting HTTP/2 GET https://localhost:44395/Identity/OrganizationUnits/CreateModal - - 2021-09-30 14:55:57.198 +05:30 [INF] Authorization was successful. 2021-09-30 14:55:57.199 +05:30 [INF] Executing endpoint '/Identity/OrganizationUnits/CreateModal' 2021-09-30 14:55:57.204 +05:30 [INF] Route matched with {page = "/Identity/OrganizationUnits/CreateModal", action = "", controller = "", area = ""}. Executing page /Identity/OrganizationUnits/CreateModal 2021-09-30 14:55:57.204 +05:30 [INF] Skipping the execution of current filter as its not the most effective filter implementing the policy Microsoft.AspNetCore.Mvc.ViewFeatures.IAntiforgeryPolicy 2021-09-30 14:55:57.212 +05:30 [INF] Executing handler method CustomApp.Web.Pages.Identity.OrganizationUnits.CreateModalModel.OnGetAsync - ModelState is "Valid" 2021-09-30 14:55:57.221 +05:30 [INF] Start processing HTTP request GET "https://localhost:44356/api/app/states/state-lookup?SkipCount=0&MaxResultCount=1000&api-version=1.0" 2021-09-30 14:55:57.221 +05:30 [INF] Sending HTTP request GET "https://localhost:44356/api/app/states/state-lookup?SkipCount=0&MaxResultCount=1000&api-version=1.0" 2021-09-30 14:55:57.485 +05:30 [INF] Received HTTP response headers after 263.966ms - 200 2021-09-30 14:55:57.485 +05:30 [INF] End processing HTTP request after 264.1222ms - 200 2021-09-30 14:55:57.502 +05:30 [INF] Executed handler method OnGetAsync, returned result . 2021-09-30 14:55:57.502 +05:30 [INF] Executing an implicit handler method - ModelState is "Valid" 2021-09-30 14:55:57.502 +05:30 [INF] Executed an implicit handler method, returned result Microsoft.AspNetCore.Mvc.RazorPages.PageResult. 2021-09-30 14:55:57.644 +05:30 [INF] Executed page /Identity/OrganizationUnits/CreateModal in 440.066ms 2021-09-30 14:55:57.644 +05:30 [INF] Executed endpoint '/Identity/OrganizationUnits/CreateModal' 2021-09-30 14:55:57.645 +05:30 [INF] Request finished HTTP/2 GET https://localhost:44395/Identity/OrganizationUnits/CreateModal - - - 200 - text/html;+charset=utf-8 479.8264ms 2021-09-30 14:55:57.972 +05:30 [INF] Request starting HTTP/2 GET https://localhost:44395/Themes/Lepton/Global/assets/fonts/poppins-v6-latin-100.woff2 - - 2021-09-30 14:55:57.974 +05:30 [INF] The file /Themes/Lepton/Global/assets/fonts/poppins-v6-latin-100.woff2 was not modified 2021-09-30 14:55:57.974 +05:30 [INF] Request finished HTTP/2 GET https://localhost:44395/Themes/Lepton/Global/assets/fonts/poppins-v6-latin-100.woff2 - - - 304 - font/woff2 1.8371ms 2021-09-30 14:57:00.944 +05:30 [INF] Request starting HTTP/2 POST https://localhost:44395/Identity/OrganizationUnits/CreateModal application/x-www-form-urlencoded;+charset=UTF-8 314 2021-09-30 14:57:00.976 +05:30 [INF] Authorization was successful. 2021-09-30 14:57:00.976 +05:30 [INF] Executing endpoint '/Identity/OrganizationUnits/CreateModal' 2021-09-30 14:57:00.976 +05:30 [INF] Route matched with {page = "/Identity/OrganizationUnits/CreateModal", action = "", controller = "", area = ""}. Executing page /Identity/OrganizationUnits/CreateModal 2021-09-30 14:57:00.976 +05:30 [INF] Skipping the execution of current filter as its not the most effective filter implementing the policy Microsoft.AspNetCore.Mvc.ViewFeatures.IAntiforgeryPolicy 2021-09-30 14:57:01.010 +05:30 [INF] Executing handler method CustomApp.Web.Pages.Identity.OrganizationUnits.CreateModalModel.OnPostAsync - ModelState is "Valid" 2021-09-30 14:57:01.041 +05:30 [ERR] ---------- RemoteServiceErrorInfo ---------- { "code": null, "message": "An internal error occurred during your request!", "details": null, "data": {}, "validationErrors": null }
2021-09-30 14:57:01.044 +05:30 [ERR] Missing type map configuration or unsupported mapping.
Mapping types: Object -> OrganizationUnitCreateDto System.Object -> Volo.Abp.Identity.OrganizationUnitCreateDto AutoMapper.AutoMapperMappingException: Missing type map configuration or unsupported mapping.
Mapping types: Object -> OrganizationUnitCreateDto System.Object -> Volo.Abp.Identity.OrganizationUnitCreateDto at lambda_method2159(Closure , Object , OrganizationUnitCreateDto , ResolutionContext ) at Volo.Abp.AutoMapper.AutoMapperAutoObjectMappingProvider.Map[TSource,TDestination](Object source) at Volo.Abp.ObjectMapping.DefaultObjectMapper.AutoMap[TSource,TDestination](Object source) at Volo.Abp.ObjectMapping.DefaultObjectMapper.Map[TSource,TDestination](TSource source) at CustomApp.Web.Pages.Identity.OrganizationUnits.CreateModalModel.OnPostAsync() in E:\Backup\CustomApp\src\CustomApp.Web\Pages\Identity\OrganizationUnits\CreateModal.cshtml.cs:line 56 at Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.ExecutorFactory.GenericTaskHandlerMethod.Convert[T](Object taskAsObject) at Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.ExecutorFactory.GenericTaskHandlerMethod.Execute(Object receiver, Object[] arguments) at Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.PageActionInvoker.InvokeHandlerMethodAsync() at Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.PageActionInvoker.InvokeNextPageFilterAsync() 2021-09-30 14:57:01.049 +05:30 [INF] Executing ObjectResult, writing value of type 'Volo.Abp.Http.RemoteServiceErrorResponse'. 2021-09-30 14:57:01.051 +05:30 [INF] Executed page /Identity/OrganizationUnits/CreateModal in 74.9738ms 2021-09-30 14:57:01.051 +05:30 [INF] Executed endpoint '/Identity/OrganizationUnits/CreateModal' 2021-09-30 14:57:01.051 +05:30 [INF] Request finished HTTP/2 POST https://localhost:44395/Identity/OrganizationUnits/CreateModal application/x-www-form-urlencoded;+charset=UTF-8 314 - 500 - application/json;+charset=utf-8 107.1342ms
-
0
Your problem is that
OrganizationUnitCreateDtoalso doesn't have aStateproperty. I suspect that you have not configuredStateinMyProjectNameModuleExtensionConfiguratorunder theMyProjectName.Domain.Sharedproject.Once you do this and you won't need to override the Create and Edit modal. When you run the application, you will be greeted with a picture like the one below:
PS: Make sure that the code in the picture below is in
MyProjectNameEfCoreEntityExtensionMappingsunder theEntityFrameworkCorefolder in theMyProjectName.EntityFrameworkCoreproject and that the property you added in theAbpOrganizationUnitstable of your database is added as a column. -
0
Hi berkansasmaz,
As u mentioned ,we already add one extra property ADDRESS to organization unit

Now we want to add navigation property STATE to ORGANIZATION UNIT

I referred this ticket https://support.abp.io/QA/Questions/295/Extending-Abp-entities-by-adding-navigation-properties to add STATE to ORGANIZATION UNIT
-
0
First of all, I will write down the actions you have done before to be on the same page:
AbpOrganizationUnitshasStateId- You have an entity named
Stateand you have a property called Name(or a different property). Stateentity hasApplicationServiceand when you runMyProjectName.HttpApi.Hostproject, api end-points appear on swagger.- When you run the
MyProjectName.Webproject, the same api end-points appear on swagger here too. If it is not visible, you need to create a controller inMyProjectName.Web.
I assume you did these steps :)
Then you can customize the
ConfigureExtraPropertiesmethod ofMyProjectNameModuleExtensionConfiguratorunderMyProjectName.Domain.Sharedas in the picture below.I hope that you will finally see an user interface like the screenshot below:
For more information see here.
-
0
Thanks..Working fine!
-
0
-
0
Can you share the relevant logs in
MyProjectName.HttpApi.HostandMyProjectName.Web? And I would be very happy if you could share the details of the request sent over the network.













