Base solution for your next web application
Open Closed

How to create a record in a user-defined table without logging in? #6066


User avatar
0
timmackey created

I used the Power Tool to create an entity. I am able to add a record in my table using the GUI generated when I am logged in.

I have a new registration form, and I want to add a record in my table at registration time - before the user has logged in. In method 'public async Task<RegisterTenantOutput> RegisterTenant(RegisterTenantInput input)' I call the 'CreateOrEdit' method of 'IInstitutionsAppService', as follows:

                    await _institutionsAppService.CreateOrEdit(
                        new TtmDataModel.Dtos.CreateOrEditInstitutionDto()
                        {
                            DomainName = emailDomain,
                            InstitutionName = institutionName,
                            TenantId = tenant.Id,
                            IsSet_ = 0,
                            Id = null,
                        });

Invoking the method results in an Exception being thrown. Exception.message: "Current user did not login to the application!"

Can you direct me to the documentation that will explain how to create and edit my custom table records without the user being logged in? Or if there is no documentation, please explain how to accomplish this objective. Thank you.


1 Answer(s)