Base solution for your next web application

Activities of "alfar_re"

Hi @ismcagdas,

My use case is simple. I have an entity Building an entity RentalUnits. One Building has many RentalUnits and on RentalUnit create modal there is Building as a navigation property. So, on the Building actions, I have 'Add Rental Unit' as an action which a user can use to add RentalUnits to a Building. This means that it makes sense to have the respective Building selected when the action is selected.

See Index below;

`var _createOrEditRentalUnitModal = new app.ModalManager({
			viewUrl: abp.appPath + 'App/RentalUnits/CreateOrEditModal',
			scriptUrl: abp.appPath + 'view-resources/Areas/App/Views/RentalUnits/_CreateOrEditModal.js',
			modalClass: 'CreateOrEditRentalUnitModal'
		});


     {
			text: app.localize('Add Unit'),
			action: function (data) {
			_createOrEditRentalUnitModal.open({ buildingId: data.record.building.id });
	}`

Now, I'd like to know how to make this work with the code you shared on here.

Thank you.

Hi,

I added the mapping and it worked. I guess that was the step I was missing. Thanks a gigabyte @ismcagdas.

Hi @ismcagdas,

I have looked at this and am wondering how to implement it inside actions in index.js

Hi,

Thank you. Let me try this out.

Hi,

Needing resolution on this matter. Thank you.

Hi,

Here you go.

AutoMapper.AutoMapperMappingException: Missing type map configuration or unsupported mapping.

Mapping types:
GetNumberFormatForViewDto -> NumberFormat
reos.NumberFormats.Dtos.GetNumberFormatForViewDto -> reos.NumberFormats.NumberFormat
   at lambda_method(Closure , GetNumberFormatForViewDto , NumberFormat , ResolutionContext )
   at Abp.AutoMapper.AutoMapperObjectMapper.Map[TSource,TDestination](TSource source, TDestination destination)
   at reos.Leases.LeasesAppService.GenerateNumberAsync(ModuleProfile input, Int32 tenantId) in D:\OneDrive\Projects\reos\src\reos.Application\Leases\LeasesAppService.cs:line 351
   at reos.Leases.LeasesAppService.Create(CreateOrEditLeaseDto input) in D:\OneDrive\Projects\reos\src\reos.Application\Leases\LeasesAppService.cs:line 162
   at Abp.Threading.InternalAsyncHelper.AwaitTaskWithPostActionAndFinally(Task actualReturnValue, Func`1 postAction, Action`1 finalAction)
   at reos.Leases.LeasesAppService.CreateOrEdit(CreateOrEditLeaseDto input) in D:\OneDrive\Projects\reos\src\reos.Application\Leases\LeasesAppService.cs:line 144
   at lambda_method(Closure , Object )
   at Microsoft.Extensions.Internal.ObjectMethodExecutorAwaitable.Awaiter.GetResult()
   at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.AwaitableResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeActionMethodAsync>g__Awaited|12_0(ControllerActionInvoker invoker, ValueTask`1 actionResultValueTask)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.&lt;InvokeNextActionFilterAsync&gt;g__Awaited|10_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)

Hi @ismcagdas,

I'm using jQuery

Hi,

I also noted that when you enter a keyword while searching you don't get desired results.

Hi,

I actually got it working. Thank you for your pointers.

Hi @maliming,

Here you go

[AbpAuthorize(AppPermissions.Pages_ChartOfAccounts_Create)]
protected virtual async Task Create(CreateOrEditChartOfAccountDto input)
{
    var chartOfAccount = ObjectMapper.Map<ChartOfAccount>(input);


    if (AbpSession.TenantId != null)
    {
        chartOfAccount.TenantId = (int)AbpSession.TenantId;
    }

    //await _chartOfAccountRepository.InsertAsync(chartOfAccount);
    var id = await _chartOfAccountRepository.InsertAndGetIdAsync(chartOfAccount);
}
Showing 71 to 80 of 101 entries