D365 /AX2012添加财务维度主档

 

1. 主表上添加方法renamePrimaryKey

  
[SysClientCacheDataMethodAttribute(true)]
public void renamePrimaryKey()
{
    Common originalRecord = this.orig();
    super();
    DimensionStorage::syncRenamedValue(this, originalRecord);
}

2. 主表上添加方法exist方法

public static boolean exist(PurchContractId _purchContractId)
{
    boolean exist;
    exist = (select firstonly RecId from PurchContractTable
                where PurchContractTable.PurchContractId == _purchContractId).RecId != 0;
    return exist;
}
 

3. 主表上添加方法delete方法

public void delete()
{
    if (!DimensionValidation::canDeleteEntityValue(this))
    {
        throw error(strfmt("@SYS134392", this.PurchContractId));
    }
    ttsbegin;
    // Update the associated dimension attribute value.
    DimensionAttributeValue::updateForEntityValueDelete(this);
    super();
    ttscommit;
}

4. 添加视图并重启AOS或者执行脚本DimensionCache::clearAllScopes()

 

 

 
posted @ 2020-04-09 17:15  Alfred_CN  阅读(268)  评论(0编辑  收藏  举报