Skip to main content

D365 Solution Import failed. The dependent component SavedQuery (Id='View Id' does not exists. Failure trying to associated it with SystemForm (Id='Form Id') as a dependency. Missing dependency lookup type = PrimaryKeyLookup.

Another day, another error while importing managed solution to production. The error suggests that the view (saved query) behind the sub grid which is placed on the form (Form Id) is not present in the solution.

"The dependent component SavedQuery (Id="View Id") does not exist. Failure trying to associate it with SystemForm (Id="Form Id") as a dependency. Missing dependency lookup type = PrimaryKeyLookup."

Here is this can be fixed:

  • Open customization xml in notepad (I recommend notepad++ ) and search with "View Id".



  • Identify the form where this sub grid is placed.
  • Open form -> Open sub grid properties.
  • Set view selector to "Show All Views", save and publish the form.
  • Open the same form again and set view selector to Off, save and publish the form.

Now you can export and import the solution again. It will work!


How it happened? I believe, when we do customization (place sub grid in this case) on the form from power platform and publish it, it actually does not publish view selector metadata in the solution. Thus, we need to do this step again from legacy form customizer. 

Hope it helps!

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 ;  ...