Anywhere Mobility Studio Documentation
Expression functions
An expression function lets you call Microsoft Dynamics BC functions from a mapping. BC includes a collection of standard expressions that you can extend with custom functions. Include new expression functions in a custom codeunit. Do not modify the standard expression functions. Expression functions execute in the context of the mapping. Use the mapping wizard to map the arguments of a function with the appropriate values. To use expression functions in the mapping wizard, register the expression codeunit in the Function Library. The registration function verifies the codeunit and extracts the metadata from the object. Examples of expression functions include GLN Number Conversions, Item Inventory Calculations, and advanced date and time manipulations.
Format
Expression functions use the following format:
Codeunit:<ID>.<FunctionName>(<Arguments>): (<ReturnType>)
- Operator: Codeunit
- ID: Depending on the implementation, the ID refers to either the Codeunit ID or the Enum ID. See Expression Function.
- FunctionName: The name of the function.
- (Arguments): A list of arguments, separated by commas.
- (ReturnType): The return type of your function (optional).
WMS Function List 2 for warehouse functionality
The following list shows a collection of standard functions available in Business Integration Solutions for Microsoft Dynamics 365 Business Central. Functions from ANY are registered in the same way, codeunit WMS Function List 2 is registered during product installation.
| Method name | Description | Arguments | Return |
|---|---|---|---|
| DAW_IsBinMandatory | Returns true when a bin is mandatory for a location | LocationCode: Code[10] | Boolean |
| DAW_IsShipmentBinConstant | Returns true when a shipment bin cannot be changed | LocationCode: Code[10] | Boolean |
| DAW_CheckAvailQtyToTake | Returns the available quantity to take for an item at a bin | ItemNo: Code[20]; LocationCode: Code[10]; BinCode: Code[20]; UoM: Code[20]; ReqQuantity: Decimal; LotNo: Code[20]; SerialNo: Code[20]; ShowError: Boolean; AlternativeError: Text | Decimal |
| DAW_CheckSuggestedBin | Check if a suggested bin is still valid after tracking details change | ItemNo: Code[20]; LocationCode: Code[10]; BinCode: Code[20]; LotNo: Code[20]; SerialNo: Code[20] | Code[20] |
| DAW_ValidBin | Use this function to see if a bin is NOT the adjustment bin | LocationCode: Code[10]; BinCode: Code[20] | Void |
| DAW_GetWhseRcptLineFromItemNo | Validate the scanned item against the specified warehouse receipt header | WhseReceiptNo: Code[20]; ItemNo: Code[20] | Integer |
| DAW_GetWhseShptLineFromItemNo | Validate the scanned item against the specified warehouse shipment header | WhseShipmentNo: Code[20]; ItemNo: Code[20] | Integer |
| DAW_WhseShipmentReadyForShip | Return true when (a part of) the shipment is ready to ship | WhseShipmentNo: Code[20]; ErrorMessage: Text | Boolean |
| DAW_WhseShptValidSNTracking | Use this function when confirming a serial no. on a warehouse shipment document | ShipmentNo: Code[20]; LineNo: Integer; LotNo: Code[20]; SerialNo: Code[20] | Void |
| DAW_WhseShptValidLotTracking | Use this function when confirming a lot no. on a warehouse shipment document | ShipmentNo: Code[20]; LineNo: Integer; LotNo: Code[20] | Void |
| DAW_GetWhseActivityLineNo | Validate the scanned item against the specified warehouse activity header | ActivityType: Text[20]; HeaderNo: Code[20]; LineNo: Integer; ItemNo: Code[20]; SerialNo: Code[20]; LotNo: Code[20]; QtyToHandle: Decimal | Integer |
| DAW_GetWhseJnlLineNo | Gets the warehouse journal line for an item | JournalTemplateName: Code[10]; JournalBatchname: Code[10]; LocationCode: Code[10]; ItemNo: Code[20]; BinCode: Code[20]; SerialNo: Code[20]; LotNo: Code[20] | Integer |
| DAW_CheckWhseJnlLine | Use this function to validate the item details to a warehouse journal line | JournalTemplateName: Code[10]; JournalBatchname: Code[10]; LocationCode: Code[10]; LineNo: Integer; ItemNo: Code[20]; BinCode: Code[20]; SerialNo: Code[20]; LotNo: Code[20] | Void |
| DAW_CalcWhseCountedQty | Returns the quantity already counted for a warehouse journal line | JournalTemplateName: Code[10]; JournalBatchname: Code[10]; LocationCode: Code[10]; LineNo: Integer; ItemNo: Code[20]; ReasonCode: Code[20] | Decimal |
| DAW_IsLotTrackedItem | Use this function to determine if lot tracking is required for an item | ItemNo: Code[20] | Boolean |
| DAW_IsSNTrackedItem | Use this function to determine if serial tracking is required for an item | ItemNo: Code[20] | Boolean |
| DAW_LotTrackingApplies | Based on document type and tracking settings, determines if a lot no. is required | ItemNo: Code[20]; Sourcetype: Integer; SourceSubType: Text; WhseDocument: Boolean | Boolean |
| DAW_SNTrackingApplies | Based on document type and tracking settings, determines if a serial no. is required | ItemNo: Code[20]; Sourcetype: Integer; SourceSubType: Text; WhseDocument: Boolean | Boolean |
| DAW_TrackingExists | Checks if the provided item tracking details exist | ItemNo: Code[20]; "Table": Integer; DocumentType: Integer; DocumentNo: Code[20]; DocumentLineNo: Integer; LotNo: Code[20]; SerialNo: Code[20] | Boolean |
| DAW_GetTrackingQuantity | Retrieves the quantity tracked for provided item tracking details | ItemNo: Code[20]; "Table": Integer; DocumentType: Integer; DocumentNo: Code[20]; DocumentLineNo: Integer; LotNo: Code[20]; SerialNo: Code[20]; DocumentBatch: Code[10]; ProdOrderLineNo: Integer | Decimal |
| DAW_GetTrackedQuantity | Retrieves the quantity tracked on a specified location | ItemNo: Code[20]; LotNo: Code[20]; SerialNo: Code[20]; LocationCode: Code[20]; BinCode: Code[20] | Decimal |
| DAW_IsValidSerialNo | Check if a serial number is available for a warehouse document | ActivityType: Text; ActivityNo: Code[20]; LineNo: Integer; SerialNo: Code[20]; LocationCode: Code[10]; ZoneCode: Code[10]; ItemNo: Code[20] | Void |
| DAW_CheckDuplicateSerialNo | Checks if a serial no. is already present on a document | ItemNo: Code[20]; "Table": Integer; DocumentType: Integer; SerialNo: Code[20] | Void |
| DAW_CheckTrackingBuffer | Checks if tracking details are available in the tracking buffer | SessionID: Text; LotNo: Code[20]; SerialNo: Code[20] | Boolean |
| DAW_IsBinMovementBlocked | Returns true when a bin is blocked for all or a specified direction | BinCode: Code[20]; ItemNo: Code[20]; VariantCode: Code[10]; UOM: Code[10]; Direction: Text | Boolean |
| DAW_GetLotForSerialNo | Looks for the lot no. related to a serial no. | WhseActType: Text; WhseActNo: Code[20]; WhseActLineNo: Integer; SerialNo: Code[20] | Code[20] |
| DAW_CalcUOMQty | Calculates quantity based on a new unit of measure | ToUOM: Code[10]; ItemCode: Code[10]; QtyToHandle: Text; FromUOM: Code[10] | Decimal |
| DAW_ValidateQtytoHandle | Validates quantity to handle against the calculated quantity based on a new unit of measure | QtyToHandle: Text; ItemCode: Code[10]; ToUOM: Code[10]; Qty: Text; DocNo: Code[20]; LineNo: Text | Boolean |
| DAW_CheckforSameUOM | Throws an error if From UOM and To UOM are the same | FromUOM: Text; ToUOM: Text | Boolean |
| DAW_GetTransShipTrackingQuantity | Retrieves the quantity tracked for provided item tracking details | ItemNo: Code[20]; "Table": Integer; DocumentType: Integer; DocumentNo: Code[20]; DocumentLineNo: Integer; LotNo: Code[20]; SerialNo: Code[20]; DocumentBatch: Code[10]; ProdOrderLineNo: Integer | Decimal |
| DAW_GetTransReceiveTrackingQuantity | Retrieves the quantity tracked for provided item tracking details | ItemNo: Code[20]; "Table": Integer; DocumentType: Integer; DocumentNo: Code[20]; DocumentLineNo: Integer; LotNo: Code[20]; SerialNo: Code[20]; DocumentBatch: Code[10]; ProdOrderLineNo: Integer | Decimal |
| DAW_GetWhseActLineBreakBulkActive | Returns yes or no depending on whether activity block breakbulk applies to this warehouse | ActivityType: Code[20]; ActivityNo: Code[20]; ActivityLineNo: Integer | Boolean |
| DAW_GetWhseActLineBreakBulkRemark | Returns a text of the breakbulk rule | ActivityType: Code[20]; ActivityNo: Code[20]; ActivityLineNo: Integer; ActionType: Code[20] | Text |
| DAW_ClearTrackingBuffer | Removes tracking data from the buffer table | CurrSession: Text | Void |
| DAW_SetTrackingBufferForSalesLine | Fills tracking buffer with lookup data based on a sales line | DocType: Integer; DocNo: Code[20]; LineNo: Integer; SessionID: Text | Void |
| DAW_SetTrackingBufferForPurchLine | Fills tracking buffer with lookup data based on a purchase line | DocType: Integer; DocNo: Code[20]; LineNo: Integer; SessionID: Text | Void |
| DAW_SetTrackingBufferForItemJrnlLine | Fills tracking buffer with lookup data based on an item journal line | JnlTemplate: Code[10]; JnlBatch: Code[10]; LineNo: Integer; SessionID: Text | Void |
| DAW_SetTrackingBufferForItemJournalData | Fills tracking buffer with lookup data from a temporary journal line | JnlTemplate: Code[10]; JnlBatch: Code[10]; LineNo: Integer; ItemNo: Code[20]; LocationCode: Code[20]; SessionID: Text | Void |
| DAW_SetTrackingBufferForWhseReceiptLine | Fills tracking buffer with lookup data for a warehouse receipt line | ReceiptNo: Code[20]; LineNo: Integer; SessionID: Text | Void |
| DAW_SetTrackingBufferForWhseShipLine | Fills tracking buffer with lookup data based on a warehouse shipment line | ShipNo: Code[20]; LineNo: Integer; SessionID: Text | Void |
| DAW_SetTrackingBufferForWhseActLine | Fills tracking buffer with lookup data based on a warehouse activity line | ActivityType: Integer; ActivityNo: Code[20]; LineNo: Integer; SessionID: Text | Void |
| DAW_SetTrackingBufferForTransferLine | Fills tracking buffer with lookup data based on a transfer line | DocumentNo: Code[20]; LineNo: Integer; Direction: Integer; SessionId: Text | Void |
| DAW_SetTrackingBufferForBinContent | Fills tracking buffer with lookup data based on bin content | LocationCode: Code[10]; BinCode: Code[20]; ItemNo: Code[20]; VariantCode: Code[10]; UoMCode: Code[10]; SessionID: Text | Void |
Reference
For more available standard functions, see this page
OnPrem vs SaaS
Both on-premise and SaaS use the function library setup page to see what is available in the system. The method to publish these functions differs between versions.
| To | See |
|---|---|
| Add your functions to on-premise | How to: Create a Custom Codeunit with Expression Functions |
| Publish functions on the cloud | How to: Expose Code to the Function Interface |