Skip to main content
Solved

PrimaryKeyOf does not contain a definition for BaseBy

  • 14 August 2024
  • 4 replies
  • 27 views

Upgrading a customization project from 23R1 to 24R1 I’m getting the following error:

PrimaryKeyOf<MyDAC> does not contain a definition for BaseBy

Here’s the line of code.

PrimaryKeyOf<MyDAC>.BaseBy<MyDAC.field1, Config>.FindBy(graph, field1);

Is there a different namespace needed or has the BaseBy been removed.

 

Thanks

Scott

HI @scottstanaland12 

 

you can try this

 

public class PK : PrimaryKeyOf<DAC>.By<field>
{
public static DAC Find(PXGraph graph, DataTypeOfTheField field) => FindBy(graph, field);
}

 


@palbores ,

 

Thanks! That worked.  I’m unsure how to update the foreign key definition in the following code.

 

I’m getting the same error related to the BaseBy

 

public static class FK
{


public class Country : PrimaryKeyOf<PX.Objects.CS.Country>.BaseBy<PX.Objects.CS.Country.countryID, PrimaryKeyOf<PX.Objects.CS.Country>.By<PX.Objects.CS.Country.countryID>.Config>.ForeignKeyOf<AHSVendorCoreAddress>.By<countryID>
{
}
}

 


@scottstanaland12 

 

This is for the Foreign Key.

 

public static class FK
{
public class Country :
PX.Objects.CS.Country.PK.ForeignKeyOf<AHSVendorCoreAddress>.By<countryID>
{
}
}

 


@palbores 

That did the trick, I’m past all my compile errors now.

Thanks for your help!


Reply