Updating User defined field in POOrder while creating Drop ship PO

雨燕双飞 提交于 2019-12-06 04:51:42
Philippe

The best way would be to attach event handlers on what you need. This is not a simple case but here's an example I wrote a couple months ago. This code is changing the POLine description to add "Test" at the end. You could use it populate your custom fields too.

public class POCreateExt : PXGraphExtension<POCreate>
{
    public override void Initialize()
    {
        PXGraph.InstanceCreated.AddHandler<POOrderEntry>((graph) =>
        {
            graph.RowUpdating.AddHandler<POLine>((sender, e) =>
            {
                POLine line = e.NewRow as POLine;
                POOrderEntry.SOLineSplit3 soLine = PXResult<POOrderEntry.SOLineSplit3>.Current;
                line.TranDesc = soLine.TranDesc + " TEST ";
            });
        });
    }
}
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!