Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

"Accessor tables"

A central part of the Extension API is an "accessor layer" to manipulate the XML content, but with no need to manipulate the XML Documents directly.

You are given functions that handles XML behind-the-scenes for you.


Derived from C#

Our "accessor table" -concept is derived from C# property classes.

...

Code Block
languagec#
titleC#
class Person
{
    private string name;  // the name field
    public string Name    // the Name property
    {
        get
        {
            return name;
        }
        set
        {
            name = value;
        }
    }
}



Accessor Tables (AL)

Since Codeunits cannot be used as parameters in all BC versions, we have introduced "accesssor tables". Basically C# style acccessor classes, but implemented at table level. 

...

The simplest accessor table, which only has one get/set-method property: "Description". 

  • Get_description()Text
  • Set_description(NewValue: Text)
  • GetValue(_PathToGet: Text): Text
  • SetValue(_PathToSet: Text; _NewValue: Text)
  • SetValueAsCData(_PathToSet: Text; _NewXmlCData: XmlCData)

  • SetValueAsCData(_PathToSet: Text; _NewCDataValue: Text)

Ns BaseDataModel Element 

...


... for new (custom) tags:

  • GetValue(_PathToGet: Text)Text
  • SetValue(_PathToSet: Text; _NewValue: Text)
  • SetValueAsCData(_PathToSet: Text; _NewXmlCData: XmlCData)

  • SetValueAsCData(_PathToSet: Text; _NewCDataValue: Text)


Ns WhseInquiry Element

The "MOB Ns WhseInquiry Element" is used to build "<LookupResponse>"-elements in the WarehouseInquiryDataModel namespace. It is used from the "MOB WMS Lookup" codeunit.

...

    ... for new (custom) tags with no preexisting Get/Set-methods:

  • GetValue(_PathToGet: Text)Text
  • SetValue(_PathToSet: Text; _NewValue: Text)
  • SetValueAsCData(_PathToSet: Text; _NewXmlCData: XmlCData)

  • SetValueAsCData(_PathToSet: Text; _NewCDataValue: Text)

Ns Request Element

The "MOB Ns Request Element" is used to read data from "Request"-XmlDocuments. 

...

  ... for new (custom) tags with no preexisting Get/Set-methods:

  • GetValue(_PathToGet: Text): Text
  • SetValue(_PathToSet: Text; _NewValue: Text)
  • GetContextValue(_PathToGet: Text): Text    - requires Android App 1.5.5 and Mobile WMS 5.22 (or newer)


In legacy versions... 

  • GetValue requires the tag to be in requestData-section of the Xml Request.
  • The tag must have a corresponding HeaderField in the HeaderConfiguration declared for the page.
  • Only tags with corresponding and exactly equally named HeaderFields is transferred from the calling page ("context") to the Xml Request

...