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



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


Results in synhronization failure.

Resolution :

1. Table a backup of the DB.

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


How to add ranges in SSRS in design level


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 row colors with different scope in SSRS


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.


Jobs to export CSV from D365


class DpayExportCSV



/// Runs the class with the specified arguments.


/// The specified arguments.

public static void main(Args _args)


REST Vs SOAP in AX 2012/D365


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.


Generate script to recreate the DDL with data and without data


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


Adding admin user in to D365 instance


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.

How to add Dynamics 365 admin user provisioning tool in desktop


During VM creaction, we may missed out to add the shortcut of user provisioning tool in desktop, for that we have to manually create the shortcut from the installed exe run file.


Add shortcut to desktop for selected file.


Extend / Customize standard CanSubmitToWorkflow in D365


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)

How to achieve table relation in SQL without primary index 1:n


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.


RandomNumbers In AX /D365


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.


GUID in AX 2012 / D365

 //< 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…


Round the decimals (upper / lower) in AX 2012 / D365


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 


Minumum and Maximum date in AX 2012 / D365


// Minimum dateTime and Maximum DateTime

    utcdatetime                 minDateTime = DateTimeUtil::minValue();

    utcdatetime                 maxDateTime = DateTimeUtil::maxValue();

// Minimum date and Maximum Date

    TransDate                 minDate = dateNull();

    TransDate                 maxDate = dateMax();


Convert Gregorian to Hijiri in D365


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.

Why DirPerson table is not exists in SQL


Why DirPerson table is not exists in SQL?

The DirPerson table has the property SupportInHeritance with YES and Extends with DirPartyTable.

SQL Table architecture doesnt support inheritance.

There are few more tables in AX with such property example OMOperatingUnit.


Marshaling Webservices enum to X++ during integration


    NICServiceLibrary.EltezamServiceRef.GenderType           M,F,N;

    M = NICServiceLibrary.EltezamServiceRef.GenderType::M;

    F = NICServiceLibrary.EltezamServiceRef.GenderType::F;

    N = NICServiceLibrary.EltezamServiceRef.GenderType::N;




SSRS reports prompts for user credentails in Dynamics AX / 365


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


Working on Visual Studio 2013 for Dynamics AX 2012 R3 development.


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