Skip to main content
Enabling X++ Code Coverage in Visual Studio and Automated Build
AD FS Configuration – SSL certificate must be from a public certificate authority
We're seeing a lot of activity in configuring environments for use of the AX mobile apps. One of the more complex steps in the configuration is setting up Active Directory Federation Services (AD FS). One consistent issue we are seeing is lack of an SSL cert issued from a certificate authority (CA). Since the mobile app is exchanging credentials and tokens with AD FS, SSL is used to avoid eavesdropping on that exchange.
In some cases a "self-signed" or "self-issued" cert is being used. Unfortunately in that case the mobile app won't make an authentication request to AD FS since SSL isn't correctly enabled. In order to use SSL, the site to which the mobile app is communicating (in this case AD FS) must have an SSL certificate issued from a recognized CA. The CA validates that the certificate is being issued to the owner of the domain from which the mobile app requests authentication. The cost for SSL certs ranges from less than 100 USD and up.
There is also another certificate involved in AD FS configuration known as the token signing cert. The purpose of that cert is to sign the token which is being provided to the mobile app after authenticating the user's credentials. The token signing cert can be self-signed and does not need to be issued from a CA.
Following are some helpful references:
Here's a link which explains the certificate requirements for AD FS https://technet.microsoft.com/en-us/library/dd807040(v=ws.10).aspx.
This article explains the process to request a cert from a CA https://msdn.microsoft.com/en-us/library/windowsazure/gg981937.aspx.
For general information about SSL, refer to this article https://msdn.microsoft.com/en-us/library/windows/desktop/aa364691(v=vs.85).aspx.
Hopefully that will help clear up some of the confusion about SSL certs and AD FS.
Apps for Android phone and iPhone are updated and are now available worldwide
This update features a complete UI refresh and adds category and merchant fields to the expense capture page.
These fields will allows you to select an applicable category for your expenses e.g. Taxi, Hotel, etc. Once you choose a category, you will then be able to enter the name of merchant you used, or select one from a list, if your company has one configured for the selected category.
We also released the apps (in English) to all markets worldwide. We're working on localized versions for a future update.
With this update, we aimed to improve the usability and performance of the app, and add functionality that we hope our customers will find useful!
You can download the Dynamics AX apps from Google play and iTunes.
https://play.google.com/store/apps/details?id=microsoft.dynamics

https://itunes.apple.com/us/app/dynamics-ax/id663448683?mt=8

