Skip to main content

Power Automate - Replace flow connections with Connection Reference

 

Today, I was facing an error while trying to turn the flows ON in target environment. It was showing following error.  
{"code":"FlowMissingConnection","message":"The flow is missing a connection for api 'shared_XXXXXXX'. Reauthenticate the connection or remove from the flow and re-save."}}".

Upon further investigation, it has been observed that the flows, having an error while turn ON, were using connections and not connection references.

How did it happen?

When a flow is created outside of solution, and then subsequently added into the solution, it uses connections instead of connection references. And when this solution is imported into target, it creates a new flow outside of solution irrespective of it being inside the solution.

Thus, it should always be a best practice to create flows inside solution as connection references are only supported in solution bound flows.

How to identify if a flow is using connections or connection references

When you open a flow, the right side of the section tells us whether it is using connections or connection references as shown below:


How can I fix the flows that are created accidently outside of solution with connections?

As of now there is no way to replace connections with connection references from UI. Some of the blog suggests to re-create these flows which not seems to a convenient way if these flows are large in number.

I have the flows placed in separate flow solution but still someone has created them outside of solution and added into flows solution.

Looking at these large number of flows, I have put these erroneous flows (having connections and not connection references) in another unmanaged solution in dev environment. Exported the solution as unmanaged and reimported in to the same dev environment. After import, these connections are replaced with connection references. 

After above step, I have exported flows solution as managed and imported in target environment again. 

This time I could turn the flows ON without any issue.

Comments

Popular posts from this blog

AX 7 - Get record marked and record selected on grid control in X++

Marked Records In AX, we often face a situation where we need to get the reference of those records which are marked on grid control. Using below code you can get those marked records in X++. Records marked can be seen in screenshot on the left. Array markedRecords = gridControl_DS.recordsMarked(); var lastMarkedRecord = markedRecords.lastIndex(); You will get a recId of last marked record in lastMarkedRecord. Using recordMarked() method of grid control data source, you can get an array of marked records which can be used for further iteration based on requirement. Selected Records At the same time, there is another operation called as Selected Records. When a grid control loads, a default first record is selected from the grid. To iterate through selected records, use below code. for (inv = gridControl_ds.getFirst(true) ? gridControl_ds.getFirst(true) : gridControl_ds.cursor(); inv; inv = gridControl_ds.getnext()) {    //logic here } gridControl_...

Mark Customer Transaction from X++ in AX2012

Use below code to mark customers open transaction from X++. static void MarkOpenTransaction() {     custInvoiceJour custInvoiceJour;     SalesTable  salesTable;     specTrans   specTrans;     custTrans   custTrans;     custTransOpen   custTransOpen;     TaxWithholdTrans    taxWithHoldTrans;     TaxWithhold_CustPaym taxWithhold;     CustVendOpenTransManager manager;     ExchangeRateHelper  exch;     AmountCur   totalSettleAmount;     ;     select firstOnly custInvoiceJour where custInvoiceJour.InvoiceId == '004452' ; // && _custInvoiceJour.SalesId == xml_SalesID.text();     if (custInvoiceJour)     {         ttsBegin ;  ...

Call javascript function on sub-grid refresh/load in Microsoft Dynamics CRM

Recently, I came across a requirement where I had to do some calculation based on records added/deleted in sub-grid on CRM form. To achieve this, I have added load event on sub-grid in javascript where I could call the method which is doing the calculations. Below piece of code will be used to add load event on sub-grid and function addEventToGridRefresh() should be registered on form load. function addEventToGridRefresh() { // retrieve the subgrid var grid = Xrm.Page.getControl('#GridControlName#'); // if the subgrid still not available we try again after 2 second if (grid == null) { setTimeout(function () { addEventToGridRefresh(); }, 2000); return; } // add the function to the onRefresh event Xrm.Page.getControl('#GridControlName#').addOnLoad(totalAssetsOfHousehold); // This is used to delay refresh by 1 second because sometimes grid takes time to load. // If you do not include below line, you may not ...