本文介绍了根据在Axapta中修改的主表字段,自动更改字段值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有两个表WI_MachineDrawing和BOM.有两个常见的调用,分别是RevNo和WI_MachineDrawngNumber.现在,当我更改Wi_MachineDrwawng提交的RevNo时,我想做些事情,然后应根据WI_MachineDrawing RevNo字段修改BOM RevNo.

I have two table WI_MachineDrawing and BOM. There is two common filed call RevNo and WI_MachineDrawngNumber. Now I want to do something when i alter Wi_MachineDrwawng filed RevNo then BOM RevNo should be modified according to WI_MachineDrawing RevNo field.

推荐答案

在RevNo更改时,重写表WI_MachineDrawing上的ModifyField方法以更新BOM表中的字段:

Override the modifiedField method on the table WI_MachineDrawing to update the field in BOM when RevNo changes:

public void modifiedField(fieldId _fieldId)
{
    BOM BOM;
    ;
    super(_fieldId);
    switch(_fieldId)
    {
        case fieldnum(WI_MachineDrawing, RevNo):
            update_recordset BOM 
                setting RevNo = this.RevNo
                where BOM.WI_MachineDrawingNumber = this.WI_MachineDrawingNumber;
            break;
    }
}

这篇关于根据在Axapta中修改的主表字段,自动更改字段值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-25 18:20