Azure Service Bus cost is minimal for AX Companion Apps
As customers and partners are planning to add the companion apps to their implementation, there have been numerous questions about the cost of the Windows Azure Service Bus. The companion apps leverage Service Bus to relay messages between devices (not on corpnet) and the on-premises instances of AX. So what is the cost of using Service Bus? In order to answer this question, we did some measurement and calculations this week. Following are the results.
Scenario
We tested the use of the Windows Store Dynamics AX 2012 Expenses app since it is the most message and data intensive of the apps. We used the app to create an expense report which had 9 expenses with 4 typical receipts. The receipts were captured with the Windows Phone Dynamics AX app. We then extrapolated that usage over 40,000 expense reports in a month (for example 20,000 employees with 2 expense reports per month).
Cost
The resulting monthly charge from Azure for Service Bus for 40,000 typical expense reports per month is approximately $21.97. That's it – the cost is measured in 10s of dollars per month for a fairly high transaction volume. This is consistent with the numbers we are seeing inside Microsoft for use of the companion apps for our internal deployment of Dynamics AX 2012 Expense Management. If you'd like to understand the details behind this number, then please read on. Otherwise rest assured that the cost of using Service Bus is minimal compared to the value provided by using the AX companion apps. Its worth noting that most of the MSDN subscriptions include an Azure monthly credit which can apply to Service Bus usage.
Chargeable Usage
Azure charges are based on the following measures for usage of the Service Bus (pricing details):
- Relay hours: The total number of hours during which an app or service was listening to an address. In the case of companion apps this includes the on-premises connector which is typically listening 24/7 for requests from the apps and the apps which connect for very small intervals while interacting with the on-premises connector. The price is $.10 for every 100 relay hours.
- Number of Messages: Each request and each response which is relayed across the service bus is considered a message. The price is $.01 for every 10,000 messages
- Data Transfers through the Azure service: Data going out of the Azure service is priced at $.12 for per GB (for Zone 1 – US, Europe) or $.19 for per GB (for Zone 2 – other locations). The first 5 GB/Month is free.
Note: these reflect the current measures and rates as of this blog post
Measured Usage
For the scenario described above, the following were measured.
For a single expense report:
App Relay Hours | 0.0075 |
Messages | 173 |
Data Transfer (bytes) | 1,497,837 |
Extrapolating for monthly volume of 40,000 expense reports:
Connector Relay Hours | 4,320 |
App Relay Hours | 300 |
Total Relay Hours | 4,620 |
Messages | 6,920,000 |
Data Transfer (GB) | 59.9 |
Note: We assumed the on-premises connector was running 24/7 during the month and had 3 addresses (1. W8 Expenses app, 2. phone expense capture app, 3. address to provide config info to the apps). We also assumed 2 connectors for redundancy.
Calculated Costs
The calculated costs based on those measures are:
Relay | $ 4.62 |
Messages | $ 6.92 |
Transfer | $ 10.43 |
Total | $ 21.97 |
Note: We used the higher Data Transfer rate of $.19 per GB.
Azure provides a pricing calculator that can be used to replicate these calculations.
Conclusions
- The cost is minimal for a relatively high transaction volume.
- For the Expenses app costs are likely to be most sensitive to the size and quantity of receipts which will drive the data transfer costs.
- Adding the other companion apps will cause an increased fixed-cost based on the on-premises connector. With all apps deployed (for the existing set of apps) the connector is listening on 8 total addresses.
- The Time and Approvals apps are likely to be less message and data intensive than the Expenses app.
We hope this helps clear the perceived hurdle of the cost of using Service Bus. We'd love to hear from customers and partners as you deploy the companion apps get more actual transaction volume and associated service bus costs.
Customize the Approvals app with the latest update
Along with the Expenses app, we've also released a an update for the Approvals app to support customization of different approval types. With this update, partners can choose which fields and charts to expose for different approval types.
The original version of the app shipped with immersive experiences for approving Expenses and Timesheets. This update enables creating similar experiences for any workflow approval type. It also enables customizing the Expense and Timesheets experiences.
This feature is explained in detail in the following whitepaper (https://mbs.microsoft.com/partnersource/northamerica/deployment/documentation/msdaxcustomizedataapprowin).

Easily set up an Azure demo environment for mobile apps
Trying out and demonstrating the Dynamics AX 2012 R3 companions apps just became a lot easier using Lifecycle Services for Dynamics AX to deploy AX 2012 R3 VMs on Azure.
1. As a first step, LCS makes it very easy to deploy an Azure-based VM with AX 2012 R3 already installed. Details are here https://technet.microsoft.com/en-us/library/dn741581.aspx
2. Then simply follow the config steps to connect the AX phone and tablet apps to your AX VM in Azure: https://mbs.microsoft.com/files/customer/AX/Downloads/Servicepacks/HowtoConnectMobileAppsNAXinAzurePartner.pdf
Now you'll have a trial / demo environment (accessible from anywhere) that you can tweak and use to explore the apps. You can turn the VM on or off as needed.
Give it a try and we look forward to hearing your feedback!
FAQ for Companion Apps
As we see activity in configuring environments for AX mobile apps, we are seeing some common questions. We'll keep this post updated with frequently asked questions. Feel free to post your questions.
Q. How do I set up Fiddler?
A. Fiddler is a great tool for debugging network traffic!
Here are some instructions on how to get Fiddler up and running.
Getting Started with Fiddler: https://docs.telerik.com/fiddler/configure-fiddler/tasks/configurefiddler
Monitor Windows Phone: https://www.spikie.be/blog/post/2013/01/04/Windows-Phone-8-and-Fiddler.aspx
Configure Fiddler for Windows 8 applications: https://docs.telerik.com/fiddler/configure-fiddler/tasks/configurefiddlerforwin8
Q. After installing the mobile apps hotfix and completing setup, the timesheet app times out and sends me back to the sign in page.
The event viewer log on the machine running the mobile connector shows the following errors:
Unhandled Exception calling Microsoft.Dynamics.Framework.RapidStart.Connector.Modules.AXMobile.TimeService.GetProjectDetails.
User: (domain\username(domainnamehere)).
System.ServiceModel.ActionNotSupportedException: The message with Action 'https://schemas.microsoft.com/dynamics/2011/01/services/TSTimesheet/getProjectDetails' cannot be processed at the receiver, due to a ContractFilter mismatch at the EndpointDispatcher. This may be because of either a contract mismatch (mismatched Actions between sender and receiver) or a binding/security mismatch between the sender and the receiver. Check that sender and receiver have the same contract and the same binding (including security requirements, e.g. Message, Transport, None).
A. This can happen in cases where the service was not deployed properly. Launching the AOT and redeploying the TimesheetServices under AOT\Service Groups\ will resolve this issue.
Q. After deploying the mobile apps hotfix and creating and configuring a new service bus. Logging into the mobile application gives me the following error (retrieved from fiddler):
ID4175: The issuer of the security token was not recognized by the IssuerNameRegistry. To accept security tokens from this issuer, configure the IssuerNameRegistry to return a valid name for this issuer.
A. In this particular instance, the ADFS setup was done correctly.
This error can be caused if the thumbprint was copy/pasted into the thumbprint field in the Connector for Mobile Applications. Deleting the thumbprint and manually retyping it fixes this issue. It could
also be the case when using a self-signed token signing certificate, that certificate has not been imported into the certificate store of the machine running the mobile connector. Importing the certificate will resolve the issue.
Get started developing mobile apps for Dynamics AX 2012
Our prior blog posts have focused on the mobile applications that Microsoft is shipping for Dynamics AX 2012. In addition to those apps, we know there's a need for developers to build lots of other great apps for AX. We have captured what we learned in developing our apps, and have shared it with the AX community. I wanted to remind developers of the information available to them. These resources apply to phone or tablet apps and across windows, iOS and android platforms.
Learn about the patterns and approaches used to develop the mobile apps in this whitepaper: Microsoft Dynamics AX 2012 WhitePaper: Developing Mobile Apps
Links to the code samples referenced in the above document
https://code.msdn.microsoft.com/Developing-Secure-Mobile-02105158
https://code.msdn.microsoft.com/Developing-Secure-Mobile-b6ba16a2
Build 2013 session on building the W8 apps for Dynamics AX 2012
https://channel9.msdn.com/Events/Build/2013/2-9193
We'd love to hear about your AX mobile apps (developed or under development) so feel free to comment below.
Source code released for Dynamics AX phone apps
After releasing the sample code for the Dynamics AX Windows Store apps, we've had numerous requests to release the sample code for the Android and iPhone versions of the Dynamics AX app, which allows users to capture unreconciled expenses, and enter timesheets.
We're pleased to share the sample code for both versions of the app with our partners and customers.
The source code samples for the Android and iPhone versions are now available on MSDN code gallery here: https://code.msdn.microsoft.com/Developing-iOSAndroid-Apps-3ee71056
We encourage Dynamics AX app developers to leverage these working samples in creating other awesome apps for Dynamics AX 2012.
Source code released for Dynamics AX Windows Store Apps
We've received a lot of feedback on our Approvals, Expenses, and Timesheets Windows Store apps since their initial release. We've actively been updating these apps. The two previous blog posts talk about several new features in the Expenses and Approvals apps.
However, we have also had requests to make available the source code for these apps so that partners can get a head start on building their own Windows Store apps!
The source code samples for all three apps is now available on MSDN code gallery here: https://code.msdn.microsoft.com/Developing-Windows-Store-d85c8012
We encourage Dynamics AX app developers to leverage these working samples in creating other awesome apps for Dynamics AX 2012.
Taking advantage of Windows 8.1
We are excited about the capabilities of Windows 8.1. Recently the AX companion apps in the Windows Store (Expenses,Timesheets and Approvals) were updated to take advantage of some Windows 8.1 features. The most notable change is enabling "using apps side by side" as explained in this tutorial https://windows.microsoft.com/en-us/windows-8/getting-around-tutorial. Here are some screen shows of the Dynamics AX companion apps in side by side mode.


Update to the Windows Store Expenses App
Over the last few months we've been working on adding more features to the Windows Store apps for Dynamics AX 2012. We'll be doing a series of blog posts to cover these updates starting with the Expenses app.
On our partnersource page we have made available the following hotfix (https://support2.microsoft.com/hotfix/KBHotfix.aspx?kbnum=2963242).
Once applied, it will enable the following features for the Expenses app.
- Itemization
- Policy justifications
- Delegates
- Guests
- Various bugs fixes and other improvements
Welcome to Dynamics AX Companion Apps
Welcome to the blog for Dynamics AX Companion Apps. These include apps for Windows 8, Windows Phone, iPhone and Android phone. It also includes email-based approval, which works on any device. This blog will provide information for implementers and developers. We'll be responsive to the questions we are getting during implementation and development. We'll also provide a heads up on upcoming updates to any of the apps (and new apps).
The documentation and downloads for the companion apps are available on PartnerSource or CustomerSource here.
Here's a quick recap of the apps available at this point. Stay tuned for updates in the future.
Phone apps
The following phone apps are available for Microsoft Dynamics AX 2012 R2. Capture your expense transactions and receipt information, plus create and submit timesheets in conjunction with Microsoft Dynamics AX 2012 R2.
Windows 8 Apps
Dynamics AX 2012 Expenses Create and manage expense reports in the Dynamics AX 2012 Expenses app in conjunction with Microsoft Dynamics AX 2012. |  |
| | |
Dynamics AX 2012 Timesheets Create and manage timesheets in the Dynamics AX 2012 Time app in conjunction with Microsoft Dynamics AX 2012. |
|
| | |
Dynamics AX 2012 Approvals Manage approvals with the Dynamics AX 2012 Approvals app in conjunction with Microsoft Dynamics AX 2012. Approval types include expense reports and timesheets. |
|
Windows Store App updates: Approvals notifications and Expenses guests/gifts
We recently updated two of the Windows Store apps Dynamics AX 2012 Approvals and Dynamics AX 2012 Expenses.
Notifications were added to the Approvals app. New approvals will show as a typical notification in the upper right corner in Windows 8. This is similar to receiving an email or calendar notification.

Notifications from the Approvals app can be turned off within the PC Settings area like other Windows Store apps which are installed.

Guest and Gift features were added to the Expenses app edit experience. This enables adding guests (name, company and title) for categories like meals or entertainment. It also enables adding gift recipients and amounts for the gifts category. Guest and gift recipients can also be (multi-) selected from the Windows 8 People app. This is enabled by selecting the people icon when adding a new guest.

Automated testing guidance for AX 7
Couple of links that will be helpful while thinking about testing in general
X++ test attributes
| Attribute Name | Usage |
| SysTestMethod | A method decorated with this attribute in a Test Class is considered as Test method (you can also just start the method name with 'test' and it will be treated as a test method. |
| SysTestInactiveTest | Deactivates the Test From Execution List |
| SysTestCaseConfigurationKeyConstraint | Class level and Method Level. The test can only run if the specified configuration key is enabled. It reports as inactive otherwise.example:[SysTestCaseConfigurationKeyConstraintAttribute(configurationkeystr(PMF)] //test will only run if the PMF configuration key is turned on |
| SysTestCaseConfigurationKeyDependency | Class level only. Requests the framework to activate/deactivate a configuration key temporarily for the purpose of the test.example:[SysTestCaseConfigurationKeyDependencyAttribute(configurationkeystr(PMF))] //test will always run. Turns PMF on during the test execution (if was off to begin with) [SysTestCaseConfigurationKeyDependencyAttribute(configurationkeystr(PMF), false)] //test will always run. Turns PMF off during the test execution (if was on to begin with) |
| SysTestCaseCountryRegionDependencyAttribute | Class level only. Requests the framework to run the tests in the provided country/region context.Example:[SysTestCaseCountryRegionDependencyAttribute('US')]This will enable US Country/Region features like tables, forms, etc. during test execution. It will also make country/region specific code execute. Please note that this feature works by injecting the country/region ISO code into the global cache. If for some reason the cache is cleared during test execution the effect dissapears. |
| SysTestCaseDependsOnReportAttribute | Method level only. Deploys the Report Design or all the designs within the Report.SysTestCaseDependsOnReportAttribute("BIR_RptNoParameter") // Only specify the report name without the design name in order to deploy all designs within a report. SysTestCaseDependsOnReportAttribute ( "BIR_SimpleReport.AutoDesign1" ) // Specifiy the report + design name to deploy a specific report design. |
| SysTestGranularity Parameters: | Marks the testclass or test method with this attribute Unit, Component, Integration, or BusinessCycle |
| SysTestFixture Parameters:[classstr(SysTestSuiteClass)] | The suite has the knowledge of what test classes or test methods but it's not the other way. Where test classes or test methods know which suite they belong to. In Rainier, using the SysTestFixture Attribute, [SysTestFixture(classstr(WorkflowRuntimeTestSuite))]class SysWorkflowTest extends SysTestCase{public void testcancel() {}}public class WorkflowRuntimeTestSuite extends SysTestSuite{public void setUp(){}public void tearDown(){}}Through the SysTestFixture Attribute, we could enable test classes/methods to have the knowledge of which test suite they belong to. While executing the tests from visual studio tools (IDE and vstest.console.exe) SysTestFixture metadata is used to group the testmethods and execute them together, which would in turn run the suite-level setup() and teardown() once. |
| SysTestCaseNumSeqTypeDependency | Flags that the specific test class depends on a number sequence module. The system will ensure that the number sequence module and the specific data type is created prior to the test execution. Only the specified data type is setup for the execution of the test.Note: try to use SysTestCaseAutomaticNumberSequencesAttribute first before using this attribute. With this attribute the test case should upgrade code like this:SysTestCreateData_Basic::createNumberSequenceETId(NumberSeqModule::Invent, extendedtypenum(InventDimId));To an attribute like this:[SysTestCaseNumSeqTypeDependencyAttribute (extendedTypeStr(InventDimId), classstr(NumberSeqModuleInventory))]For tests that depend on a small set of number sequences, this is the preferred way of setting up number sequences when the test case is not compatible with SysTestCaseAutomaticNumberSequencesAttribute.The number sequences created with this attribute are based on the default settings of the data types.Any customization to the setup, format or parameters of the number sequence (i.e. "Continuous", "Manual", etc) needs to be applied during the SetupTestCase.Use of this attribute gives a very big performance gain compared to traditional methods such asSysTestCreateData_Basic::createNumberSequenceETId(NumberSeqModule::Invent, extendedtypenum(InventDimId)); |
| SysTestCaseNumSeqModuleDependency | Flags that the specific test class depends on all number sequences within a given module. The system will ensure that the number sequence module and all its data types are created prior to the test execution.Note: try to use SysTestCaseAutomaticNumberSequencesAttribute first before using this attribute. With this attribute the test case should upgrade code like this:SysUnitTestData_Proj::setupNumberSequences(NumberSeqModule::Sales);To an attribute like this:[SysTestCaseNumSeqModuleDependency(classstr(NumberSeqModuleSales))] For tests that depend on a many number sequences of a given module, this is the preferred way of setting up number sequences when the test case is not compatible with SysTestCaseAutomaticNumberSequencesAttribute.The number sequences created with this attribute are based on the default settings of the data types.Any customization to the setup, format or parameters of the number sequence (i.e. "Continuous", "Manual", etc) needs to be applied during the SetupTestCase.Use of this attribute gives a very big performance gain compared to traditional methods such asSysUnitTestData_Proj::setupNumberSequences(NumberSeqModule::Sales); |
| SysTestCaseAutomaticNumberSequencesAttribute | Flags that the specific test class may use number sequences and the system should create, at runtime and upon request, the right setup.With this attribute the test case should be removed of code similar to:SysUnitTestData_Proj::setupNumberSequences(NumberSeqModule::Sales);OrSysTestCreateData_Basic::createNumberSequenceETId(NumberSeqModule::Invent, extendedtypenum(InventDimId)); The use of this attribute actually changes the runtime behavior of number sequences to setup the data types and modules as they are requested.There is no performance cost of this attribute against the SysTestCaseNumberSeqModuleDependency or SysTestCaseNumberSeqTypeDependency and this mechanism ensures that, at runtime, only the needed types are created and no excessive setup is performed.This attribute may not produce the right results when the test case executes one of the following type of validation:· Tests that validate the number sequence framework itself.· Tests that expect non-existent number sequences.· A small number of tests validate number sequence reservation ("continuous") behavior may fail. The number sequences created with this attribute are based on the default settings of the data types.Any customization to the setup, format or parameters of the number sequence (i.e. "Continuous", "Manual", etc) needs to be applied during the SetupTestCase.Use of this attribute gives a very big performance gain compared to traditional methods such asSysUnitTestData_Proj::setupNumberSequences(NumberSeqModule::Sales); This attribute may produce a negative performance effect when you are replacing a very well behaved class that does one-time setup of one number sequence code. In this case, try using SysTestCaseNumSeqTypeDependencyAttribute (see above). |
| SysTestCaseDatasetDependency | Class level attribute. DOES NOT work when applied at method levelINHERITED (but not overridable) Flags that the specified test class needs to run on a given Dataset, starting on the specified company.Usage:SysTestCaseDatasetDependencyAttribute( str _datasetName, selectableDataArea _dataAreaId = 'DAT' )A dataset is a logical name of the Test data collection. It is not a partition where the data got imported to. The system will switch execution to the partition where the data is imported to and launch the execution on the company. If the dataset requested is not present in the system the test case will fail. |
| SysTestSecurityAttribute | Class level attribute. DOES NOT work when applied at method levelNOT INHERITEDBy default all test run with System administrator rights.In this example 2 personas are defined on a test class· each is given a different security role (the roles are defined in a list of assigned roles).· SystemUser role is automatically added by the framework· Note the TestEssentialsRole was explicitly added by the owner of the test since SystemUser does not have rights to all test framework endpoints. Task 1737753 will look into adding that role implicitly.· The old notion of a "user" is now called a "persona", this is because we are not actually switching users midstream, but instead, are reconfiguring the user's permissions· No kernel hooks were added for any of this, it only uses the development hook which was already available in 6.x.—'SysAdminMode'· One of them sets default = true which means that the role becomes the default for the test methods (the setup() methods are all executed without a user context)· Using statements are not required, but are a preferred way of scoping the user's context· The code controlling the behavior is completely encapsulated in the SysTestSecurityContext class.· MethodEnter/Exit and TestExecutable Enter/Exit control when settings are automatically changed back to admin and the default contexts· TestEssentialsRole is required for execution of form adaptor based testsSample: for complete reference see the SysTestSecurityContextTest class#define.PersonaSecRole('u1')#define.PersonaSecUserRole('u2')[SysTestTargetAttribute(classstr(SysTestSecurityContext), UtilElementType::Class),SysTestSecurity(#PersonaSecRole, [ 'SysTestSecurityContextTestRoleSecRole', 'TestEssentialsRole' ], true),SysTestSecurity(#PersonaSecUserRole, [ 'SysTestSecurityContextTestRoleSecUsrRole', 'TestEssentialsRole' ], false)]class SysTestSecurityContextTest extends SysTestCase-------NOTE---------------This attribute does apply the role correctly, but the priviliges assigned to any duty connected to this role will drive the security context. What it means is that if your Test is using a security role say HcmHumanResourceManager, which has one of the duties as HcmWorkforceProcessInquire which ultimately has the privilige HcmADARequirementView. This privilige has the entry point set to HcmADARequirement with a read access to display menuitem HcmADARequirement. So if you are using this SysTestSecurityAttribute with the HcmHumanResourceManager role, you will get view access if you do use form interaction (form adaptor based tests).But if you decide to directly interact with the table HcmADARequirement, you will end up getting a Delete access by default. If you don't want to test using the form adaptors but directly interact with the table (for eg) and still want the security context applied you will have to manually push the security context in your test code.SecurityContext context = SecurityContext::constructFromEntryPoint(SecurableType::MenuItemDisplay,menuItemDisplayStr(HcmADARequirement),''); context.push(); //Your code to ineract with the table goes hereSecurityContext ::pop(); |
| SysTestTransaction | Class level attribute. DOES NOT work when applied at method levelNOT INHERITEDDefines what is the test data rollback mechanism once the test class finishes.Default - [SysTestTransaction(TestTransactionMode::AutoRollback)]Uses the savepoint mechanism. Data is never committed to the database and is only accessible within the transaction scope. This was introduced with AX7.[SysTestTransaction(TestTransactionMode::LegacyRollback)]This is the same way as 6.0 and it saves the data in the database but tracks what records have been inserted and reverts them once the test execution is over.[SysTestTransaction(TestTransactionMode::None)]This will commit the data to the database and won't cleanup after the execution completes. |
How to generate form adaptors for new forms-
- Pre-requisite -> You have new module or model created for production code and also one for test code. Also at least one form is present in the model

- Open the descriptor file for the test module from the packages eg - I:\AOSService\PackagesLocalDirectory\NewTestModel\Descriptor\NewTestModel.xml and add this line
<FormAdaptorSourceModel>NewFormModel</FormAdaptorSourceModel>

This will mark this test module to hold the form adaptors for the NewFormModel model
- Open the properties window for the NewFormModel project and set the 'Generate form adaptors' property to true

- Now build the NewFormModel project and it will generate a new class called SomeSampleFormFormAdaptor under the NewTestModel. Refresh the application explorer and you should see the file.
How to record validation steps in task recording-
You can add validation steps to your task recording that will be converted to assert statements when you import the recording back into Visual Studio as a test.
There are two type of validations you can record
- Validate the value you see directly - Right click on the field you want to validate -> Task recorder -> Validate -> Current Value. This will always validate the value Contoso Europe in the example below and even the test generated from the recording will be validating this value.

- Validate the value by matching it with some other field - This is useful when you are actually less worried about what the value is, but in fact you want to make sure that the value matches some field that you copied earlier. From the example above, instead of clicking on Validate, you can click on Copy. Then on the Customer details form you can right click on the Name -> Task recorder -> Validate -> (Now you see two options). Instead of choosing Current value, you can choose to match the Name to the CustTable_Name field from the List page that you had copied. This is very use full if you want to track the progress of any field value.

Known Limitations
These are not necessarily limitations, but the current design.
- Tests can run in a clean partition if no dataset is provided or in the company belonging to the dataset that is loaded. You cannot combine tests that target different datasets because we don't have the capability to switch dataset on the fly. It will be costly to switch as well since it takes a long time to drop and restore the database. If you want to have tests that target different sets of data, then prepare your database with different partition and that way the partition can be switched easily to execute the tests.
- Data created during a test run gets cleaned up after the test finishes. Currently we don't support running the test in any particular order. So you cannot assume that the data from test1 can be used by test2.
AX Build Environment - Nuts and Bolts
What happens during the build environment provisioning from Dynamics Lifecycle Services?
There are two main operations performed by Dynamics AX deployment service while provisioning your build environment.
- Automated configuration of a build agent to process continuous integration activities like compilation of X++ / C# code, DB sync, automated test execution and packaging.
- Automated creation of a build definition with tasks based on next generation, extensible build system of VSTS to orchestrate continuous integration activities.
Configuration of build agent on your Visual Studio Team Services Agent Pool
To build your code or deploy your software you need a build agent that can build X++/C# code and deploy your solution. Visual Studio Team Services provides a scalable agent pool and queuing architecture to handle multiple build requests. As part of provisioning the continuous integration environment, a custom build agent for AX is added to an agent pool in your team services account. For quick steps and configuration requirements on getting started with VSTS for AX applications check this article.
These are the series of steps executed to get your agent configured:
- Deployment portal in LCS picks up the configuration information you provided in the project settings and any customization information you provided in the advanced settings option of LCS.
- The only required configuration information used is the personal access token used in the LCS project in case you are not customizing the name of the agent and have not created any custom agent pool. In this case, a default agent pool named "Default" that automatically gets created while signing up for team services is used to add your custom build agent.
- In the advanced settings of LCS, there are options to pass in your own agent pool name. For power users of VSTS, these named custom agent pools allow one way to achieve isolation across different versions of AX platform. Note that this is an optional parameter that you pass from LCS and these named pools have to be created manually in VSTS before you schedule deployment.
- Agent is added to your default or named pool to process build tasks.
Automated creation of Build Definition
The next generation VSTS builds are web- and script-based, and highly customizable. The new system embraces the diverse set of domain-specific languages (DSLs) that developers used to build the code on their dev machines.
As part of the build environment provisioning through LCS, a build orchestration template is created which know how to compile your AX app, self-test the build if you have automated tests and package your AX app for deployment on sandbox environment.
[caption id="attachment_55" align="alignnone" width="537"]
Default Developer ALM build definition[/caption]
Quick explanation of the steps in Build Definition
- Prepare for build - On the first build it creates the environment variables and also creates a backup of packages (generally under I:\DynamicsBackup\Packages) and also a backup of the database (generally under I:\DynamicsBack\Database). On every subsequent build, the script restores the packages (& the database if the database name is provided in the variables). This ensures you can build different projects on the same machine without corrupting your packages.
- MSBuild (Build the solution) - This step uses the AXModulesBuild.proj file to build your solution. It runs XPPC, PGC, XPPBP, LABELC and REPORTC to compile and build your solution.
- MSBuild (Database Sync) - This step is used to run the SyncEngine that syncs your metadata with SQL
- Deploy Reports - Deploys the reports. It's a two-step process of first Removing all reports from the server and then redeploying all of them again.
- Generate Packages - This step generates both runtime and source packages which can be used to deploy your solution on other environments.
- Publish Packages - This step uploads the generated packages back up to VSTS and is available with your build.
- Test Setup - Execute Tests - Test End -- This 3 steps work together to successfully run all your tests. If you want to skip test execution, then you need to remove or disable all of these 3 steps. Once the tests are executed a test report is uploaded with the build.
- Publish Artifacts (Additional Logs) - This step is always executed so that we can upload all the logs created because of the solution build back up the VSTS for future debugging.
While these steps are automatically created during the build environment provisioning, you have the ability to extend the build definition by adding your steps. For more information check https://msdn.microsoft.com/en-us/library/vs/alm/build/steps/index
AX Source Control and Branching Guidelines
The source control system supported by AX Developer ALM system is VSTS based TFVC (Team Foundation Version Control). If you are new to TFVC, please check - Develop and share your code in TFVC using Visual Studio
TFVC is a centralized version control system that storing source code in shared repositories, isolate parallel development efforts, integrate code changes, and to recover previous file versions.
Basic TFVC concepts
- Branch: is an isolated copy of item metadata and version control history.
- Changeset: is a logical container for changes of a single check in.
- Label: provides mutable groupings of specific version of a set of source files.
- Workspace: is a local copy of your codebase. You can create multiple workspaces and switch among them to work on different branches or copies of the codebase. A Workspace maps Server folders to Local folders. This includes:
- A list of all the files in your workspace
- The version of each file
- A list of the pending changes
- Active and cloaked items
Source Code Structure in TFVC for your AX application
In order to get started with TFVC version control for your AX project, you need to check in AX Modules you are developing under the Metadata folder. While provisioning the build environment if there is no custom branch name specified, a folder called Main is created for you while creating the build definition.
This is structure to follow to check in your code for X++ projects.

You can consume .NET projects in your AX application and the default build definition created supports compiling and adding your .NET assemblies to AX Modules. In order to build and source control your C# projects please check them into TFVC following this structure.

Common Branching Strategies for AX Development
Branching enables parallel development by providing each development activity a self-contained snapshot of needed sources, external dependencies and build orchestration automation. Having more branches increases complexity and merge costs. Nevertheless, there are several scenarios where you will need to consider multiple branches to maintain a required development velocity.
These are the branching strategies we recommend
- No Branching: Do not branch unless you really need to. This is the simplest strategy to start with for your AX development project and works great for small teams developing a single version of the application at a time. Branching introduces cost of maintenance and shelveset is a great feature of TFVC to save and share changes in TFVC without committing them to the branch. For more information, please refer - Suspend your work and manage your shelvesets
- Branch per release: Branch contains code for specific release version. This enables concurrent release management and isolation. It is recommended to branch everything you require to develop in parallel, typically this may mean branching the entire parent. Branch from a parent with the latest changes (usually MAIN or another DEV branch you specified in LCS)

For steps to accomplish this please refer – Branch folder and files
We are in the process of evaluating distributed version control system - Git for AX development. Stay tuned for updates in this blog.
Configuring VSTS with Dynamics Lifecycle Services for Continuous Integration
Dynamics lifecycle services provides you with the capability to provision custom build agents as part of you LCS project. While developing an AX solution; using the build environment gears you up to follow the best practices for continuous integration of Dynamics AX application.
Continuous Integration allows you to
- Follow the optimal branching and source/version control strategy
- Utilize automated build orchestration using VSTS
- Utilize automated deployment of your custom AX solution on the build environment
- Create self-testing build with automated tests authored for AX application
- Reports and notifications on the status of your builds
In order to get started with continuous integration and delivery of AX solutions built on Dynamics AX platform, you need to create a VSTS account and link it with Dynamics lifecycle services portal.
- Sign up for Team Services - It is required to use the same Azure active directory that you used to create the Dynamics lifecycle project. If you are unfamiliar with Azure Active directory, please read through and understand the security and access control model for team services with Azure Active directory as an organization.
- Create a personal access token - Clients like Visual Studio natively support Microsoft account and Azure AD authentication with team services, so you can directly use these authentication mechanisms from your AX developer environments hosted either on Azure or on premise. As part of the cloud build environment provisioning through Dynamics LCS, you need to create a personal access token and use that in LCS project settings. Please refer to this MSDN article on creating personal access token.
- Connect your LCS project with VS Team Services – Personal access token is associated with a user profile and is your identity. It should have the right permissions to create a custom build agent on the agent pool of your team services account. Agent pools are used to organize and define permission boundaries around your agents. Pools are scoped to your Team Foundation Server application tier or Visual Studio Team Services (Team Services) account. If you are using the personal access token of the Team Services account owner in Dynamics LCS, you already have all the required access to the agent pool and queue. If you are using a personal access token of a user who is not the account owner, make sure the user has been added as an agent pool administrator. You can administer your pool from this URL - Team Services: https://{your_account}.visualstudio.com/_admin/_AgentPool; Members of this group can register new agents in the pool and add additional users as administrators or service accounts.
Once done with the above three steps, you are now ready to deploy a build environment using Dynamics Lifecycle Services.
If you are interested in learning more about what happens during provisioning of your build environment on Azure, please refer this blog article.
Cross-Post: Performance improvements that may affect test automation code
A performance improvement related to UI and data may affect test automation. This can apply to manually authored tests using form adaptors / type providers, or a recorded test where a platform or app update moves a control used in the test.
For more details, please read this blog post on the community site.
Dynamics AX Application Test Strategy
Dynamics AX provides a fully features testing framework that works in a pattern similar to any xUnit test harness. This harness allows developers to author unit, component and scenario level tests. Additionally, since the development environment is integrated with Visual Studio, there are many productivity enhancing developer scenarios like better debugging, diagnostics and code analysis available with the IDE.
A version of the testing quadrants by Alan Page describes scope and activities of testing quite well. This has been adapted from Brain Marick's "Agile Quadrants" to describe the scope of testing. [1] [2]

Task recorder based record and playback tests falls under Q4. These tests are typically scenario based and are customer facing. Unit and component tests fall under Q1. For Q4, performance SDK offers load and performance testing capabilities.
Dynamics AX Test Strategy
A good test strategy answers three basic questions [4]
- Why bother? Testing and test automation takes effort and time. In order to ensure proper investment, testing activities should be driven to address specific risks.
- Who Cares? Include activities in your tests that serves somebody's interest. For ex., customers who care about a specific feature or scenario.
- How much? It is impossible to test all possible combinations and scenarios. There should be clear definition of how much effort will be put in testing and test automation.
What is a good test case?
There are many articles about quality of a test case. In a nutshell a good test case is [3]
- Relevant : Uniquely tests what is intended
- Effective : Proves or disproves the software. Finds bugs! No false positives or negatives.
- Maintainable: Easy transition of tests for someone else to setup, run and interpret results
- Efficient : Returns definitive results quickly with efficient use of resources.
- Manageable: Test deployment, configuration, organization, test business metadata (owner, priority, feature association, etc.)
- Portable: Runs anywhere with appropriate adaption to current environment
- Reliable: Software reliability + results repeatability. Same input and environment=same test results.
- Diagnosable: Low Mean Time to Root Cause (MTTRC) and accurately identifies product, test and infrastructure failures separately, starting with a good name.
Resources
For some excellent advice on testing and test strategy please refer to blog
Achieving balance in testing software
References
[1] Agile Testing Directions; https://www.exampler.com/old-blog/2003/08/21/#agile-testing-project-1
[2] Riffing on the Quadrants; https://angryweasel.com/blog/riffing-on-the-quadrants/?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+ToothOfTheWeasel+%28Tooth+of+the+Weasel%29
[3] Improving Test Quality; David Catlett, Mind Shift, 2011 Engineering Forum
[4] Kaner, C., Bach, J., & Pettichord, B. (2001). Lessons learned in software testing (1 ed.). New York, NY, USA: John Wiley & Sons.
Enabling X++ Code Coverage in Visual Studio and Automated Build
To enable code coverage for X++ code in your test automation, a few things have to be setup. Typically, more tweaking is needed since you will likely be using some platform/foundation/appsuite objects and code, and don't want code coverage to show up for those. Additionally, the X++ compiler generates some extra IL to support certain features, which can be ignored. Unfortunately there is one feature that may throw off your results, we'll talk about this further down.
One important note: Code Coverage is a feature of Visual Studio Enterprise and is not available in lower SKUs. See this comparison chart under Testing Tools | Code Coverage.
To get started, you can download the sample RunSettings file here: CodeCoverage You will need to update this file to include your own packages (="modules" in IL terminology). At the top of the file, you will find the following XML:
<ModulePaths>
<Include>
<ModulePath>.*MyPackageName.*</ModulePath>
</Include>
<Exclude>
<ModulePath>.*MyPackageNameTest*.*</ModulePath>
</Exclude>
</ModulePaths>
You will need to replace the "MyPackageName" with the name of your package. You can add multiple lines here and use wildcards, of course. You could add Dynamics.AX.* but that would then include any and all packages under test (including Application Suite, for example). This example also shows how to exclude a package explicitly, for example in this case the test package itself. If you have multiple packages to exclude and include, you would enter it this way:
<ModulePaths>
<Include>
<ModulePath>.*MyPackage1.*</ModulePath>
<ModulePath>.*MyPackage2.*</ModulePath>
</Include>
<Exclude>
<ModulePath>.*MyPackageName1Test*.*</ModulePath>
<ModulePath>.*MyPackageName2Test*.*</ModulePath>
</Exclude>
</ModulePaths>
To enable code coverage in Visual Studio, open the Test menu, select Test Settings and Select Test Settings File. Select your settings file. You can then run code coverage from menu Test > Analyze Code Coverage and then selecting All Tests or Selected Tests (this is your selection in the Test Explorer window). You can open the code coverage results and double click any of the lines - which will open the code and highlight the coverage.
To enable code coverage in the automated build, edit your build definition. Click on the Execute Tests task, and find the Run Settings File parameter. If you have a generic run settings file, you can place it in the C:\DynamicsSDK folder on the build VM, and point to it here (full path). Optionally, if you have a settings file specific for certain packages or build definitions, you can be more flexible here. For example, if the run settings file is in source control in the Metadata folder, you can point this argument to "$(Build.SourcesDirectory)\Metadata\MySettings.runsettings".
The biggest issue with this is the extra IL code that our compiler generates, namely the pre- and post-handler code that is generated. This is placed inside any method, and is thus evaluated by code coverage even though your X++ source doesn't contain this code. As such most methods will never get 100% coverage. If a method has the [Hookable(false)] attribute (which makes the X++ compiler not add the extra IL code), or if the method actually has pre/post handlers, the coverage will be fine. Note that Chain-of-Command logic that the compiler generates is nicely filtered out.
Popular posts from this blog
[Excel] 문서에 오류가 있는지 확인하는 방법 Excel 문서를 편집하는 도중에 "셀 서식이 너무 많습니다." 메시지가 나오면서 서식을 더 이상 추가할 수 없거나, 문서의 크기가 예상보다 너무 클 때 , 특정 이름이 이미 있다는 메시지가 나오면서 '이름 충돌' 메시지가 계속 나올 때 가 있을 것입니다. 문서에 오류가 있는지 확인하는 방법에 대해서 설명합니다. ※ 문서를 수정하기 전에 수정 과정에서 데이터가 손실될 가능성이 있으므로 백업 본을 하나 만들어 놓습니다. 현상 및 원인 "셀 서식이 너무 많습니다." Excel의 Workbook은 97-2003 버전의 경우 약 4,000개 2007 버전의 경우 약 64,000개 의 서로 다른 셀 서식 조합을 가질 수 있습니다. 셀 서식 조합이라는 것은 글꼴 서식(예- 글꼴 종류, 크기, 기울임, 굵은 글꼴, 밑줄 등)이나 괘선(괘선의 위치, 색상 등), 무늬나 음영, 표시 형식, 맞춤, 셀 보호 등 을 포함합니다. Excel 2007에서는 1,024개의 전역 글꼴 종류를 사용할 수 있고 통합 문서당 512개까지 사용할 수 있습니다. 따라서 셀 서식 조합의 개수 제한을 초과한 경우에는 "셀 서식이 너무 많습니다." 메시지가 발생하는 것입니다. 그러나 대부분의 경우, 사용자가 직접 넣은 서식으로 개수 제한을 초과하는 경우는 드뭅니다. 셀 서식이 개수 제한을 넘도록 자동으로 서식을 추가해 주는 Laroux나 Pldt 같은 매크로 바이러스 에 감염이 되었거나, 매크로 바이러스에 감염이 되었던 문서의 시트를 [시트 이동/복사]하여 가져온 경우 시트의 서식, 스타일이 옮겨와 문제가 될 수 있습니다. "셀 서식이 너무 많습니다." 메시지가 발생하지 않도록 하기 위한 예방법 글꼴(종류, 크기, 색, 굵기, 기울임, 밑줄), 셀 채우기 색, 행 높이, 열 너비, 테두리(선 종류, ...
ASP.NET AJAX RC 1 is here! Download now
Moving on with WebParticles 1 Deploying to the _app_bin folder This post adds to Tony Rabun's post "WebParticles: Developing and Using Web User Controls WebParts in Microsoft Office SharePoint Server 2007" . In the original post, the web part DLLs are deployed in the GAC. During the development period, this could become a bit of a pain as you will be doing numerous compile, deploy then test cycles. Putting the DLLs in the _app_bin folder of the SharePoint web application makes things a bit easier. Make sure the web part class that load the user control has the GUID attribute and the constructor sets the export mode to all. Figure 1 - The web part class 2. Add the AllowPartiallyTrustedCallers Attribute to the AssemblyInfo.cs file of the web part project and all other DLL projects it is referencing. Figure 2 - Marking the assembly with AllowPartiallyTrustedCallers attribute 3. Copy all the DLLs from the bin folder of the web part...
Architecture Testing Guide Released
视频教程和截图:Windows8.1 Update 1 [原文发表地址] : Video Tutorial and Screenshots: Windows 8.1 Update 1 [原文发表时间] : 4/3/2014 我有一个私人的MSDN账户,所以我第一时间下载安装了Windows8.1 Update,在未来的几周内他将会慢慢的被公诸于世。 这会是最终的版本吗?它只是一项显著的改进而已。我在用X1碳触摸屏的笔记本电脑,虽然他有一个触摸屏,但我经常用的却是鼠标和键盘。在Store应用程序(全屏)和桌面程序之间来回切换让我感到很惬意,但总是会有一点瑕疵。你正在跨越两个世界。我想要生活在统一的世界,而这个Windows的更新以统一的度量方式将他们二者合并到一起,这就意味着当我使用我的电脑的时候会非常流畅。 我刚刚公开了一个全新的5分钟长YouTube视频,它可以带你参观一下一些新功能。 https://www.youtube.com/watch?feature=player_embedded&v=BcW8wu0Qnew#t=0 在你升级完成之后,你会立刻注意到Windows Store-一个全屏的应用程序,请注意它是固定在你的桌面的任务栏上。现在你也可以把任何的应用程序固定到你的任务栏上。 甚至更好,你可以右键关闭它们,就像以前一样: 像Xbox Music这种使用媒体控件的Windows Store应用程序也能获得类似于任务栏按钮内嵌媒体控件的任务栏功能增强。在这里,当我在桌面的时候,我可以控制Windows Store里面的音乐。当你按音量键的时候,通用音乐的控件也会弹出来。 现在开始界面上会有一个电源按钮和搜索键 如果你用鼠标右键单击一个固定的磁片形图标(或按Shift+F10),你将会看到熟悉的菜单,通过菜单你可以改变大小,固定到任务栏等等。 还添加了一些不错的功能和微妙变化,这对经常出差的我来说非常棒。我现在可以管理我已知的Wi-Fi网络了,这在Win7里面是被去掉了或是隐藏了,以至于我曾经写了一个实用的 管理无线网络程序 。好了,现在它又可用了。 你可以将鼠标移至Windows Store应用程序的顶部,一个小标题栏会出现。单击标题栏的左边,然后你就可以...
Comments
Post a Comment