Karlo Sarmiento
Karlo Sarmiento

Reputation: 1

Acumatica Scan Move

I am trying to add an additional step when using the set qty button in Scan Move screen (AM302010). I would like to set a value to another field before the standard functionality that sets the qty after pressing the button. Upon looking in the source code, I can't seem to find which graph I should extend in order to customize the screen. I would also like to know how to override or where to override these scan functions in acumatica.

Thanks for answering.

enter image description here

Edit*

Sorry for not being clear.

In scan move screen, there is a set qty button. Which allows the user to enter the qty on the detail. What I would like to do is add an additional step before that. For example, before setting the qty in the scan field, i would like to make the input insert Qty scrapped first. So the sequence would be, Press set qty button, input scrapped qty, press enter (set qty scrapped value), input qty, press enter(set qty value). (the original is, press set qty button, input qty, press enter).enter image description here

I have already found which graph to extend. enter image description here Currently, I am having trouble trying to understand this new process for wms in acumatica 2022 R1. Is it possible to add the new step, or maybe add another button, as a workaround, in the header to achieve the goal?

Thanks again/

Upvotes: -1

Views: 339

Answers (1)

Vidhya
Vidhya

Reputation: 56

Before recommending the approach for your query, would like to suggest you to review the following community articles that explain about the new WMS architecture and how to override different methods in the same:

Based on your requirement, would like to suggest the below approach:

  1. Create a new Scan extension for ScanMove graph as below:

    public class ScanMoveExtension : ScanMove.ScanExtension {}
    
  2. Create a new ScanCommand for performing the required actions/changes by overriding Process method.

  3. Override DecorateScanMode method and add the new command before adding SetQtyCommand as below:

       [PXOverride]
       public virtual ScanMode<ScanMove> DecorateScanMode(ScanMode<ScanMove> original, Func<ScanMode<ScanMove>, ScanMode<ScanMove>> base_DecorateScanMode)
    {
            var mode = base_DecorateScanMode(original);
        if (mode is ScanMaterial.MaterialMode materialMode)
        {
            mode
                .Intercept.CreateCommands.ByReplace(basis =>
                 {
                   // modify the order of the commands added
                   // RemoveCommand, SetQtyCommand and ReleaseCommand
                   // add your logic before SetQtyCommand
            });
        }
      return mode;
    }
    

This should enable you to execute the steps before SetQty command is executed.

Upvotes: 0

Related Questions