Hi all,
I am trying to create custom view for report purpose in CRM 2016 On premise, I have a date field in that. I want to display only year in that column.
How can I achieve this
Thanks
Naren
Hi all,
I am trying to create custom view for report purpose in CRM 2016 On premise, I have a date field in that. I want to display only year in that column.
How can I achieve this
Thanks
Naren
Hello,
i recommand Andrew's proposal.
Hi partner,
You could create a new custom field to show the year of the date field.
For example, my date field is new_Date and the year field is new_Year, so here is the sample code.
function getYear(executionContext){ var formContext=executionContext.getFormContext(); var dateField=formContext.getAttribute("new_Date").getValue(); var dateTime=new Date(dateField); var year=dateTime.getYear(); formContext.getAttribute("new_Year").setValue(year); }
And then you just need to add this new year field to your report.
Best Regards,
Leo
Hi Narendra,
Even you could achieve year column inside SSRS reports as well.
e.g.
=Year(Fields!fieldlogicalname.Value)
or
DATEPART ( yyyy, date )
Hello,
I'm afraid you will have to do some additional customizations.
In order to do that you will have to add whole number field and develop a plugin that will populate that field with year value of your datetime field. After that you can use that field in your view.
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,280 Super User 2024 Season 2
Martin Dráb 230,214 Most Valuable Professional
nmaenpaa 101,156