Thursday, 11 October 2018

Add new user in management Reporter in ax 2012 X++

https://blogs.msdn.microsoft.com/axinthefield/management-reporter-2012-security-review-with-ax-2012/

https://blogs.msdn.microsoft.com/axinthefield/how-to-change-your-management-reporter-data-mart-scheduling-for-dynamics-ax-2012/

http://rahulmsdax.blogspot.com/2014/10/how-to-install-management-reporter-in.html

Name Interval UnitOfMeasure
AX 2012 Transaction Type Qualifiers to Fact Type Qualifier 1 Minutes
AX 2012 Scenarios to Scenario 5 Minutes
AX 2012 Organization Hierarchies to Tree 300 Seconds
AX 2012 General Ledger Transactions to Fact 1 Minutes
AX 2012 Fiscal Years to Fiscal Year 1 Minutes
AX 2012 Exchange Rates to Exchange Rate 5 Minutes
AX 2012 Dimensions to Dimension 5 Minutes
AX 2012 Dimension Values to Dimension Value 5 Minutes
AX 2012 Dimension Combinations to Dimension Combination 1 Minutes
AX 2012 Companies to Organization 5 Minutes
AX 2012 Companies to Company 300 Seconds
AX 2012 Accounts to Account 5 Minutes
AX 2012 Account Categories to Account Category 5 Minutes

Wednesday, 10 October 2018

Number sequence for purchase external packing slip number in ax 2012 X++

Problem.
It is a common case that users don’t want to manually enter external packing slip number while posting purchase packing slip. 
In Microsoft Dynamics, we can set number sequence only for internal packing slips, 
But there is no possibility to use the same numbers for external documents or assign another number sequence for them. 
The objective was to hide „Packing receipt” field and use the same number sequence as for internal purchase packing slips.

Tool.
I used the same objects, which are responsible for taking user’s input in „Product receipt” field and making it packing slip identifier.

Step by step.
What we have to do is:

1. Hide „Product receipt” field from PurchEditLines form so the user will not be able to enter any value.
2. Disable „FormLetterId” value validation for packing slips while posting a document as it is assigned later.
3. Use internal packing slip ID for external packing slip ID.

So…

1. PurchEditLinesForm_PackingSlip.num() method is indicating whether „Product receipt” field is visible or not. 
We have to modify it to return false.

\Classes\PurchEditLinesForm_PackingSlip

public boolean num()
{
return false;
// orig return true;
}
view rawNumber sequence for purchase external packing slip number [Dynamics AX2012; X++] hosted with by GitHub
2. After confirming that we want to post packing slip, system validates if packing slip ID is defined. 
We are setting it later, so let’s disable this validation, which happens in PurchSummary.checkFormLetterId() method.

\Classes\PurchSummary

public boolean checkFormLetterId(str _errorText)
{
...
this.setFormLetterIdFromTrans(VendDocumentSubTableMap::header(parmSubTable).Num);

// START Number sequence for purchase external packing slip number [Dynamics AX2012; X++]
if (documentStatus != DocumentStatus::PackingSlip)
// END Number sequence for purchase external packing slip number [Dynamics AX2012; X++]
if (!strLTrim(this.formLetterId()))
{
Ok = checkFailed(strFmt(_errorText, purchTable.PurchId));
}
// START Number sequence for purchase external packing slip number [Dynamics AX2012; X++]
}
// END Number sequence for purchase external packing slip number [Dynamics AX2012; X++]
...
}
View rawNumber sequence for purchase external packing slip number [Dynamics AX2012; X++] hosted with by GitHub
3. No we can use our internal packing slip number sequence values for external document. 
Packing slip header is initialized before we get the ID from sequence number, so we have to pick it earlier, and assign it to our external packing slip ID. The code in PurchPackingSlipJournalCreate class will look like this:

\Classes\PurchPackingSlipJournalCreate

public void initHeader()
{
...
// START Number sequence for purchase external packing slip number [Dynamics AX2012; X++]
if (!internalNumber)
{
[journalNumber, internalNumber, voucher] = this.getNumAndVoucher();
}

purchParmTable.Num = internalNumber;
vendPackingSlipJour.PackingSlipId = purchParmTable.Num;
// END Number sequence for purchase external packing slip number [Dynamics AX2012; X++]
...
}

protected void createJournalVersion()
{
FormLetterContract purchFormLetterContract = this.parmInterCompanyFormletterContract();
    
// START Number sequence for purchase external packing slip number [Dynamics AX2012; X++]
// orig [journalNumber, internalNumber, voucher] = this.getNumAndVoucher();
// END Number sequence for purchase external packing slip number [Dynamics AX2012; X++]

...
}
view rawNumber sequence for purchase external packing slip number [Dynamics AX2012; X++] hosted with by GitHub
That’s all. „Product receipt” isn’t visible now and it is automatically taken from the internal number sequence.

workflow business event configuration with power automate flow in d365 FO

  https://www.linkedin.com/pulse/purchase-order-approvals-d365fo-power-automate-ahmed-ali-el-bardisy-jyssf/