gpt4 book ai didi

axapta - 如何在 ListPageInteraction 类中获取表单对象?

转载 作者:行者123 更新时间:2023-12-04 18:40:20 24 4
gpt4 key购买 nike

使用 Microsoft Dynamics AX 2012。

我有一个 listpage form其中有一个引用 ListPageInteraction类,只是想更改一些控件的标签/标题。为此,我需要做类似的事情:

element.form().design().control('<YourControlName>');

但我无法在 ListPageInteraction 上获得此方法类(class)。我决定研究类的初始化方法。但是无法从那里访问表单,如何访问控件和设置标签?

最佳答案

common = this.listPage().activeRecord('Table');
if(common.isFormDataSource())
{
fds = common.dataSource();
fds.formRun().control(fds.formRun().controlId('ControlOfScreen')).
userPromptText('New Description');
}

projProjectTransListPageInteraction.initializeQuery() 透视图的另一个示例从 projProjectTransactionsListPage 表单上的网格更改 TransDate 字段的标签

public void initializeQuery(Query _query)
{
QueryBuildRange transDateRange;
// ListPageLabelChange =>
Common externalRecord;
FormDataSource frmDs;
FormRun formRun;
FormControl frmCtrl;
// ListPageLabelChange <=
;

queryBuildDataSource = _query.dataSourceTable(tableNum(ProjPostTransView));
transDateRange = SysQuery::findOrCreateRange(queryBuildDataSource, fieldNum(ProjPostTransView, TransDate));

// Date range is [(today's date - 30)..today's date] if not showing transactions for a particular project.
// Date range is [(dateNull())..today's date] if showing transactions for a particular project so that all transactions are visible.
transDateRange.value(SysQuery::range(transStartDate, systemDateGet()));

this.linkActive(_query);

// ListPageLabelChange =>
externalRecord = this.listPage().activeRecord(_query.dataSourceTable(tableNum(ProjPostTransView)).name());//No intrisic function for form DS?
if(externalRecord.isFormDataSource())
{
frmDs = externalRecord.dataSource();
formRun = frmDs.formRun();
if(formRun)
{
frmCtrl = formRun.design().controlName(formControlStr(projProjectTransactionsListPage,TransDate));
if(frmCtrl)
{
frmCtrl.userPromptText("newName");
}
}
}
// ListPageLabelChange <=
}

关于axapta - 如何在 ListPageInteraction 类中获取表单对象?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6937986/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com