Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 29 Next »

Description

This describes Line steps used in Planned Functions.

You can set Default Value or Help Label etc. based on some conditions.

Dynamically Insert Values

Line steps in Planned functions are define in Reference DataThis makes them static to a degree.

In this example we will make a step more dynamic by changing values on it, using "RegisterExtraInfo".



Example Code


1st Step - Create Steps in Reference Data



 

Using event OnGetReferenceData_OnAddRegistrationCollectorConfigurations

  • We name the configuration key "CustomPickSteps". We name each step like Text or Date step. 
  • You can use any naming.



    [EventSubscriber(ObjectType::CodeunitCodeunit::"MOB WMS Reference Data", 'OnGetReferenceData_OnAddRegistrationCollectorConfigurations''', true, true)]
    local procedure OnGetReferenceData_OnAddRegistrationCollectorConfigurations(var _Steps: Record "MOB Steps Element")
    begin
        with _Steps do begin
            InitConfigurationKey('CustomPickStep');


            Create_InformationStep(10'InfoStep''header''label''text here');
        end;
    end;



2nd Step - Include the step in "...OnAddStepsToAnyLine"-event


 

Use one of these event:


  • Set value "RegisterExtraInfo". 
  • Using this syntax
'StepsConfigurationKey { [StepName] [StepProperty] [Value] }


  • Tip: You must use the same "configurationkey" and "step name" that you choose in the 1st step.


    [EventSubscriber(ObjectType::CodeunitCodeunit::"MOB WMS Pick", 'OnGetPickOrderLines_OnAddStepsToAnyLine''', true, true)]
    procedure MyOnGetPickOrderLines_OnAddStepsToAnyLine(_RecRef: RecordRefvar _BaseOrderLineElement: Record "MOB Ns BaseDataModel Element")
    var
        SalesLine: Record "Sales Line";
    begin
        with _BaseOrderLineElement do begin


            Create_StepsByReferenceDataKey('CustomPickSteps');

            if (_RecRef.Number = Database::"Sales Line"then begin
                _RecRef.SetTable(SalesLine);

                SetValue('RegisterExtraInfo', STRSUBSTNO('CustomPickSteps{[InfoStep][helpLabel][Description is: "%1"][DateStep][defaultValue][%2][TextStep][defaultValue][%3]}',
                                                SalesLine."Description",                        // Info step
                                                MobToolbox.Date2TextResponseFormat(20300101D),  // Date step
                                                'A Default Text'));                             // Text step
            end;

        end;
    end;





See also:


Example


An Infostep where "helpLabel" is populated with an Item description


A Date step with default date = 1/1 2030


A Text step with default text

  • No labels