Page tree

Versions Compared

Key

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

...

  1. Replace 
    if (akioma.samples)
    akioma.samples = {};
    akioma.samples.getOrderForeignKeys = function(self) {

    With

    namespace akioma.samples {
        export function getOrderForeignKeys(self) { 

    Use namespaces to avoid naming conflicts. Note that functions must be exported to be used outside the namespace.

  2. Replace self with eventSource: akioma.swat.SwatObject.

    Note that the function parameter does not have to be eventSource. For example: eventGrid eventForm, eventRibbon etc. Although self might be confusing with the JavaScript dynObject.

    Note that the function parameter type does not have to be the generic base SwatObject as in this case. Use the correct Object Type class to avoid casting.

  3. Replace getObject("CustomerDetailsForm") with getForm("CustomerDetailsForm") and getObject("CustomerGrid") with getGrid("CustomerGrid").

    The CLA supports generic traversing functions like getObject(), getLink() etc. which return the generic base SwatObject class object.

    The CLA also supports type specific traversing function like getForm(), getGrid(), getRibbon() etc. to avoid casting.

    Alternatively you can use TypeScript casting. For example: (eventSource.getObject("MyObject") as akioma.swat.Form).

  4. Replace getValue with getDataValue.

    The Form and Grid classes have both a getScreenValue() and getDataValue() functions for getting the field screen value or record value respectively.

    Save (Ctrl-S) and rename (F2) the file as Order/getOrderForeignKeys.ts using the .ts TypeScript file extension (see picture below).

...