Hello,
I am encountering an issue with the display of a foreign key in my Data Access Class (DAC) within Acumatica. Despite following the documentation and ensuring that the relationships and configurations are correctly set, the foreign key does not appear in the DAC UI.
Brewery DAC :
using System;
using PX.Data;
using PX.Data.ReferentialIntegrity.Attributes;
using PX.Data.BQL.Fluent;
namespace Assainissement
{
[PXCacheName("Brewery")]
public class Brewery : IBqlTable
{
[PXDBIdentity(IsKey = true)]
public virtual int? BreweryID { get; set; }
public abstract class breweryID : PX.Data.BQL.BqlInt.Field<breweryID> { }
[PXDBString(50, IsUnicode = true)]
[PXUIField(DisplayName = "Name")]
public virtual string Name { get; set; }
public abstract class name : PX.Data.BQL.BqlString.Field<name> { }
[PXDBBool]
[PXDefault(true)]
[PXUIField(DisplayName = "State")]
public virtual bool? State { get; set; }
public abstract class state : PX.Data.BQL.BqlBool.Field<state> { }
}
}
Beer DAC :
using System;
using PX.Data;
using PX.Data.ReferentialIntegrity.Attributes;
using PX.Data.BQL.Fluent;
namespace Assainissement
{
[PXCacheName("Beer")]
public class Beer : IBqlTable
{
[PXDBIdentity(IsKey = true)]
public virtual int? BeerID { get; set; }
public abstract class beerID : PX.Data.BQL.BqlInt.Field<beerID> { }
[PXDBString(50, IsUnicode = true)]
[PXUIField(DisplayName = "Name")]
public virtual string Name { get; set; }
public abstract class name : PX.Data.BQL.BqlString.Field<name> { }
[PXDBBool]
[PXDefault(true)]
[PXUIField(DisplayName = "Active")]
public virtual bool? Active { get; set; }
public abstract class active : PX.Data.BQL.BqlBool.Field<active> { }
[PXDBInt]
[PXDefault(typeof(Brewery.breweryID))]
[PXUIField(DisplayName = "BreweryID")]
[PXSelector(typeof(Search<Brewery.breweryID>),
typeof(Brewery.name),
SubstituteKey = typeof(Brewery.name),
DescriptionField = typeof(Brewery.name))]
[PXForeignReference(typeof(Field<Beer.breweryID>.IsRelatedTo<Brewery.breweryID>))]
[PXParent(
typeof(Select<Brewery,
Where<Brewery.breweryID,
Equal<Current<Beer.breweryID>>>>)
)]
public virtual int? BreweryID { get; set; }
public abstract class breweryID : PX.Data.BQL.BqlInt.Field<breweryID> { }
}
}
Result :
