Use this event to
Excerpt |
---|
Handle existing or new 'Whse. Inquiry' document types. |
Description
Perform Online validation.
Overwrite You can use Whse. Inquiry to perform instant Online Validation of a steps input value.
Use this event to overwrite existing behavior or handle new custom types.
Mobile Document Type
Optionally use this event to handle new custom Document Types in the 'Whse. Inquiry' document handler class.
You may handle new custom Document Types for Whse. Inquiry either by:
...
...
Implicit success
If you do nothing, the validation is considered successful by the mobile device.
You must call Error() when validation should fail.
Template
// [Template]
[EventSubscriber(ObjectType::Codeunit, Codeunit::"MOB WMS Whse. Inquiry", 'OnWhseInquiryOnCustomDocumentType', '', true, true)]
local procedure OnWhseInquiryOnCustomDocumentType(_DocumentType: Text; var _RequestValues: Record "MOB NS Request Element"; var _ResponseElement: Record "MOB NS Resp Element"; var _RegistrationTypeTracking: Text; var _IsHandled: Boolean)
begin
end;
Example
[EventSubscriber(ObjectType::Codeunit, Codeunit::"MOB WMS Whse. Inquiry", 'OnWhseInquiryOnCustomDocumentType', '', true, true)]
local procedure Ex01OnWhseInquiryOnCustomDocumentType(_DocumentType: Text; var _RequestValues: Record "MOB NS Request Element"; var _ResponseElement: Record "MOB NS Resp Element"; var _RegistrationTypeTracking: Text; var _IsHandled: Boolean)
var
ItemLedgerEntry: Record "Item Ledger Entry";
SerialNumber: Text;
begin
// Make sure we only handle the Serial No. validation
if _DocumentType <> 'GetSerialNumberInformation' then
exit;
// Read request
SerialNumber := _RequestValues.GetValue('SerialNumber', true);
if SerialNumber = '' then
exit;
// Serial number must be available in the Item Ledger Entries
ItemLedgerEntry.Reset();
ItemLedgerEntry.SetCurrentKey("Serial No.");
ItemLedgerEntry.SetRange("Serial No.", SerialNumber);
end;
Example
TODO ItemLedgerEntry.SetRange(Open, true);
ItemLedgerEntry.SetRange(Positive, true);
if not ItemLedgerEntry.IsEmpty() then
exit // -- The Serial number is available
else
Error('Unknown serial no. "%1"', SerialNumber); // -- Not found
_RegistrationTypeTracking := SerialNumber;
// Event is now handled
_IsHandled := true;
end;
Filter by label (Content by label) | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
|
...