Use this event to
Return extra steps based on already collected values
Description
You can use Whse. Inquiry to perform instant Online validation of a steps input value.
Use this event to return extra steps based on already collected values.
Validating AND returning new steps
You may (optionally) validate the steps value prior to returning new steps using the OnWhseInquiryOnCustomDocumentType event. If the OnWhseInquiryOnCustomDocumentTypeAsXml event was used for such validation the full response Xml has been returned from this event and cannot be further modified by this event.
OnAddSteps-event only supported when the full xml response has not been created already using the OnWhseInquiryOnCustomDocumentTypeAsXml event
Template
// [Template]
[EventSubscriber(ObjectType::Codeunit, Codeunit::"MOB WMS Whse. Inquiry", 'OnWhseInquiry_OnAddSteps', '', true, true)]
local procedure OnWhseInquiry_OnAddSteps(_DocumentType: Text; var _RequestValues: Record "MOB NS Request Element"; var _Steps: Record "MOB Steps Element"; var _RegistrationTypeTracking: Text; var _IsHandled: Boolean)
begin
end;
Example
// [Example 1]
[EventSubscriber(ObjectType::Codeunit, Codeunit::"MOB WMS Whse. Inquiry", 'OnWhseInquiry_OnAddSteps', '', true, true)]
procedure Ex01_OnWhseInquiry_OnAddSteps(_DocumentType: Text; var _RequestValues: Record "MOB NS Request Element"; var _Steps: Record "MOB Steps Element")
var
RequestValues: Record "MOB NS Request Element" temporary;
begin
case _DocumentType of
'ValidateMyLotNumber':
begin
_Steps.Create_TextStep(10, 'MyTextStep1');
_Steps.Set_defaultValue('MyTextDefaultValue1');
_Steps.Set_header('MyTextStep1 - ' + _RequestValues.Get_LotNumber());
_Steps.Create_TextStep(20, 'MyTextStep2');
_Steps.Set_defaultValue('MyTextDefaultValue2');
_Steps.Set_header('MyTextStep2');
exit;
end;
'ValidateMyQuantity':
begin
_Steps.Create_TextStep(10, 'MyQtySteps1');
_Steps.Set_defaultValue('MyQtySteps1');
_Steps.Set_header('MyQtySteps1 - ' + format(_RequestValues.Get_Quantity()));
_Steps.Create_TextStep(20, 'MyQtySteps2');
_Steps.Set_defaultValue('MyQtySteps2');
_Steps.Set_header('MyQtySteps2');
exit;
end;
else
exit;
end;
end;
More examples
-
Case: Return Quantity based on scanned lot number — In the planned pick process, the customer want to scan a lot number and get the quantity on inventory proposed in the quantity step.
-
How-to: Online Validation for Line step — Online Validation on Steps can instantly validate the user data, with a call to BC.
-
How-to: Online Validation for Unplanned Step — "onlineValidation" on Steps can instantly validate the entered data, with a call to the back-end
-
Version History
Version | Changes |
---|---|
MOB5.33 | Introduced |