web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Dynamics 365 Community / Blogs / Day to Day Dynamics 365 / Dynamics 365 Project Servic...

Dynamics 365 Project Service Automation: Customizing the Time Entry and Expense forms

apa Profile Picture apa 8,284 Moderator

Tested on:
Dynamics 365 version 9.0


I recently wrote about submitting time and expense entries for Accounts and Contacts. In that blog post I described how the Time Entry's and Expense's main and Quick Create forms can be used to submit time and expense entries. While the calendar view Time Entry and Expense forms can't be customized, the main, Quick Create and Quick View forms of the Time Entry and Expense entities can. The main forms are used when submitting entries on a phone, a tablet or the new Project Resource Hub.

Beginning.png

Left to right: Customized Time Entry main form used with the Project Resource Hub / Customized Time Entry main form on mobile.


Customizing the Time Entry and Expense forms

The process of customizing the Time Entry and Expense forms is fairly straightforward:

  • Edit the Option Set msdyn_type under the Time Entry entity if you want to add options or rename the existing ones. To make the changes visible on the calendar view Time Entry form, you have to edit a piece of JavaScript. Keep on reading to see how this is done.
  • Add your custom fields on the Time Entry and/or Expense entity's main form.
  • Add your custom fields on the Time Entry and/or Expense entity's Quick Create form if you are submitting entries from the context of a Bookable Resource. See my earlier blog post for more information.
  • Add your custom fields on the Time Entry and/or Expense entity's Quick View form if you want a Project Approver to see your custom fields at approval.

8816.1.png

Editing the Option Set msdyn_type.

2630.2.png

Adding fields on the main, Quick Create and Quick View forms.

0068.3.png

Time Entry entity's Quick Create form with a custom field Related Project Contract.

3683.4.png

Custom field Related Project Contract on the Time Entry main form.

7585.5.png

Custom field Related Project Contract as seen by a Project Approver when the field is added on the main and Quick View forms.

A further consideration could be to enable data from custom fields to flow to Actuals and even to Invoice Line Details by a custom plug-in.


Customizing the calendar view Time Entry form's Option Set

The calendar view Time Entry form is completely different from the Time Entry entity's main form. While customizations to the calendar view form are extremely limited, the Option Set displaying the type of work can be customized as of Dynamics 365 for Field Service and Project Services Automation Update 3. To customize the Option Set's options, the JavaScript msdyn_/Common/Models/OptionSets/TimeEntryType.js has to be modified. In the example below I have added a fourth option to the Option Set. When editing the JavaScript it's worth noting that:

  • Value in the JavaScript matches the Value in the Option Set.
  • Name in the JavaScript doesn't have spaces.
  • Label in the JavaScript will dictate what is shown on the calendar view Time Entry form.

In my example the additional line in the JavaScrip is as follows:
this._optionSet.add({ value: '100000000', name: 'offtofighttheklingons', label: 'Off to fight the Klingons', color: '#0000ff', cssTheme: '1' });

Calendar_2D00_view_2D00_form.png


I hope this brief blog post helps you take more out of Time Entries and Expenses in Dynamics 365 Project Service Automation and also gives you ideas on customizing these entities according to your business needs. Like I suggested earlier the following step could be to enable data from custom fields to flow all the way to Actuals or Invoice Line Details.


Disclaimer: 
All my blog posts reflect my personal opinions and findings unless otherwise stated.

Comments

*This post is locked for comments

  • Aliona Profile Picture Aliona 126
    Posted at

    Thanks Antii for what you're doing and sharing! That's really usefull informaiton.

  • apa Profile Picture apa 8,284 Moderator
    Posted at

    Thanks Estelle :)

  • Community Member Profile Picture Community Member
    Posted at

    So intereesting!!!!!! As usual :-)

  • Javed Nehal Profile Picture Javed Nehal 625
    Posted at

    Hi,

    I need to change Time Entry Type from 'Vacation' to 'PTO' . I changed the value in Option Set and edited the TimeEntryType.js as well.

    this._optionSet.add({ value: '192350002', name: 'PTO', label: 'Annual Leave', color: '#7F7F7F', cssTheme: '3' });

    This change is not reflecting while entering time from Time Entry Calendar view.

    Any suggestion ???

    Javed