1

Similar post to this:

Curious about properly defining the DAC.

I have a T-SQL CREATE VIEW script that I've added to the 'Database Scripts' are of the Customization project as shown. But I suspect that I haven't added the DAC properly. When I attempt to add this DAC within the context of a Generic Inquiry 'Add Related table' screen I do not get any results when searching for the name of the DAC I tried to create.

When I initially attempted to define the DAC in the 'Code' area, the system complained that the object didn't exist in the database. This makes sense as it's a SaaS instance and I've just created the T-SQL view from a local copy of the database.

So I just added the CREATE VIEW statement within the 'Database Scripts' area and published the customization successfully.(This implies to me that the object exists in the database now).

But I now believe I need to retroactively 'Generate Members from Database' in order to identify the key fields so Acumatica can see how it aligns with other DACs. Is this a correct assumption?

In the CODE area I see this (where vGFCINItemClassSeg is the name of the SQL view )

using System;
using PX.Data;

namespace vGFCINItemClassSeg
{
  [Serializable]
  [PXCacheName("vGFCINItemClassSeg")]
  public class vGFCINItemClassSeg : IBqlTable
  {
  }
}

Any suggestions on how to properly provide Acumatica with what it needs to associate this to the INItemClass table in the database and make it available as a DAC?

SQL Learner
  • 89
  • 1
  • 1
  • 7

1 Answers1

0

Got this resolved. Problem was that I had attempted to add the DAC prior to adding the Database script.

Solution: unpublish the customization package. drop the custom SQL view from the database. Start a new customization package. Add the Database Script first. THEN publish. Then after that is successful, re-open the customization project and add the DAC as a second step.

SQL Learner
  • 89
  • 1
  • 1
  • 7
  • Nice work, yes, your DAC above had no properties in it so you wouldnt have had any fields in the GI to access anyway. Once the view is in the DB the "Create DAC from DB" routine pulls the fields in in code properly. – Kyle Vanderstoep Jun 24 '22 at 17:13
  • I just came across (and resolved) another issue. I found that my table linking wasn't working properly in Report Designer. I learned that I needed to manually edit the DAC code that Acumatica Generates when it "Generates Members from Database." It does not ID the key field. To get the key field, I found the main table in the SQL view, checked the DAC schema browser, found the field where IsKey=Yes and added that to the DAC. – SQL Learner Jun 24 '22 at 22:04