Home Blog Adding a Status to the Acumatica Mobile App Filter for Field Service

Adding a Status to the Acumatica Mobile App Filter for Field Service

Troy Vars | November 29, 2021

Adding a Status to the Acumatica Mobile App Filter for Field Service

Assessing the Problem and the Solution

The Acumatica Mobile App utilizes screen FS400100 to generate the Appointment List Menu Item. When Field Techs display this screen, they have two filter options: date range and staff member. Missing from the filters is a status to remove on hold, completed, closed, or canceled appointments. The goal: remove the clutter so Field Techs can focus on just the appointments they need.

A quick and easy solution would be to expose a generic inquiry (GI) to the mobile app with these filters. The issue is that the GI navigation on the mobile app lacks the same functionality as the core Acumatica has, namely being able to open the transactional appointment screen when displayed.

A better option is to simply modify the Appointment List screen and add a status. What approach shall we take to do this?

Evaluating the Existing Code

The first thing we want to do is navigate to the Account Summary screen FS400100 in Acumatica. Using the hand dandy Inspect Element, CTRL+ALT+CLICK, we can identify the Business Logic Code (BLC) is AppointmentInq and the two DACs AppointmentInqFilter and FSAppointmentFSServiceOrder.

Adding a Status to the Acumatica Mobile App Filter for Field Service

Notice that the header filter, DAC AppointmentInqFilter, does not contain the Status field in the filter header section of the inquiry screen (FS400100).  Therefore, we will need to add it.

Next, we need to look at the query that will filter the records. This is the Appointments View declared on the BLC using the FSAppointmentFSServiceOrder DAC with a few joins to other tables.

Notice the following:

  1. It is decorated with PXFilterable
  2. Uses the Traditional standard BQL and is not yet updated to BQL Fluent
  3. Does not use the newer IEnumberable

Design Solutions

Option One

Add the field to an extension DAC and override the select view Appointments from the graph extension & add the filter field to the mobile app.

Pros: Quick and easy to do… Cons: Hard to maintain as versions changes have to keep up with view changes and it’s not Acumatica’s recommended approach.

In this option, we will need to add the follwing to the existing filter view:

.And<Current<AppointmentInqFilter.usrStatus>.IsNull

,Or<Current<AppointmentInqFilterExt.usrStatus>.IsEqual<FSAppointmentFSServiceOrder.status>>

Option Two

Add the field to an extension DAC and Override the view with a Delegate View & Add the filter field to the mobile app

Pros – Acumatica provides an example in the T300 training course, where you will find it in section 11.7.

Here is the code:

GIST: https://gist.github.com/anaxetogrind/dc53fe2e62bfde79b9a36e0d26192818

Testing & Gotchas

At first, I had my current statement the wrong way around in the Where And statement.  That is to say, I placed it on my FSAppointmentFSServiceOrder portion of the Where clause. This created a weird situation where the code compiled without error but upon running the process Acumatica threw an invalid Syntax near ); error. This seemed like an SQL error to me, so I was able to trace the problem down by looking at the generated SQL via the Request Profiler. From there, I could see in the P25 parameter that my UsrStatus was being populated but my Status from the appointment was blank. So SQL read: and (@P25 = ). The missing value caused the error and was fixable by correcting the Where clause statement in the method.

Also, during testing, I noticed I had forgotten to set the Commit Changes to true on the UsrStatus field. This caused the records not to be refreshed unless another Filter Field was also updated.

Update the Mobile App

Lastly, we need to add the filter field to the Mobile Application. The Appointment List is in the Appointment Summary screen FS400100. Looking at the WSDL/MSDL, we see that our UsrStatus field is added to the Selection container.

Adding a Status to the Acumatica Mobile App Filter for Field Service

A quick update line on the Commands screen for the Mobile Application to Update FS400100 and a quick update to the Menu to force the application to update.

GISThttps://gist.github.com/anaxetogrind/9862b713ed15116d5cb5194a9e4ea988

And just like that, the mobile application now includes our filter:

Adding a Status to the Acumatica Mobile App Filter for Field Service

Adding a Status to the Acumatica Mobile App Filter for Field Service

 

 

I hope you have found this post useful.  Happy Coding!

Blog Author

Troy is a Developer & a Senior Consultant for CS3 Technology, LLC. His passion for programming started at an early age when his family picked up a Tandy PC and a beginner’s guide to BASIC. A tutorial that used PRINT command with a series of spaces and X’s to display an image of Snoopy and Woodstock on screen, instilled in him a love of making a PC do things for him. Troy leveraged his love of programming moving from a warehouse employee to an executive-level Business Relationship Manager. Along the way, he implemented SAP on 5 continents and developed several web portals connected via ABAP and BAPI’s. On April Fool’s Day of 2015, he began the 5+ year journey to being an Acumatica evangelist. Along the way, he picked up knowledge of C#, .Net Framework, and the powerful customization potential from Acumatica xRP Framework. All the while completing 15 implementations with custom screens and integrations to various client sites. Troy’s unique talent is that he combines a high level of business acumen and technical knowledge. This often places him in the role of translator and/or facilitator in group settings.

Receive blog updates in your Inbox.