Blog Posts



SQL error description: [Microsoft][SQL Server Native Client 11.0][SQL Server]Cannot drop the index ‘WORKFLOWTRACKINGTABLE
because it does not exist or you do not have permission.


Results in synchronization failure.
Resolution :

1. Table a backup of the DB.

2. Delete the particular index from SQL side and synchronize the respective table in application



In the Tablix property of the grid we add the filter in any rages.


1. All the operator are common and except  < > . This < > for != Not equals to ranges.

2. We cant add multiple ranges of same filed in same expression values whereas we need to create n number of filters against the expression to add ranges accordingly.

3. Working on Row visibiliy expression is not recomended to achiew this ranges.

4. To have AND condition in the value needs to add between Value1 and Value2




Alternative colors without any scope or condiction.

=iif(RowNumber(Nothing) Mod 2, “#ffffff”, “#f0f0f0”)

Alternative colors with scope or condiction.

=IIF(RunningValue(Fields!CustId.Value, CountDistinct, Nothing) MOD 2 = 1, “#ffffff”, “#f0f0f0”)

We can display alternative colors based on distinct running values or by parent groups or specific condition like

=IIF(Fields!Amount.Value > 35000 , “#ffffff”, “#f0f0f0”)

Even we can achive group with in group cases and Matrix cases by selecting particular cells.




class DpayExportCSV


/// <summary>

/// Runs the class with the specified arguments.

/// </summary>

/// <param name = “_args”>The specified arguments.</param>

public static void main(Args _args)


CommaStreamIo commaStreamIo = CommaStreamIo::constructForWrite();

SalesTable       SalesTable;

SalesLine       SalesLine;

FilePath  tempDir = “C:\Temp\SalesTable.csv”;

// #define.filename(@’C:TempSalesTable.csv’)


const str fileName = ‘SalesTable.csv’;

commaStreamIo.writeExp([‘Level’, ‘SalesId’, ‘CustAccount’,’DlvTerm’]); // Header

while select * from SalesTable


commaStreamIo.writeExp([‘OH’, SalesTable.SalesId, SalesTable.CustAccount,SalesTable.DlvTerm]);

while select SalesLine where SalesLine.SalesId ==  SalesTable.SalesId


commaStreamIo.writeExp([‘OL’, SalesLine.ItemId, SalesLine.SalesQty, SalesLine.InventDimId]);

//// You may further add your componbenets table below to this within this loop



System.IO.Stream stream = commaStreamIo.getStream();

stream.Position = 0;

FileUploadTemporaryStorageResult result = File::SendFileToTempStore_GetResult(stream, fileName);

// System.IO.File::Move(result.getFileName(),tempDir);

System.IO.StreamReader sReader = new System.IO.StreamReader(result.openResult());

// Set file contentn string

str  fileContent = sReader.ReadToEnd();


// Save file

File::SendStringAsFileToUser(fileContent, tempDir);

//  File::SendFileToTempStore(stream,”\C:\Temp\SalesTable.csv”);


Message::Add(MessageSeverity::Informational, result.getDownloadUrl());






The integration between 2 application/platform to perform the action of integration is termed as API (Application programming interface).

Integration will be in the forms of URL that contains service address with hosted location (server).

REST and SOAP are the 2 API services.

The REST and SOAP has its own unique properties and behaviour.

SOAP will support only XML structure of data format.

REST supports all the structure of data format viz JSON.

WSDL (Web Services Description Language) based call services are SOAP API.

AX 2012 cannot be integrated directly from any API, for that we have to create serviceReference in Visual Studio and to be deploy the project in AOT to consume the functions and object present in that services.

AX2012 supports only SOAP web services.

D365 can be integrated by custom web services or ODATA. It creates 2 endpoints one for REST and other of SOAP.


To recreate the DDL please follow below procedure
If you would like to generate the script with data please select Advance in that Advanced Scripting Option please select the type of data to script : Schema and data


on Successful finish of this wizard will open a script window and we can save or share to other instance to regenerate the DDL




There are 2 ways to add admin user in to an instance.

1. System Administrator User Import from Acive Directory.

2. Using admin user provisioning tool.

Using admin user provisioning tool.

1. Run the AdminUserProvisioning shortcut placed in desktop of AOS server.

2. Enter the email address of the account has AAD ( Azure Active directory) and Submit.








Note: Shortcut is not available in desktop, please check below URL




We cant override CanSubmitToWorkflow to return our boolean on any eventHandler’s return like eventHandler of ValideWrite(). To achiew we have to set the args of CanSubmitToWorkflow() to be decided by our code.

[PostHandlerFor(formStr(CustTable), formMethodStr(CustTable, canSubmitToWorkflow))]

public static void CustTable_Post_canSubmitToWorkflow(XppPrePostArgs args)


FormRun     form = args.getThis();

FormDataSource      custTable_ds = form.dataSource(formDataSourceStr(custTable,CustTable)) as FormDataSource;

custTable           custTable    = custTable_ds.cursor();

if (custTable.RecId && custTable.DocumentStatus == DocumentStatus::NotSubmitted)











Select particular parent table (master table) db.table.
1. Right click select design
2. Select the respective field where we have to achieve unique index but not primary.
Right click on that filed select Indexs/keys…








3. Add the select the column to from that list and please make sure you change the property to YES in isUnique.

4. Save and select the design of transaction table where we try to achive Foreign key.
Right click on that particular filed and choose Relationships..


5. Add the relationship by select the tables and columns specifics.






static void CreateRandomNumbersInAX(Args _args)


RandomGenerate randomGenerate;


randomGenerate = RandomGenerate::construct();

randomGenerate.parmSeed(new Random().nextInt());

info(int2str(RandomGenerate.randomInt(0,2147483647)));   //RandomInt(RangeFrom,RangeTo)

//Note: Range from should be more than natural number 0 and more.




To understand the formula behind this random number please refer randomInt() in RandomGenerate class.

The formula in randomNumber generation is not similar to library function of dotnet.

Note: We cannot treat this randomGenerated Values as primary key, this may repeat with same range.


//< What is GUID>

// GUID 16 bit large range of alphanumeric similar to RecID to treat as primary key of a table.

static void CreateGUIDInAX(Args _args)


str 60 strGuid;


info(Winapi::createGUID());         // Creates GUID and removes the braces

info(guid2str(newGuid()));           // Creates GUID with braces

//NOTE: GUID is not a string so we needs to convert GUID to str for using…





note: Your output and mine needs to be same.




static void AlfRound(Args _args)


Amount  amount = 5578.59;

info(strfmt(“Amount %1”, amount)); // Printing the original values

info(strfmt(“Round,1  – %1”, round(amount,1))); // This performs standard operation of round and removes the decimal.

info(strfmt(“roundDown,1 – %1”, roundDown(amount,1)));  //Always round by down with ones position, if you make 100 then output will be 5,500.00

info(strfmt(“roundDownDec,1 – %1”, roundDownDec(amount,1))); // Down rounding only the decimal values

info(strfmt(“roundUpDec,1 – %1”, roundUpDec(amount,1))); //Up rounding only the decimal values

info(strfmt(“roundup,1 – %1”, roundup(amount,1))); //Always round by down with ones position, if you make 100 then output will be 5,600.00

info(strfmt(“roundUp(roundUp,1) – %1”, roundUp(roundup(amount,1),1))); // Roud the rounded amount will not make any changes in the rounded amount.

info(strfmt(“decround,1 – %1”, decround(amount,1))); // It performs the standard operation of round in decimal










// Minimum dateTime and Maximum DateTime

utcdatetime                 minDateTime = DateTimeUtil::minValue();

utcdatetime                 maxDateTime = DateTimeUtil::maxValue();

// Minimum date and Maximum Date
TransDate                 minDate = dateNull();

TransDate                 maxDate = dateMax();



The date value retuned by umAlQuraCalendar is not in the range of AX / 365 TransDate allowed. TransDate support from 1/1/1900 to 1/1/2155. You might be noticed Never as dateMax() value in AX tables, All those never is nothing but 1/1/2155.

Please find following script to convert Gregorian to Hijri with date separator “-“.

I got an requirment to convert the date where Integrating system is not accepts 29-4-1442, API is looking for 29-04-1442

I added 0 before to the day and month if its less than 9.

Most of the functions available in umAlQura returns or accepts int32, please make sure you convert before you proceed with.

NOTE: Please dont try to covert the string what hijri returns to transDate, that results in error.

public static str 30 Gregorian2Hijri(TransDate _transDate)


System.Globalization.UmAlQuraCalendar umAlQuraCalendar = new System.Globalization.UmAlQuraCalendar();

System.Globalization.GregorianCalendar gregorianCalendar = new System.Globalization.GregorianCalendar();

str yearStr, monthStr, dayOfMonthStr;


yearStr = umAlQuraCalendar.GetYear(_transDate);

monthStr = umAlQuraCalendar.GetMonth(_transDate);

dayOfMonthStr = umAlQuraCalendar.GetDayOfMonth(_transDate);

if(strLen(monthStr) == 1)

monthStr = “0”+monthStr;

if(strLen(dayOfMonthStr) == 1)

dayOfMonthStr = “0”+dayOfMonthStr;

return strFmt(“%1-%2-%3”,dayOfMonthStr,monthStr,yearStr);




If you experience anytime SSRS reports prompts for user credentails in Dynamics AX / 365, then the respective datasets in report may use type of AXREPORTDATAPROVIDER / AXQUERY doesn’t parse the users credentails during report run time to DataSource in SSRS DB (ReportServer).

Integrated Windows Authentication(IWA) is the microsoft authentication protocal, using windows login credentials to autheticate the Microsoft product. In Dynamics AX 2009 / 2012 R2 / 2012 R3 uses IWA. If an application is not opening or running close and reopens same way we needs to to SSRS too.

Solution: We needs refresh the credentails flow, so drop the contents in reports folder and recreate and redeploy all the reports




Morphx is the Microsoft Dynamics AX development environment, We all the developers are familiar with this development environment. Only SSRS and retails developments are going on Visual studio, whereas Microsift Dynamics AX 2012 R3 CU 13 support Visual Studio as development environment.

Microsoft Dynamics AX and Visual Studio are integrated through Visual Studio Tools. VS Tools is a enables the AOT objects in VS for the development for Microsoft Dynamics AX.

The AOT objects are IDE(Integrated Development Environment) with VS by VS tools.

For more details click here