Tuesday 7 February 2017

How to convert formatted string to num in Dynamics 365

Hi All,

Recently I came with a requirement where I need to compute a string of multiple calculation as shown in an example below:

int a = 100;
int b = 10;
int c = 5;
int d = 10;
Str s = "(a+b)/c*d"
need to get the calculated value for 's'.
str s could contain 'n' number of operation.
If it's Ax 2012 then we can use "formattedstr2num()" or "evalBuf()" but as these are deprecated from Dynamics 365, so here's an exact replacement for these inbuild function:
"ProdMathEvaluator::evaluate()"
Example:
Try to run the below code in job, it will help you to understand the code:
str expr = "(((1+2)*6)/5)";
info(num2str(ProdMathEvaluator::evaluate(expr),0,2,1,3));
Note: If you get the below error:
"Misuse of "Our expression", Please review the elements and symbols used in the equation."

This error comes with "ProdMathEvaluator::evaluate()" method, when our equation contains ',' symbol which majorly happens if value is greater than 999 like 1,000.0.
For this try to use strRem() to resolve the issue as follows:

ProdMathEvaluator::evaluate(strRem(expr, ','));



Best Regards
Pranav Gupta

Thursday 19 January 2017

Segment Entry control migration guideline from Ax 2012 to Dynamics 365 Ax.

Hi,

Below is the link for "How to use Segment entry control in Dynamics AX 365 "

https://ax.help.dynamics.com/en/wiki/segmented-entry-control-migration-guidance/



For Example:

First overwrite the methods as shown in the below screen shot for Segment entry control:




Code inside the lookUp method does the main part:

The LedgerJournalEngine.accountNumLookup check the AccountType and work accordingly.





Best Regards
Pranav

Help Wiki for Dynamics 365

Hi All,

Below link is a Help Wikipedia to find all  the new concepts and features available in Dynamics 365 for Operations.




Best Regards
Pranav 

Insert/Update or remove the default dimension value in D365 FSCM via x++

Use below method to insert/update the dimension values, just pass the parameter values to the method and it will return the updated value: p...