CustTable custTable;
boolean a = false; //this boolean a might be changed to true
Query query;
QueryRun queryRun;
Querybuilddatasource qbds;
QuerybuildRange qbr;
Query = new Query();
qbds = query.addDatasource(tablenum(CustTable));
qbr = SysQuery::findOrCreateRange(qbds, (fieldnum(CustTable, AccountNum)));
if (a == true)
{
qbr.value(queryvalue("DEMO-0001"));
}
else
{
qbr.value(queryvalue("DEMO-0002"));
}
QueryRun = new QueryRun(query);
while (queryRun.next())
{
custTable = queryRun.get(tablenum(CustTable));
info(strfmt("AccountNum %1", custtable.AccountNum));
}
目前分類:ERP - Dynamics 365 ( AX) (115)
- Jun 23 Tue 2020 11:58
[Dynamic AX/365] 在SQL中間加入if else使用
- Jun 15 Mon 2020 10:21
[Dynamic AX/D365] 在website link 中取得parameter value
// Get email template from URL
URLUtility urlUtility = new URLUtility();
- Jun 11 Thu 2020 17:30
[Dynamics AX/365] Mobile Work Process
1. 加新work user:
- Jun 03 Wed 2020 15:19
[Dynamics 365] 根據UserInfo的Locale 來計算datetime format sequence
- May 15 Fri 2020 17:20
[Dynamics AX/365] Error Log Exception
SysInfoLogEnumerator infoLogEnum;
SysInfologMessageStruct infoMessageStruct;
- Apr 21 Tue 2020 10:15
[Dynamic AX/D365] Procurement Category && Attribute Type by X++
//procurement attribute
// find or create brand value
- Apr 21 Tue 2020 10:12
[Dynamics AX/365] AX - 通過X ++創建產品並發布產品 (AX2012 && D365 Code)
- Apr 08 Wed 2020 10:44
[Dynamics AX/365] Add dimensions & dimensions lookup to Excel templates
The Excel integration is one of the powerful tools in Microsoft Dynamics 365 for Finance and Operations. This is helpful tool for accountants to push journal entries through Excel to Microsoft Dynamics 365 for Finance and Operations. The out of the box Excel integration does not have the financial dimensions values, but it could be exposed to the Excel integrations. Of course, the importance of financial dimensions specially the entry will be validated based on the account structure setup.
This blog post will illustrate step by step how to Expose the Financial dimensions on Excel integration. This will need to follow certain steps on Dynamics 365 for Finance and Operations client, Visual Studio, and Excel.
- Mar 20 Fri 2020 15:21
[Dynamics D365] Extensible Data Security 可擴展數據安全性 (XDS) in Dynamics AX Finance and Operations
主要:
Primary Table
Constrained Table
- Mar 17 Tue 2020 14:32
[Dymanics AX/365] 開新user && role assign
1. 用admin 身份登入 AAD (Azure active directory) : https://azure.microsoft.com/en-us/services/active-directory/
2. Find User:
- Mar 13 Fri 2020 16:47
[Dynamics AX/D365] X++ Code to verify active stock dimensions base on item (Site,warehouse,location, serialno, batchno.)
- Mar 02 Mon 2020 15:56
[Dynamic AX/D365] Date使用方法
Dynamics AX在不同時區完美工作的能力背後的秘密是其utcDateTime數據類型。它將日期,TimeOfDay和時區信息組合到一個數據類型中,使顧問能夠以更接近我們在日常生活中思考時間的方式來實現與日期和時間相關的要求。與AX中的其他數據類型一樣,utcDateTime也可以根據需要擴展,並用作數據庫字段的後備類型。
utcDateTime transDateTime;
transDateTime = utcDateTimeNull();
transDateTime = DateTimeUtil :: utcNow();
- Feb 28 Fri 2020 10:01
[Dynamic AX/365] D365 找尋account number
- D365 更改了找尋account num 的方法. AX : info(strFmt("%1",DimensionStorage::getDynamicAccount(accountNum , enumValue)))
- Find the account number from business login in D 365.
- Get the financial dimensions from integration.
- Create a journal line from above info.
Code to do above is as follows:
DimensionDynamicAccount ledgerAccount;
switch(<AccountType>)
{
case (LedgerJournalACType::Cust) :
ledgerJournalTrans.AccountType = LedgerJournalACType::Cust;
ledgerAccount = LedgerDynamicAccountHelper::getDynamicAccountFromAccountNumber(<AccountNum>, LedgerJournalACType::Cust);
ledgerJournalTrans.LedgerDimension = ledgerAccount;
break;
case (LedgerJournalACType::Ledger) :
ledgerJournalTrans.AccountType = LedgerJournalACType::Ledger;
ledgerAccount = LedgerDefaultAccountHelper::getDefaultAccountFromMainAccountRecId(MainAccount::findByMainAccountId(<AccountNum>).RecId);
if(<DefaultDimensionIntegrationValues string from integration>)
{
DefaultDimensionIntegrationValues ledgerString = <AccountNum> + enum2Str(DimensionParameters::find().DimensionSegmentDelimiter) + <DefaultDimensionIntegrationValues string from integration>;
LedgerAccountDimensionResolver dimResolver = LedgerAccountDimensionResolver::newResolver(ledgerString);
ledgerAccount = dimResolver.resolve();
}
ledgerJournalTrans.LedgerDimension = ledgerAccount;
break;
case (LedgerJournalACType::Vend) :
ledgerJournalTrans.AccountType = LedgerJournalACType::Vend;
ledgerAccount = LedgerDynamicAccountHelper::getDynamicAccountFromAccountNumber(<AccountNum>, LedgerJournalACType::Vend);
ledgerJournalTrans.LedgerDimension = ledgerAccount;
break;
}
you need to replace <AccountNum> with your Account number variable and <DefaultDimensionIntegrationValues string from integration> with your Financial dimension string.
- Feb 18 Tue 2020 16:01
[Dynamics AX/365] Financial Dimension (1)
class DGS_CommonDimension
{
- Feb 12 Wed 2020 10:07
[Dynamics AX/365] X++ 隱藏 FAST TAB
1. 初次化時 (UI 方法)
On a TabPage control on forms there is a property called FastTabExpanded.
The property controls weather the FastTab appears expanded or collapsed and how this can be changed by the user.
The default value is Auto.
Values:
Auto
Default value. Decision is taken by the system. User settings are considered.
Yes
When a user opens the form for the first time, the FastTab appears expanded. As soon as the user collapses the FastTab, this is getting stored in the users usage data and the next time opening the form the FastTab appears collapsed (or whatever state the user defined for the FastTab before leaving the form).
No
Behaves like the option Yes but on the first opening the FastTab appears collapsed.
Always
The FastTab always appears expanded and the user cannot collapse the FastTab!
- Feb 07 Fri 2020 17:59
[Dynamics AX/365] BatchJob - PostPurchaseReceipt - 加入LOG TABLE IF ERROR, IGNORE THROW ERROR
class DGS_PostPurchaseReceiptServiceTask extends RunBaseBatch
{
- Feb 05 Wed 2020 14:06
[Dynamics AX/365] 更改header 上的button action 後功能
[ExtensionOf(formStr(PurchTable))]
final class DGS_PurchTable_Form_Extension
- Feb 03 Mon 2020 10:46
[Dynamics AX/365] 加financial dimension 到 PurchTable / SalesTable
class DGS_CommonDimension
{
- Jan 31 Fri 2020 15:25
[SQL] USMF sample
-- DimensionAttribute ( Financial Dimension via different table )
select DEFAULTDIMENSION,* from vendtable where DATAAREAID ='usmf'
- Jan 30 Thu 2020 10:12
[Dynamic AX/D365] Event Handler 例子
class DGS_PurchTableFormEventHandler
{