How to update Kit Assembly extension table fields after releasing Kit Assembly?

独自空忆成欢 提交于 2020-06-01 06:32:48

问题


IN Kit Assembly screen, once i release Kit Assembly then i can never update INKitAssembly,

But I have to allow KitAssembly Extension table fields to update. how may i allow to update custom fields added in INRegister(InKitAssembly) extension table?

Is there a way to update InKitAssembly extension table fields on Release operation completion, DO you have any call back delegate after Release kitAssembly long operation completion?


回答1:


Updating your extension values in the INReleaseProcess persist should work. Something like this:

public class INReleaseProcessExte : PXGraphExtension<INReleaseProcess>
{
    [PXOverride]
    public virtual void Persist(Action del)
    {
        foreach (INTran row in Base.intranselect.Cache.Updated)
        {
            if (row?.DocType != INDocType.Production || row.Released != true)
            {
                continue;
            }

            // update your extension here
            var inTranExt = PXCache<INTran>.GetExtension<INTranMyExtension>(row);
            inTranExt.MyField = "X";
            Base.intranselect.Update(row);
        }

        del?.Invoke();
    }
}


来源:https://stackoverflow.com/questions/61660919/how-to-update-kit-assembly-extension-table-fields-after-releasing-kit-assembly

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!