Minimum Requirements
- Android App 1.8.1.1
Description
Adds an extra Header (ImageCapture) Step to the Adjust Quantity functionality.
- Adds an extra ImageCapture step after finishing a registration in an unplanned function.
- The collected image is then saved in Mob Wms Media Queue.
- In the Mobile Document Queue List, a PostMedia Request will appear after adding the Header Steps.
Behaviour on the device
To collect an Image in the step, the user will need to use the plus sign (+) to take a picture and add an optional note before posting.
Step 1 - Create an adhoc header step
//Step 1: Create a simple ImageCapture header step
[EventSubscriber(ObjectType::Codeunit, Codeunit::"MOB WMS Adhoc Registr.", 'OnPostAdhocRegistration_OnAddSteps', '', true, true)]
local procedure MyOnPostAdhocRegistration_OnAddSteps(_RegistrationType: Text; var _RequestValues: Record "MOB NS Request Element"; var _Steps: Record "MOB Steps Element"; var _RegistrationTypeTracking: Text)
var
MobWmsToolbox: Codeunit "MOB WMS Toolbox";
begin
if _RegistrationType <> MobWmsToolbox."CONST::AdjustQuantity"() then
exit;
//Already collected, break to avoid adding the same new step indefinitely
if _RequestValues.HasValue('ImageCapture') then
exit;
_Steps.Create_ImageCaptureStep(10000, 'ImageCapture', 'Take a Picture');
_Steps.Set_helpLabel('Take a picture of the item');
end;
Step 2 - Handle the header step
//Step 2: Handle the ImageCapture step. The picture taken will be saved in the MOB Wms Media Queue
[EventSubscriber(ObjectType::Codeunit, Codeunit::"MOB WMS Adhoc Registr.", 'OnPostAdhocRegistration_OnAfterPost', '', true, true)]
local procedure MyOnPostAdhocRegistration_OnAfterPost(_MessageId: Guid; _RegistrationType: Text; var _RequestValues: Record "MOB NS Request Element"; var _XmlResponseDoc: XmlDocument; var _RegistrationTypeTracking: Text)
var
MobMedia: Codeunit "MOB WMS Media";
MobWmsToolbox: Codeunit "MOB WMS Toolbox";
Image: Text;
begin
if _RegistrationType <> MobWmsToolbox."CONST::AdjustQuantity"() then
exit;
if _RequestValues.HasValue('ImageCapture') then begin
Image := _RequestValues.GetValue('ImageCapture', true);
// Set the tracking value displayed in the document queue
_RegistrationTypeTracking := ('Saved image: ' + Image);
MobMedia.AddImageToMediaQueue(Image);
end;
end;
ImageCapture Step in Adjust Quantity
From BC, go to the Mobile WMS Media Queue page.
The picture and note were saved in the Mob Wms Media Queue
See also
-
-
How-to: Create custom Unplanned function in Main Menu — The most common control for customization
Add a new function to the Main menu. "Header fields" and optional "Steps" to collect
-
-
How-to: Add ImageCapture Step for Adjust Quantity — Adds an extra ImageCapture Step to the Adjust Quantity functionality.
-
How-to: Add action to Order Line menu — Add a new Unplanned Function as action on Pick Lines.
-
Case: Default total RunTime based on produced quantity in Production Output — A customer wants the RunTime step for Production Output to be populated with a default value.
-
Case: Add custom step 'To-Location' to Unplanned Move — Add custom step for To-Location when posting Unplanned Move from/to locations without "Directed Putaway-and-pick"