Add an account with customer, location, and related details to a work order

Dynamics 365 Field Service uses accounts and contacts throughout the work order process. Accounts represent who is receiving the site service (driven by work orders), and which customer account should be billed for invoices generated from the work order. Locations are important in field service scenarios where field technicians may need to travel to multiple customer locations each day.

Service accounts represent who is the receiving account of the on-site service (work order), and where the field technician will be dispatched.

Billing accounts represent which account should receive invoices, and identifies the parent account in cases where many service accounts belong to a central organization (for example: multiple wine vineyards are owned by a wine corporation).

Selecting accounts will also autopopulate other fields on a work order.

This proves useful in several scenarios, including:

  • passing account (customer) price lists to all related work orders.
  • passing the account territory to all related work orders, which ensures that resources devoted to the territory are scheduled to perform the on-site work.

In this article, we'll explore creating and using accounts on work orders.

Prerequisites

Create a service account

First, let's create a service account that represents a specific customer location where work orders will be performed. Whether it's a service account or a billing account, both are simply account records. The most important difference is that service accounts have addresses and are geocoded.

Go to Field Service > Accounts > +New.

Enter an Account name and an address along with any other important details based on your business needs.

Next, select Geo Code at the top of the form. If you have set Auto Geo Code to Yes in Field Service Settings (as noted in the prerequisites), then you can skip this step.

Screenshot of .

Confirm geocoding is successful by the location visualized on the map and values populated in the latitude and longitude fields in the scheduling section.

Screenshot of geocoded account.

Next, go to the Field Service section of the account form and fill in details based on your business needs. Values entered here are passed down to work orders where this account is listed as the service account, but the values can be edited on each work order if needed.

Let's take a look at what you can expect from each of these fields.

Billing Account

The value chosen here will populate the billing account field on the work order when this account is entered as the service account. This field is not required, and if no account is selected, the service account listed on the work order will act as both the service account and the billing account. In the screenshot at the end of this section, Winery Inc. is the billing account for the service account, Coho Winery. This implies Coho Winery is a specific location of Winery Inc. and invoices should be sent to Winery Inc.

Price List

This value is listed on related work orders and all related work order products and services. It dictates the price of those products and services on the resulting invoices. If the billing account field in the previous step has a value, then the price list on the billing account record will be used. If no billing account is entered, then the price list entered here will be used on resulting work orders and invoices. If the work order products or services are not listed on the price list, then the list price on the product record is used.

Tax Exempt

This decides if sales tax should be added to the price of related work orders. Set to Yes to not add sales tax. Set to No to specify a sales tax code (percentage) that should be added to the work order price and invoice.

Service Territory

In this field, you choose the geographical region in which this account is located. This value will be passed down to the related work orders and work order requirements, and is considered in the scheduling process on the schedule board, in the schedule assistant, and with Resource Scheduling Optimization (RSO).

Travel Charge Type

This decides if and how travel by a field technician to this service account should be priced and billed on work orders. For more information, see configuration considerations in this article.

Work Order Instructions

This value serves as a text note and populates the Instructions field on all related work orders. This is a good way to ensure field technicians follow processes specific to this account. See an example in the following screenshot.

Screenshot of Field Service related values for a specific account.

Note

Updating these values will not update previous work orders, only future work orders.

Currency

Work order products and work order services will inherit the currency value noted on the work order service accounts and billing accounts.

Create a work order for the service account

Next, go to Field Service > Work Orders > +New.

Add the account you created as the service account.

The following values are automatically populated:

  • Billing Account: populated as the billing account specified on the service account record.

  • Price List: populated as the price list specified on the billing account record.

Note

If the work order price list does not reflect the price list entered on your service account or billing account, this means it is being overridden by the price list related to work order types or entitlements.

  • Primary Contact: the primary contact of the service account shown on the work order.

Screenshot of new work order with the account just created listed as a service account.

  • Service Territory and Instructions: represented in the following screenshot.

Screenshot of service territory and instructions.

  • Address: represented in the following screenshot.

Screenshot of address of service account passed down to work order address.

  • Location: this work order location is passed down to the work order requirement and is reflected on the schedule board map.

Screenshot of work order map location.

Bonus tip: You can select and drag the map pin to edit the work order location (latitude and longitude) as needed. This is helpful for scenarios where the address points to an arbitrary location--at a university campus, for example--but the work order must take place at a specific building or location on-site.

Note

Work orders can be assigned addresses and geocoded independently of the service account, if needed.

Invoice the billing account

When the work order is finished and the system status is changed to Closed-Posted, an invoice with all used work order products and services is generated for the account listed in the billing account on the work order.

Go to Field Service > Sales > Invoices to view the newly generated invoice for the closed work order. Notice the account on the invoice is the billing account on the work order, and the name references the work order number. See the following screenshot for reference.

Screenshot of invoice for billing account.

Configuration considerations

Travel charges, demystified

If the work order's service account (not billing account) has a travel charge type set, then a work order product for a travel charge will be added after the work order is scheduled and the generated booking's Booking Status changes.

First, go to Field Service > Settings > Field Service Settings and specify a product in the Travel Charge Item field.

Screenshot of travel charge item in field service settings.

This is the product that will later show as a work order product.

