[DataEventHandler(tableStr(CustTable), DataEventType::Inserting)]
    public static void CustTable_onInserting(Common sender, DataEventArgs e)
    {
        CustTable custTable = sender as CustTable;

        custTable.inventSiteId = InventParameters::find().DGS_MainInventSiteId;
        CustTable.InventLocation = InventParameters::find().DGS_MainInventLocationId;

        if(!CustTable.CustGroup)
            CustTable.CustGroup = THK_FileInterfaceParameters::find().CustGroupId;

        if(!CustTable.DGS_CustNature)
            CustTable.DGS_CustNature = THK_FileInterfaceParameters::find().DGS_CustNature;
    }

    /// <summary>
    ///
    /// </summary>
    /// <param name="args"></param>
    [PreHandlerFor(tableStr(CustTable), tableMethodStr(CustTable, validateWrite))]
    public static void CustTable_Pre_validateWrite(XppPrePostArgs args)
    {
        CustTable custTable = args.getThis() as CustTable;

        if(!CustTable.CustGroup)
            CustTable.CustGroup = THK_FileInterfaceParameters::find().CustGroupId;

        if(!CustTable.DGS_CustNature)
            CustTable.DGS_CustNature = THK_FileInterfaceParameters::find().DGS_CustNature;

    }


In Table Datasource Events --> right click on Init Value--> Copy Post Event Handlers
Create new Class and below code

Table Method Event Handler
 

class test_PurchTableEventHanlders
{
    /// <summary>
    ///
    /// </summary>
    /// <param name="args"></param>
    [PostHandlerFor(tableStr(PurchTable), tableMethodStr(PurchTable, initValue))]
    public static void PurchTable_Post_initValue(XppPrePostArgs args)
    {
        PurchTable purchTable = args.getThis() as PurchTable;
        purchTable.test_PrintNote=NoYes::Yes;
    }

}


lionlionchopper 發表在 痞客邦 留言(0) 人氣()

1.網站 -- >  http://formatmysourcecode.blogspot.tw/

2.將所需要的程式碼填入其中

lionlionchopper 發表在 痞客邦 留言(0) 人氣()

  [DataSource]
    class SalesTable
    {
        /// <summary>
        ///
        /// </summary>
        /// <param name = "_append"></param>
        public void create(boolean _append = false)
        {

            SalesTableForm  salesTableForm;

            super(_append);
            salesTableForm =   SalesTableForm::construct(SalesTableFormId::None, element.args().record());
            
            if (salesTableForm.create())
            {
                SalesTable newSalesTable = salesTableForm.salesTable();

                if (newSalesTable)
                {
                    // refresh screen on datasource:
                    salesTable.data(newSalesTable);
                    salesTable_ds.setCurrent();
                    salesTable_ds.executeQuery();

                    Args args = new Args();
                    args.record(newSalesTable);

                    MenuFunction menuFunction = new MenuFunction(menuitemDisplayStr(SalesTable), MenuItemType::Display);
                    menuFunction.run(args);
                }
            }
        }

    }

lionlionchopper 發表在 痞客邦 留言(0) 人氣()

使用formRun.wait(); 如果要停止執行直到關閉窗體。

或使用formRun.detach(); 如果您要讓表格單獨運行。

lionlionchopper 發表在 痞客邦 留言(0) 人氣()

[ExtensionOf(formStr(InventOnhandItem))]
final class DGS_InventOnhandItem_Extension

lionlionchopper 發表在 痞客邦 留言(0) 人氣()

    /// <summary>
    /// 在POST Run時用新method 取代本來的method
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    [FormEventHandler(formStr(WMSJournalTable), FormEventType::PostRun)]
    public static void WMSJournalTable_OnPostRun(xFormRun sender, FormEventArgs e)
    {
        FormDateControl   formCtrl = sender.design().controlName(formControlStr(WMSJournalTable, WMSJournalTrans_DGS_ExpDate));
        formCtrl.registerOverrideMethod(methodStr(FormDateControl, jumpRef), methodStr(DGS_WMSJournalTableForm_Extension, DGS_ExpDate_jumpRefId), sender);

        FormFunctionButtonControl   formMenuCtrl = sender.design().controlName(formControlStr(WMSJournalTable, PostJournal));
        formMenuCtrl.registerOverrideMethod(methodStr(FormFunctionButtonControl, clicked), methodStr(DGS_WMSJournalTableForm_Extension, PostJournal_clicked), sender);
    }

 

另外開一個extension:

lionlionchopper 發表在 痞客邦 留言(0) 人氣()

image

前幾天,當我嘗試為Dynamics 365 Finance and Operations測試自定義數據實體時,收到此錯誤“Configuration key not enabled for the entity” 我之前在另一個項目上曾見過該錯誤,但完全忘記瞭如何修復它。 如果是新刷新的環境,或者您創建了自定義數據實體,並嘗試首次使用它,則可能導致此錯誤。 解決方案是刷新數據實體列表,並且我將在本文中逐步詳細介紹如何進一步執行此操作。

lionlionchopper 發表在 痞客邦 留言(0) 人氣()

分享有關Dynamics AX 2012中使用的時區和用於在SQL中存儲UTCDateTime值的TZId值的概述。

