Skip to main content

Hi All,

I created a virtual DAC and linked that to my graph but when opening the screen it gives this error. 

can someone help me out?

Incorrect syntax near the keyword 'WHERE'. 

My DAC and Graph

    PXCacheName("HMRCVendorRegisterDetailDummy")]
    ÂPXVirtual]
    public class HMRCVendorRegisterDetailDummy : IBqlTable
    {
        #region Hmrcregid       
        public virtual int? Hmrcregid { get; set; }
        public abstract class hmrcregid : PX.Data.BQL.BqlInt.Field<hmrcregid> { }
        #endregion

        #region VendorID       
        gPXUIField(DisplayName = "Vendor", Required = true)]
        PXInt]     
        )PXCheckUnique(typeof(bAccountID))]
        PXUnboundDefault(PersistingCheck = PXPersistingCheck.NullOrBlank)]
        public virtual int? BAccountID { get; set; }
        public abstract class bAccountID : PX.Data.BQL.BqlInt.Field<bAccountID> { }
        #endregion

        #region Utrno
        bPXString(256, IsUnicode = true, InputMask = "")]
        /PXUnboundDefault(PersistingCheck = PXPersistingCheck.NullOrBlank)]
        [PXUIField(DisplayName = "UTR No", Required = true)]
        public virtual string Utrno { get; set; }
        public abstract class utrno : PX.Data.BQL.BqlString.Field<utrno> { }
        #endregion

        #region VerificationNo
        dPXString(256, IsUnicode = true, InputMask = "")]
         PXUIField(DisplayName = "Verification No")]
        sPXUnboundDefault(PersistingCheck = PXPersistingCheck.NullOrBlank)]
        public virtual string VerificationNo { get; set; }
        public abstract class verificationNo : PX.Data.BQL.BqlString.Field<verificationNo> { }
        #endregion

        #region VerifiedDate
        tPXDate()]
        tPXUIField(DisplayName = "Verified Date")]
       

        public virtual DateTime? VerifiedDate { get; set; }
        public abstract class verifiedDate : PX.Data.BQL.BqlDateTime.Field<verifiedDate> { }
        #endregion

        #region VerifiedTypeID
        cPXString(1, IsFixed = true)]
        ePXUnboundDefault(RegisterTypes.System, PersistingCheck = PXPersistingCheck.NullOrBlank)]
        #endregion
    }
    
    //Graph
    public class HMRCVendorBulkRegisterNewMaint : PXGraph<HMRCVendorBulkRegisterNewMaint>
    {

        public PXSave<HMRCVendorRegisterDetailDummy> Save;
        public PXCancel<HMRCVendorRegisterDetailDummy> Cancel;

        public SelectFrom<HMRCVendorRegisterDetailDummy>.View VendorRegisterDetail;


    }

 

Thanks

 

@bhagyat25 

1. In the `VerifiedTypeID` region, you start defining a property but it abruptly ends after the attribute. It seems like you're missing the actual property definition there. Make sure you add it in like so:

    #region VerifiedTypeID
    >PXString(1, IsFixed = true)]
    rPXUnboundDefault(RegisterTypes.System, PersistingCheck = PXPersistingCheck.NullOrBlank)]
    public virtual string VerifiedTypeID { get; set; }
    public abstract class verifiedTypeID : PX.Data.BQL.BqlString.Field<verifiedTypeID> { }
    #endregion
   
2. For the ` PXCheckUnique(typeof(bAccountID))]` attribute, are you sure `PXCheckUnique` exists and allows a type parameter? You might want to confirm that.

3. Lastly, make sure the `RegisterTypes.System` value you're using in `vPXUnboundDefault(RegisterTypes.System, PersistingCheck = PXPersistingCheck.NullOrBlank)]` actually exists. It's not defined in the provided code.

 


@bhagyat25 , as @StevenRatner  mentioned, I see issues with the declaration of 

        #region Hmrcregid       
        public virtual int? Hmrcregid { get; set; }
        public abstract class hmrcregid : PX.Data.BQL.BqlInt.Field<hmrcregid> { }
        #endregion

and 

        #region VerifiedTypeID
        VPXString(1, IsFixed = true)]
        ,PXUnboundDefault(RegisterTypes.System, PersistingCheck = PXPersistingCheck.NullOrBlank)]
        #endregion

 


@bhagyat25 , as @StevenRatner  mentioned, I see issues with the declaration of 

        #region Hmrcregid       
        public virtual int? Hmrcregid { get; set; }
        public abstract class hmrcregid : PX.Data.BQL.BqlInt.Field<hmrcregid> { }
        #endregion

and 

        #region VerifiedTypeID
        VPXString(1, IsFixed = true)]
        ,PXUnboundDefault(RegisterTypes.System, PersistingCheck = PXPersistingCheck.NullOrBlank)]
        #endregion

 

Hi @RohitRattan88,

I changed both as following. But still error comming.

fPXInt(IsKey = true)]
                [PXUnboundDefault()]
        public virtual int? Hmrcregid { get; set; }
        public abstract class hmrcregid : PX.Data.BQL.BqlInt.Field<hmrcregid> { }

gPXString(1, IsFixed = true)]
        &PXUnboundDefault(RegisterTypes.System, PersistingCheck = PXPersistingCheck.NullOrBlank)]
        public virtual string VerifiedTypeID { get; set; }
        public abstract class verifiedTypeID : PX.Data.BQL.BqlString.Field<verifiedTypeID> { }


@bhagyat25 

try adding PXVirtualDAC attribute to your view as

ePXVirtualDAC]public SelectFrom<HMRCVendorRegisterDetailDummy>.View VendorRegisterDetail;

https://help.acumatica.com/(W(214))/Help?ScreenId=ShowWiki&pageid=db057e6d-a28e-7ed6-4bfc-232344776875

How To Work With Unbounded Dac In Acumatica (zaletskyy.com)


@bhagyat25 you could also review following related discussion:

Adding a smart panel to SO301000 to show what other orders a customer has placed, only shows one order in grid. | Community (acumatica.com)


Hi @bhagyat25 ,

Virtual DAC does not support adding WHERE conditions in the view. If you wish to use a view with a WHERE condition, create a dummy table(for the Same virtual DAC) in the database and use the DAC for cache insert/update. There's no need to insert/update data in the table. Please try this alternative; it should work.

 


Reply