繁体   English   中英

如何使用 active() 方法 x++

[英]How to use active() method x++

好的,我做到了。 它工作正常。 感谢帮助。 这是我的代码。 现在我只需要以不同的形式调用我的命令按钮来禁用它并在那里创建一个信息。 任何人都可以看看吗? 在我的代码中,我收到了参考错误。

[ExtensionOf(formdatasourcestr(ProdTableListPage, ProdTable))]
final class ProdParmReportFinishedActiveWG_Extension
{

 public int active()
{
    int ret;
    next Active();

    {
        ProdTable tableBuffer = this.cursor();
        ProdTable prodtable;


        if(tableBuffer.ProdId == tableBuffer.CollectRefProdId
             && tableBuffer.ProdStatus != ProdStatus::ReportedFinished)
            {
               select firstonly RecId,ProdId from ProdTable where
            ProdTable.CollectRefProdId == tableBuffer.ProdId
             && ProdTable.Prodstatus != ProdStatus::ReportedFinished
                && tableBuffer.RecId != prodtable.RecId;
            {
                    Global::info(strFmt("%1 , %2",
            prodtable.prodid, prodtable.recid));

                    // FormButtonControl mybutton = this.FormRun().design().controlname(formControlStr(ProdParmReportFinished, Ok)) as FormButtonControl;
                    //  mybutton.enabled(false);
            }

        }
        else
        {

            Global::info(strFmt("%1 , %2, %3, %4",
            tableBuffer.prodid, tableBuffer.CollectRefProdId, tableBuffer.InventRefType, tableBuffer.ProdStatus));
        }

    }
    return ret;
}

}

“我想每次用户更改他的实际行时都使用此代码,但它只运行一次并应用于我的所有行。”

使用selectionChanged()方法而不是active()

事实上,大多数您认为应该使用 active() 的用例,您可能正在寻找selectionChanged() (或处理程序的 OnSelectionChanged 事件)。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM