Friday, October 4, 2019

Power APPS AX 2012 - New Entity Get Data With Exisiting Connection

Welcome to my very first Power APPS post!!!
My employer has decided to use Power APPS to replace our current T&E in Enterprise Portal.
More posts will come on how I have designed this.

On to the issue at hand...
When creating a new entity I am forced to create a new SQL connection everytime, even though I have an existing SQL connection.
I have an On-premise data gateway and a SQL connection setup:

The 3rd one in the list is a connection created from a new entity.  The blocked out portions of each SQL Server connection are the same name of the SQL Server. 
I couldn't figure out why I couldn't select my existing connection
Here is what I see when getting data for a new entity:



I can successfully select my On-premise gateway, however, no connections show under the Connection combo box.
As I was about to post this on the Power APPS forum I had a small epiphany... By typing in the Server and Database first, it will automatically select my existing connection:

As you can see, we can now use our existing connection and not be forced to create a new one.

Friday, September 6, 2019

GL General Journal Fin Dim (Legal Entity) doesn't auto populate after entering Main Account

After setting up a new Legal Entity, my UAT testers noticed that the Legal Entity portion of the account string in a GL General Journal didn't automatically filled.  That behavior is observed on other Legal Entities that are in the system so it didn't make a lot of sense of why the new Entity didn't have that behavior.



After getting some suggestions on my AX Forum question, I started looking in the Main Accounts and their setup. When looking at the details of a Main Account, I found that the 'Companies' field was not auto-populating:



If you hit that green '+' I can add my new entity, however, I would have expected it to be auto-populated.  I also noticed that the Legal Entity in the Financial dimensions on the Main Account wasn't set either:



As you can see in the image, I was able to set it with my new Entity, however, I would have expected it to be auto-populated after entity setup.

Possible Root Cause:
When setting up my entity I completed the setup in General ledger -> Setup -> Ledger before making the Entity a Virtual Company:

I believe that if you setup the Virtual Company first and then do these Ledger settings the items above will auto-populate.

Thursday, March 7, 2019

Expense Report Accounting Distribution missing Project and Category

Lately, we have had several expense reports get posted with Accounting Distributions that don't account for the Project and Category.  This causes a problem as it doesn't create a Project Transaction like it should.
ER:
Accounting Distribution:
As you can see, the Accounting Distribution fields for Project ID and Category are blank.
Even more interesting, the other 'Hotel' lines and other category lines are just fine. It's only this one.
Not sure at this point what is causing this, but I will update as soon as I have a root cause.

Thursday, January 31, 2019

AX Email Approval - The Requested Workflow Action Failed.

We recently created a new Azure Service using SAS authentication. (Removed the old ACS Service Bus).
It worked initially, however, after a few days we were receiving the following error when trying to approve from the email link:

The Requested Workflow Action Failed.

In order to remedy this I found this blog post which helped:

http://msdynamicsaxtips.blogspot.com/2018/02/the-requested-workflow-action-failed.html

I took some extra steps which I will list out here:

1. Generate Full CIL on AOS which has the Mobile Connector software
2. Stop the RapidStart Services in the Mobile Connector software













3. Deploy the 'SysWorkflowApprovalServiceGroup'
AOT -> Service Groups -> SysWorkflowApprovalServiceGroup


4. Start RapidStart Services in the Mobile Connector software

After doing this, I was able to successfully Approve via email link.

I suspect that Step #3 is most likely what fixed this here, however, I think the other steps could be helpful.

Friday, October 12, 2018

AX Workflow 'Stopped (error):'

I received this error on my Timesheet workflows.  There is no error given in the workflow nor in ANY event logs.

The solution actually ended up being pretty simple.  A reboot of our AX AOS Batch Server solved the issue.

Monday, September 17, 2018

The User Control has caused a compilation error

After moving some code into my testing environment, I received the following error:


Message: The User Control ESSActivityPicker.ascx has caused a compilation error. To view details about this error, enable debugging in the web.config file or view the Windows event logs.

Source: System.Web

Exception details:

c:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\LAYOUTS\ep\ESSActivityPicker.ascx.cs(33): error CS0234: The type or namespace name 'EPGlobalParameters' does not exist in the namespace 'Microsoft.Dynamics.Portal.Application.Proxy' (are you missing an assembly reference?)

at System.Web.Compilation.AssemblyBuilder.Compile()
at System.Web.Compilation.BuildProvidersCompiler.PerformBuild()
at System.Web.Compilation.BuildManager.CompileWebFile(VirtualPath virtualPath)
at System.Web.Compilation.BuildManager.GetVPathBuildResultInternal(VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean throwIfNotFound, Boolean ensureIsUpToDate)
at System.Web.Compilation.BuildManager.GetVPathBuildResultWithNoAssert(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean throwIfNotFound, Boolean ensureIsUpToDate)
at System.Web.Compilation.BuildManager.GetVPathBuildResult(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean ensureIsUpToDate)
at System.Web.UI.TemplateControl.LoadControl(VirtualPath virtualPath)
at Microsoft.Dynamics.Framework.Portal.UI.WebControls.AxUserControlUpdatePanel.LoadControl()

Now, the reason for moving code was to fix this control and fix the error listed above.  When I opened the control up on VS 2010, line 33 is commented out and should not be in error.  When I compiled in VS, it compiled just fine.

After searching for a while I finally gave up and went on my EP server.  I browsed out to the 'ep' folder listed in the error and checked the file.  Sure enough, my changes to code were NOT reflected in this file. 

I simply edited the file, commented out the code, and then tried EP again.  It worked!  No issue at all any more.

Thursday, August 30, 2018

System can't cast 'LedgerJournalEngine)' to 'LedgerJournalEngine_VendInvoice' in Batch

I came across an issue recently where my Timesheets wouldn't post in 'Batch'.

It turns out that it wouldn't perform the following code in 'Batch', but would be fine doing it in the Client.

LedgerJournalEngine_VendInvoice         ledgerJournalEngine;
ledgerJournalEngine = LedgerJournalEngine::construct(LedgerJournalType::VendInvoiceRegister);

If we go to the 'construct' method, we will see it returns the 'default' in the switch case:

default :
            ledgerJournalEngine = new LedgerJournalEngine(_formRun);

When running this in the client, it works fine.  When running it in 'Batch' on the server, it fails:

Unable to cast object of type 'Dynamics.Ax.Application.LedgerJournalEngine' to type 'Dynamics.Ax.Application.LedgerJournalEngine_VendInvoice'.

This does make sense that you can't cast a 'Child' class to it's 'Parent', however, why would this work on the Client but not in Batch?

UPDATE:

The answer here is that in X++, this is allowed.  Thus, the client works.
In CIL, it is a bit more strict and it is not allowed, therefore it fails in 'Batch'

Simple solution is to just make this 'LedgerJournalEngine'.  That is the type that is being returned anyway so it works just fine.