zoukankan      html  css  js  c++  java
  • How to refresh current Form when thorugh X++ code influence

    when the User actived the Default BOM LAT Price checkbox on price(Purch.) Form,The ERP system will automatic updated and refresh the account selection(Vendor account) to the InventTable Form(have created Relationship field with Primary vendor account) right now.

    Such as below.

    Wrote by Jimmy on May 5th 2011

    modifiedField method on PriceDiscTable
    public void modifiedField(fieldId _fieldId)
    {
    Tec_PrimaryVendor _PrimaryVendor;
    FormRun FR;
    InventTable InventTable;
    InventTableModule InventTableModule;
    PriceDiscTable PriceDiscTable,updateThis;
    RecId CurRecId
    = this.RecId;
    ;
    super(_fieldId);
    switch(_fieldId)
    {
    case fieldnum(PriceDiscTable,QVS_Default) :
    if(this.QVS_Default == Noyes::Yes &&
    this.Module == ModuleInventCustVend::Vend &&
    this.relation == PriceType::PricePurch &&
    this.AccountCode == TableGroupAll::Table &&
    this.ItemCode == TableGroupAll::Table
    )
    {
    ttsbegin;
    _PrimaryVendor
    = Tec_PrimaryVendor::find(this.ItemRelation,true);

    if (!_PrimaryVendor)
    {
    _PrimaryVendor.ItemId
    = this.ItemRelation;
    _PrimaryVendor.PrimaryVendorId
    = this.AccountRelation;
    _PrimaryVendor.insert();
    }
    else
    {
    _PrimaryVendor
    = Tec_PrimaryVendor::find(this.ItemRelation,true);
    _PrimaryVendor.PrimaryVendorId
    = this.AccountRelation;
    _PrimaryVendor.update();

    //Jimmy 2010-06-10 ++
    InventTable = InventTable::find(this.ItemRelation,true);
    if(InventTable)
    {
    InventTable.ItemBuyerGroupId
    = VendTable::find(this.AccountRelation).ItemBuyerGroupId;
    InventTable.update();
    }
    //Jimmy 2010-06-10 --
    }
    ttscommit;

    //Jimmy 2010-06-10 ++
    ttsbegin;
    InventTableModule
    = InventTableModule::find(this.ItemRelation,ModuleInventPurchSales::Invent,true);
    if(InventTableModule.Price == 0)//if(InventTableModule)////2010-07-27
    {
    InventTableModule.Price
    = this.ItemCostPrice_Purch();
    InventTableModule.update(
    true);
    }
    ttscommit;
    //Jimmy 2010-06-10 --;

    if(infolog.globalCache().get(FormStr(InventTable),"RefreshCurrentForm"))
    {
    fr
    = infolog.globalCache().get(FormStr(InventTable),"RefreshCurrentForm");
    InventTable
    = InventTable::find(this.ItemRelation);

    fr.dataSource(
    "InventTable").reread();
    fr.dataSource(
    "InventTable").research();
    fr.dataSource(
    "InventTable").refresh();
    fr.dataSource(
    "InventTable").findRecord(InventTable);
    }

    }
    else
    {
    select firstonly PriceDiscTable
    where PriceDiscTable.QVS_Default == Noyes::Yes &&
    PriceDiscTable.Module
    == ModuleInventCustVend::Vend &&
    PriceDiscTable.relation
    == PriceType::PricePurch &&
    PriceDiscTable.AccountCode
    == TableGroupAll::Table &&
    PriceDiscTable.ItemCode
    == TableGroupAll::Table &&
    PriceDiscTable.ItemRelation
    == this.ItemRelation &&
    PriceDiscTable.RecId
    != this.RecId;

    if(PriceDiscTable)
    this.UpdateMainVendor(PriceDiscTable);
    }
    break;
    default :
    break;
    }
    }

    init method of InventTable(Form)
    public void init()
    {
    ;
    super();

    infolog.globalCache().
    set(FormStr(InventTable),"RefreshCurrentForm",element);

    }
    canClose method of InventTable(Form)
    public boolean canClose()
    {
    boolean ret;

    ret
    = super();
    infolog.globalCache().remove(FormStr(InventTable),
    "RefreshCurrentForm");
    return ret;
    }
  • 相关阅读:
    「Luogu」2831愤怒的小鸟 (DFS+dp)
    LeetCode习题集
    递归的时间复杂度你真的懂吗?不是所有的二分递归都是logn级别
    [数据结构篇]谈一谈优先队列吧!
    论文爱好者(我不是)的福利
    Python 读微博留言进行情感分析(文本分类)
    python 多进程中的p.apply_async()
    记录本科论文开题报告修改过程
    KMP字符串匹配算法
    Pandas Timedelta
  • 原文地址:https://www.cnblogs.com/Fandyx/p/2037769.html
Copyright © 2011-2022 走看看