Description
This describes Line steps used in Planned Functions.
You can conditionally update a steps properties like Visible, Default value or Help label. See the property names complete list of properties here: Step Configuration Matrix
...
In this example, we will make a Line step more dynamic by changing values on it, using "RegisterExtraInfo".it's properties:
Step 1
Create Steps in "ReferenceData".
Using event OnGetReferenceData_OnAddRegistrationCollectorConfigurations
- We name the configuration key "CustomPickSteps". We name each step like Text or Date step.
- You can use any naming.
// Step 1Step 1
[EventSubscriber(ObjectType::Codeunit, Codeunit::"MOB WMS Reference Data", 'OnGetReferenceData_OnAddRegistrationCollectorConfigurations', '', true, true)]
local procedure OnGetReferenceData_OnAddRegistrationCollectorConfigurations(var _Steps: Record "MOB Steps Element")
begin
// Define a key for the step(s)
_Steps.InitConfigurationKey('CustomPickStepsCustomPickStep');
// Create steps and set default values
_Steps.Create_TextStep(35, 'TextStep', 'HeaderText');Create steps and set default values
_Steps.Create_DateStep(45, 'DateStep', 'HeaderText');
_Steps.Create_InformationStep(555, 'InfoStep', 'HeaderText', 'Label', 'HelpLabel');
end;
Step 2
Include the step in "...OnAddStepsToAnyLine"-event
Use one of this eventthese events:
Filter by label (Content by label) | ||||||
---|---|---|---|---|---|---|
|
// Step 2Step 2
[EventSubscriber(ObjectType::Codeunit, Codeunit::"MOB WMS Pick", 'OnGetPickOrderLines_OnAddStepsToAnyLine', '', true, true)]
local procedure MyOnGetPickOrderLines_OnAddStepsToAnyLine(_RecRef: RecordRef; var _BaseOrderLineElement: Record "MOB Ns BaseDataModel Element")
var
WarehouseActivityLine: Record "Warehouse Activity Line";
begin
_BaseOrderLineElement.Create_StepsByReferenceDataKey('CustomPickSteps');
if (_RecRef.Number = Database::"Warehouse Activity Line") then begin
_RecRef.SetTable(WarehouseActivityLine);
// Overwrite Step values with information from pick line
_BaseOrderLineElement.SetValue('RegisterExtraInfo', STRSUBSTNOCreate_StepsByReferenceDataKey(STRSUBSTNO('CustomPickStepsCustomPickStep{[InfoStep][helpLabel][Description isDescription is: "%1"][DateStep][defaultValue][%2][TextStep][defaultValue][%3]}',
WarehouseActivityLine."Description", // Info step
MobToolbox.Date2TextResponseFormat(20300101D), // Date step
WarehouseActivityLine.WarehouseActivityLine."Description")); // Text step
end;
end;
- Set value "RegisterExtraInfo".
- Using this syntax
Code Block |
---|
'StepsConfigurationKey { [StepName] [StepProperty] [Value] } |
- Tip: You must use the same "configurationkey" key CustomPickStep and " step name " that InfoStep, which you choose in the first step.earlier.
See the complete list of properties: Step Configuration Matrix
Result on Mobile
When the example code above has been deployed the Mobile WMS App must be restarted to read the new reference data created from the events (is loaded only once on login). By then the result on the mobile device is:
See also
Filter by label (Content by label) | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|