Timezone description TimeZone TZId field
(GMT-12:00) International Date Line West 24 24001
(GMT-11:00) Midway Island, Samoa 65 65001
(GMT-10:00) Hawaii 39 39001
(GMT-09:00) Alaska 2 2001
(GMT-08:00) Pacific Time (US &amp; Canada) 58 58001
(GMT-08:00) Tijuana, Baja California 59 59001
(GMT-07:00) Arizona 75 75001
(GMT-07:00) Mountain Time (US &amp; Canada) 47 47001
(GMT-07:00) Chihuahua, La Paz, Mazatlan 48 48001
(GMT-06:00) Central America 15 15001
(GMT-06:00) Central Time (US &amp; Canada) 21 21001
(GMT-06:00) Guadalajara, Mexico City, Monterrey 22 22001
(GMT-06:00) Saskatchewan 11 11001
(GMT-05:00) Bogota, Lima, Quito, Rio Branco 63 63001
(GMT-05:00) Eastern Time (US &amp; Canada) 29 29001
(GMT-05:00) Indiana (East) 74 74001
(GMT-04:00) Atlantic Time (Canada) 6 6001
(GMT-04:00) La Paz 64 64001
(GMT-04:00) Manaus 17 17001
(GMT-04:00) Santiago 57 57001
(GMT-04:30) Caracas 85 85001
(GMT-03:30) Newfoundland 54 54001
(GMT-03:00) Brasilia 28 28001
(GMT-03:00) Buenos Aires, Georgetown 62 62001
(GMT-03:00) Greenland 36 36001
(GMT-03:00) Montevideo 83 83001
(GMT-02:00) Mid-Atlantic 45 45001
(GMT-01:00) Azores 10 10001
(GMT-01:00) Cape Verde Is. 12 12001
(GMT) Casablanca, Monrovia, Reykjavik 37 37001
(GMT) Greenwich Mean Time : Dublin, Edinburgh, Lisbon, Londo 35 35001
(GMT+01:00) Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna 79 79001
(GMT+01:00) Belgrade, Bratislava, Budapest, Ljubljana, Pragu 18 18001
(GMT+01:00) Brussels, Copenhagen, Madrid, Paris 60 60001
(GMT+01:00) Sarajevo, Skopje, Warsaw, Zagreb 19 19001
(GMT+01:00) West Central Africa 78 78001
(GMT+02:00) Amman 43 43001
(GMT+02:00) Athens, Bucharest, Istanbul 38 38001
(GMT+02:00) Beirut 46 46001
(GMT+02:00) Minsk 27 27001
(GMT+02:00) Cairo 30 30001
(GMT+02:00) Harare, Pretoria 68 68001
(GMT+02:00) Helsinki, Kyiv, Riga, Sofia, Tallinn, Vilnius 33 33001
(GMT+02:00) Jerusalem 42 42001
(GMT+02:00) Windhoek 51 51001
(GMT+03:00) Baghdad 5 5001
(GMT+03:00) Kuwait, Riyadh 3 3001
(GMT+03:00) Moscow, St. Petersburg, Volgograd 61 61001
(GMT+03:00) Nairobi 25 25001
(GMT+03:00) Tbilisi 34 34001
(GMT+03:30) Tehran 41 41001
(GMT+04:00) Abu Dhabi, Muscat 4 4001
(GMT+04:00) Baku 9 9001
(GMT+04:00) Caucasus Standard Time 84 84001
(GMT+04:00) Yerevan 13 13001
(GMT+04:30) Kabul 1 1001
(GMT+05:00) Ekaterinburg 31 31001
(GMT+05:00) Islamabad, Karachi, Tashkent 80 80001
(GMT+05:30) Chennai, Kolkata, Mumbai, New Delhi 40 40001
(GMT+05:30) Sri Jayawardenepura 69 69001
(GMT+05:45) Kathmandu 52 52001
(GMT+06:00) Almaty, Novosibirsk 50 50001
(GMT+06:00) Astana, Dhaka 16 16001
(GMT+06:30) Yangon (Rangoon) 49 49001
(GMT+07:00) Bangkok, Hanoi, Jakarta 66 66001
(GMT+07:00) Krasnoyarsk 56 56001
(GMT+08:00) Beijing, Chongqing, Hong Kong, Urumqi 23 23001
(GMT+08:00) Irkutsk, Ulaan Bataar 55 55001
(GMT+08:00) Kuala Lumpur, Singapore 67 67001
(GMT+08:00) Perth 77 77001
(GMT+08:00) Taipei 70 70001
(GMT+09:00) Osaka, Sapporo, Tokyo 72 72001
(GMT+09:00) Seoul 44 44001
(GMT+09:00) Yakutsk 82 82001
(GMT+09:30) Adelaide 14 14001
(GMT+09:30) Darwin 7 7001
(GMT+10:00) Brisbane 26 26001
(GMT+10:00) Canberra, Melbourne, Sydney 8 8001
(GMT+10:00) Guam, Port Moresby 81 81001
(GMT+10:00) Hobart 71 71001
(GMT+10:00) Vladivostok 76 76001
(GMT+11:00) Magadan, Solomon Is., New Caledonia 20 20001
(GMT+12:00) Auckland, Wellington 53 53001
(GMT+12:00) Fiji, Kamchatka, Marshall Is. 32 32001
(GMT+13:00) Nuku’alofa 73 73001

lionlionchopper 發表在 痞客邦 留言(0) 人氣()

Full Set:

image

lionlionchopper 發表在 痞客邦 留言(0) 人氣()

D365FO , rebuild index after updated:

UAT- Batch Job to rebuild

lionlionchopper 發表在 痞客邦 留言(0) 人氣()