0

I have been working on some requirement for advance warehouse mobile application in AX. The requirement was to do something when item is scanned. So in order to perform this I have registeroverridemethod of leave when item text box is build. The build methods is below:

//This method is updated in WhsWorkExecuteForm
protected void createTextBox(
container _textBox,
boolean   _password = false)
{
FormBuildStringControl      stringControl;

stringControl = controlGroup.addControl(FormControlType::String,this.elementName(_textBox));

if (this.elementHasError(_textBox))
{
    stringControl.colorScheme(FormColorScheme::RGB);
    stringControl.backgroundColor(WHSWorkExecuteForm::errorBackgroundColor());
}

stringControl.text(this.elementData(_textBox));
stringControl.label(this.elementLabel(_textBox));
stringControl.passwordStyle(_password);
stringControl.enabled(this.elementEnabled(_textBox));

//Below code is added to register override method
if(this.elementName(_textBox) == #ItemId)
{
stringControl.registerOverrideMethod(methodStr(FormStringControl,Leave),methodStr(WHSWorkExecuteForm,DynamicButtonControl_modified),this);
}
}

This method is being called when I run the warehouse app from AX AOT i.e. Action Menu item -> WHSWorkExecute but it is not working from browser. I have run the incremental CIL as well but no change. Any idea? do I need to do changes in DisplayIEOS.aspx as well?

Zeeshan shaikh
  • 341
  • 1
  • 5
  • 24

1 Answers1

1

The web browser part of the Warehouse Mobile Device Portal is driven by xml files that are exchanged between the AOS and IIS website. You can read more about that in Warehouse Mobile Device Portal Architecture

The WHSWorkExecute form in the AOT of the Dynamics AX desktop client is basically a quick&dirty "emulator" of the web client. It enables you to test changes in the WHSWorkExecute framework logic that drives the mobile device functionality without having to set up the components that enable the web client. But changing this form at run time with FormBuild classes like in your code will have no effect on the web client, because this has no effect on the xml data sent to the website.

Instead, you should use the methods provided by the WHSWorkExecute framework to add controls. See Creating Custom Solutions with the Warehouse Mobile Device Portal, it has a section on the buildControl method of the framework.

How to handle a modified event of a control depends on what you want to do. The second link describes briefly how you could implement some client side only logic. If you need to execute logic on the AOS, you would have to modify one of the specialized build methods or create your own. The second link also has some guidance on this. Registering override methods for FormControl objects will not work, because again this will not change the xml data sent to the web client.

FH-Inway
  • 4,432
  • 1
  • 20
  • 37