最新消息:ww12345678 的部落格重装上线,希望大家继续支持。

Using Temporary Table as Form’s Datasource

网络文摘 William 1550浏览 0评论

First add a method on the form to populate records in the temporary table:

public LabelsTable populateRecords()
{
    SysDictTable dictTable = new SysDictTable(tableNum(PurchLine));
    SysDictField dictField;
    TreeNode treeNode;
    LabelsTable labelsTableLocal; // Temporary table (InMemory)
    FieldId fieldId = dictTable.fieldNext(0);

    while (fieldId)
    {
        dictField = dictTable.fieldObject(fieldId);

        if (dictField.isSql() && !dictField.isSystem() && dictField.name() != "Modified")
        {
            treeNode = dictField.treeNode();
            labelsTableLocal.Field = dictField.name();
            labelsTableLocal.Label = treeNode.AOTgetProperty("Label");
            labelsTableLocal.insert();
        }

        fieldId = dictTable.fieldNext(fieldId);
    }

    return labelsTableLocal;
}

Then override form’s init() method and add the following code to display the temporary table data on the form:

public void init()
{
    super();

    LabelsTable.setTmpData(element.populateRecords());
}

转载请注明:ww12345678 的部落格 | AX Helper » Using Temporary Table as Form’s Datasource

发表我的评论
取消评论

表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址