This feature allows for Orders to show how many prior visits a particular Aircraft has made to an FBO.
This can be used purely for information purposes, or to auto-add specific product(s) based on the Prior Visit Count.
To begin, the Custom Property and Value should be created:
The following Custom Value formula should be inserted:
$"{input.GetPriorActualHandlingCountByRegistration("StartDate=2013-01-01")}"
This allows the count to represent the count of all Orders for a particular registration as of the date 1-Jan-2013
NOTE: The calculated value returned is only for Orders that have an actual ground time e.g if an Order has arrived and another Order is yet to arrive, then the 3rd Order will still show a count of 1 until the second order is on the ground. This ensures that you capture only flight orders that have actually happened and therefore excludes canceled orders and anything pending.
In the below example, the product 'New Customer - 1st Visit' should be added to an Order when the 'Prior Visits' count is 0.
This creates a clear indicator to staff that this is the first time the Aircraft is being handled, and any necessary procedures can be carried out e.g. special care/handling.
Once the 'New Customer - 1st Visit' product is set up, the auto-add can be created.
In the 'Formula' field, the following should be added:
Raise a request for the support team to add the below formula referencing this article for context.
((Func<bool>)(() => { bool autoAdd = false; var priorVisits = input.GetPriorActualHandlingCountByRegistration("StartDate=2013-01-01") == 0; var StateToExclude = new List<string> { "to be cancelled" }; string currentStateType = ""; if (input.GetOrderField("OrderState") != null) currentStateType = input.GetOrderField("OrderState").ToString().ToLower(); var matchesStateType = StateToExclude.Contains(currentStateType); autoAdd = priorVisits && !matchesStateType; return autoAdd; }))();
The 'New Customer - 1st Visit' product is now auto-added to any order whereby the 'Prior Visits' count is '0':
See also:
Comments
0 comments
Please sign in to leave a comment.