Screenshot of travel charge added as a work order product.

Note

The travel charge work order product's unit amount price will be the value entered in the service account travel charge.

Though the unit amount price of the travel charge is dictated by the price list, list price, and travel charge, the quantity is dictated by the Travel Charge Type on the service account. Here's what the quantity options mean:

  • Hourly: Quantity will be the Actual Travel Duration of the booking per 60 minutes. For example, if the unit amount price of the Travel Charge is set to $60 and actual travel duration is 30 minutes, the travel charge work order product will be priced as $30.
  • Mileage: Quantity is the Miles Traveled of the booking. For example, if the unit amount price of the Travel Charge is set to $1 and miles traveled is 20 miles, the travel charge work order product will be priced as $20.
  • Fixed: Quantity is 1. For example, if the unit amount price of the Travel Charge is set to $50, the travel charge work order product will be priced as $50, regardless of miles or time spent traveling.
  • None: No travel charge will be added to the work order.

Note

In cases of multiple bookings for a single work order, multiple travel charges will be added as work order products.

Additional notes

Known issues

Latitude and longitude values don't update as expected

Sometimes, an issue occurs where latitude and longitude values aren't updated, or address suggestions don't show up on account or contact form.

One reason this issue occurs is because Field Service libraries are missing from the form. To add the relevant Field Service libraries and event handlers to the form, follow these steps.

  1. Select Account form from Customization and open the Form Properties.

  2. Add the form library msdyn_/Account/Account.Library.js.

Form properties in Power Apps.

  1. In the Event Handlers section, select Add, and specify the function as seen in the following screenshot.

Handler properties in Power Apps.

  1. Save and publish the customization.

Bing Maps can't be added to the work order form

If the Bing Maps control is manually removed from the out-of-the-box work order form, it can't be added back.

To enable Bing Maps button in form designer, at least one of the attributes of type address should have the mask ValidForMap added in the form.

Below is the XML for the account form where we see ValidForMap added to its address attribute.

<DisplayMask>ValidForAdvancedFind\|ValidForForm\|ValidForGrid\|ValidForMap</DisplayMask>
  1. Create a solution on customer's sandbox environment that includes the form to which the Bing Maps control needs to be added. Export it as managed solution.

  2. In the solution's customizations.xml file, go the formxml part of it.

  3. Add the following maps control to the <controlDescriptions>.

        <controlDescription forControl="{8b67ae03-1701-54d2-09be-35295876ca8a}">

        <customControl id="{4273EDBD-AC1D-40d3-9FB2-095C621B552D}">

        <parameters>

        <datafieldname>msdyn\_mapcontrol</datafieldname>

        </parameters>

        </customControl>

        <customControl formFactor="0" name="MscrmControls.Map.MapControl">

        <parameters>

        <value>msdyn\_mapcontrol</value>

        <mapSourceSwitch isGroup="true" static="true">CoordinatesGroup</mapSourceSwitch>

        <latitude>msdyn\_latitude</latitude>

        <longitude>msdyn\_longitude</longitude>

        <addressEditableSwitch isGroup="true" static="true">isAddressEditableYesGroup</addressEditableSwitch>

        <outputLatitude>msdyn\_latitude</outputLatitude>

        <outputLongitude>msdyn\_longitude</outputLongitude>

        </parameters>

        </customControl>

        <customControl formFactor="1" name="MscrmControls.Map.MapControl">

        <parameters>

        <value>msdyn\_mapcontrol</value>

        <mapSourceSwitch isGroup="true" static="true">CoordinatesGroup</mapSourceSwitch>

        <latitude>msdyn\_latitude</latitude>

        <longitude>msdyn\_longitude</longitude>

        <addressEditableSwitch isGroup="true" static="true">isAddressEditableYesGroup</addressEditableSwitch>

        <outputLatitude>msdyn\_latitude</outputLatitude>

        <outputLongitude>msdyn\_longitude</outputLongitude>

        </parameters>

        </customControl>

        <customControl formFactor="2" name="MscrmControls.Map.MapControl">

        <parameters>

        <value>msdyn\_mapcontrol</value>

        <mapSourceSwitch isGroup="true" static="true">CoordinatesGroup</mapSourceSwitch>

        <latitude>msdyn\_latitude</latitude>

        <longitude>msdyn\_longitude</longitude>

        <addressEditableSwitch isGroup="true" static="true">isAddressEditableYesGroup</addressEditableSwitch>

        <outputLatitude>msdyn\_latitude</outputLatitude>

        <outputLongitude>msdyn\_longitude</outputLongitude>

        </parameters>

        </customControl>

        </controlDescription>

  1. Search for "Bing Maps" in the same file.

  2. Add the control with the following code to the row and cell wherever it needs to be added.

    <control disabled="false" id="msdyn\_mapcontrol" classid="{F9A8A302-114E-466A-B582-6771B2AE0D92}" uniqueid="{8b67ae03-1701-54d2-09be-35295876ca8a}" datafieldname="msdyn\_mapcontrol"/>
  1. Save the file and create a new managed solution zip file out of it.

  2. Import the solution to the affected environment.

Note

 If the map control is still not visible on the form after following these steps, try removing the active form customizations.