Anywhere Mobility Studio Documentation
Expression Function
An Expression Function enables Microsoft Dynamics BC functions to be called from a mapping. BC has been provided with a collection of standard expressions which can easily be extended with custom functions. New expression functions can be included in a custom codeunit. The standard expression functions may not be modified. Expression Functions are executed in the context of the mapping. The mapping wizard can be used to map the arguments of a function with the appropriate values. In order to use Expression Functions in the Mapping Wizard the expression codeunit has to be registered in the Function Library. The registration function verifies the codeunit and extracts the metadata from the object. Examples of expression functions are: GLN Number Conversions, Item Inventory Calculations and advanced date / time manipulations.
Format
Expressions functions have 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, depending on the interface. See Expression Function
- FunctionName: The name of the function
- (Arguments): A list of arguments, divided by commas
- (ReturnType): The return type of your function which is 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. The 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 when tracking details have been altered. | 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 serialno 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 lotno 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 fuction 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 lottracking is required for item | ItemNo: Code[20] | Boolean |
DAW_IsSNTrackedItem | Use this function to determine if serialtracking is required for item | ItemNo: Code[20] | Boolean |
DAW_LotTrackingApplies | Based on documenttype and tracking settings, determines if a lotno is required | ItemNo: Code[20]; Sourcetype: Integer; SourceSubType: Text; WhseDocument: Boolean | Boolean |
DAW_SNTrackingApplies | Based on documenttype and tracking settings, determines if a serialno 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 serialno 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 specified direction | BinCode: Code[20]; ItemNo: Code[20]; VariantCode: Code[10]; UOM: Code[10]; Direction: Text | Boolean |
DAW_GetLotForSerialNo | Looks for Lot no. related to Serial No. | WhseActType: Text; WhseActNo: Code[20]; WhseActLineNo: Integer; SerialNo: Code[20] | Code[20] |
DAW_CalcUOMQty | Calculates Quantity based on new Unit of Measure. | ToUOM: Code[10]; ItemCode: Code[10]; QtyToHandle: Text; FromUOM: Code[10] | Decimal |
DAW_ValidateQtytoHandle | Validates Quantity to Handle against calculated Quantity based on 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 & To UOM are 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 a yes or no if 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 buffertable | CurrSession: Text | Void |
DAW_SetTrackingBufferForSalesLine | Fills Trackingbuffer with lookup data based on a Sales Line | DocType: Integer; DocNo: Code[20]; LineNo: Integer; SessionID: Text | Void |
DAW_SetTrackingBufferForPurchLine | Fills Trackingbuffer with lookup data based on a Purchase Line | DocType: Integer; DocNo: Code[20]; LineNo: Integer; SessionID: Text | Void |
DAW_SetTrackingBufferForItemJrnlLine | Fills Trackingbuffer with lookup data based on an Item Journal Line | JnlTemplate: Code[10]; JnlBatch: Code[10]; LineNo: Integer; SessionID: Text | Void |
DAW_SetTrackingBufferForItemJournalData | Fills trackingbuffer 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 Trackingbuffer with lookup data for a Whse Receipt Line | ReceiptNo: Code[20]; LineNo: Integer; SessionID: Text | Void |
DAW_SetTrackingBufferForWhseShipLine | Fills Trackingbuffer with lookup data based on a Whse Shipment Line | ShipNo: Code[20]; LineNo: Integer; SessionID: Text | Void |
DAW_SetTrackingBufferForWhseActLine | Fills Trackingbuffer with lookup data based on a Whse Activity Line | ActivityType: Integer; ActivityNo: Code[20]; LineNo: Integer; SessionID: Text | Void |
DAW_SetTrackingBufferForTransferLine | Fills Trackingbuffer with lookup data based on a Transfer Line | DocumentNo: Code[20]; LineNo: Integer; Direction: Integer; SessionId: Text | Void |
DAW_SetTrackingBufferForBinContent | Fills Trackingbuffer 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 please see this page
OnPrem vs Saas
Both OnPrem and Saas work with the function library setup screen, when it comes to seeing what is available in the system. There is a different method to publish these functions in these 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 |