I have a queryable which I return to a Kendo DataSourceResult object for paging and querying for a grid:
private readonly IRepository<User, long> _userRepository
...
public IQueryable<NcFormSubmissionForKendoGridDto> GetFormSubmissionsForNcActionAudit()
{
var query = from formSubmission in _ncFormSubmissionRepository.GetAll()
join ncAction in _ncActionRepository.GetAll() on formSubmission.NcActionId equals ncAction.Id
join user in _userRepository.GetAll() on formSubmission.CreatorUserId equals user.Id
join ncEntity in _ncEntityRepository.GetAll() on formSubmission.NcEntityId equals ncEntity.Id
join organizationUnit in _organizationUnitRepository.GetAll() on ncEntity.OrganizationUnitId equals organizationUnit.Id
select new NcFormSubmissionForKendoGridDto
{
Id = formSubmission.Id,
CreationTime = formSubmission.CreationTime,
ClientCreatedDatetime = formSubmission.ClientCreatedDatetime,
ReportString = formSubmission.ReportString,
SerializedJson = formSubmission.SerializedJson,
CreatedByFullName = user.UserName,
NcActionDisplayName = ncAction.DisplayName,
NcEntityDisplayName = ncEntity.DisplayName,
OrganizationUnitDisplayName = organizationUnit.DisplayName,
};
return query;
}
Ideally I would like the full name of the user:
CreatedByFullName = user.FullName
However this throws the following error message:
Translation of member 'FullName' on entity type 'User' failed. This commonly occurs when the specified member is unmapped. Either rewrite the query in a form that can be translated, or switch to client evaluation explicitly by inserting a call to 'AsEnumerable', 'AsAsyncEnumerable', 'ToList', or 'ToListAsync'. See https://go.microsoft.com/fwlink/?linkid=2101038 for more information.
Is this a bug or is there anything which can be done about it? I could iterate the data after converting to a DataSourceResult but thought there may be a cleaner way.
Cheers, Bob
Hi @ismcagdas,
Thanks for the answer, I was looking to find the date format of the current tenant but I think you have pointed me in the correct direction:
format: dt.setLocale(abp.localization.currentLanguage.name).toLocaleString(DateTime.DATETIME_SHORT);
Closing this as this is ok for my needs.
Cheers, Bob
I am currently in the process of upgrading to the latest version but have a couple of jobs before it is released.
Currently I have use this code to format some of my datetime strings:
format: '{0:dd/MM/yyyy}'
Given that culture is changed when a language is changed is there any way to find the the date format for the tenant or the current session in Angular?
For example, when using Kendo grid I have to cast all dates back to javascript dates so I first grab the tenant timezone before doing so:
let tenantTimezone = abp.timing.timeZoneInfo.iana.timeZoneId;
Then I can carry out the following:
if (d.deletionTime) { d.deletionTime = new Date(moment(d.deletionTime).tz(tenantTimezone).format()); }
It's a pain but that's the way it is with Kendo...
Is there any way I can grab the current date time format:
let currentdateTimeFormat = ?????
so I can format my dates accordingly:
format: currentdateTimeFormat
I hope that makes sense, I wanted to ask this question now as work on upgrading is on-going and this useful information to know. Thanks in advance, Bob
Issue opened on github: date and time formats
How do I set date and time formats? I always understood it was decided by the language selection which also (I believe) sets the current culture. As a test, on a fresh install of Zero go to Admin -> Users and select any of the languages, the date format in the Creation Time column never changes. Am I missing something or is this a hangover of the Luxon implementation? Let me know if this is a bug and I will open an issue in github.
Also, on the language drop-down there are two implementations of English, which is at it should be. However, one uses the English flag (as it should) and one uses the British Flag - should this be a USA flag?
Cheers, Bob
Hi Musa,
Thanks for this, I had some modified entries in my database which were being loaded after I changed default values hence the confusion. There appear to be some unpredicatable consequences of using Chart.js canvas with a height setting so I will close this issue but may come back for some furthern clarification. Great work on the customizable dashboard, however, I am upgrading from 6.8.0 and this is one of the features I wanted to start working with. It's a pleasure to work with if you follow the instructions to te letter. Great Job!
Cheers, Bob
Perfect, thanks.
Can someone tell me how customizable dashboard settings are loaded? In a development project trying to implement these I followed the instructions at the Customizable Dashboard page. Which seems to miss the all-important step of adding a new widget to the AppSettingProvider. When I ran my project my new widget was never in the settings.
To investigate further I reverted back to a standard 10.4.0 install with no changes.
I changed the setting of one widget from a height of 4 to 2 and width of 12 to 4.
I then run my project and put a breakpoint on where these settings are passed after the GetAll command:
Then I capture the response from the GetAll command in my network tab and paste into jsonviewer:
Why have the changes not been loaded into settings? My database is clear of any settings at this stage so surely the default value should be loaded? How do i add a new dashboard widget to my settings, am I missing something?
Any help appreciated.
Cheers, Bob
Referring to this entry which seems to be unresolved: Disable logging all SQL statements On a clean install I have these entries in the log file: This is far too verbose especially when I use Application Insights for log analysis. How do I switch the option off?
Cheers, Bob