Solved

The condition inside a BQL select _____ must be parameterized?

  • 30 August 2021
  • 2 replies
  • 44 views

Let me know if this is not the correct place to pose this question, but I’m currently following the T210 training materials and was given the task to create a master/detail relationship between 2 DACs.  I believe I’ve done this but keep getting met with the error in the topic title and not sure how to proceed forward.  My dac properties are defined exactly like they are in the GIT example and not sure where else to look to try and figure this out -

 

        #region ServiceID
        [PXDBInt(IsKey = true)]
        [PXDBDefault(typeof(RSSVRepairPrice.serviceID))]
        [PXParent(typeof(SelectFrom<RSSVRepairPrice>.
            Where<RSSVRepairPrice.deviceID.IsEqual<RSSVLabor.deviceID>.
                And<RSSVRepairPrice.serviceID.IsEqual<RSSVLabor.serviceID>>>))]

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

 

Any help would be greatly appreciated

icon

Best answer by Naveen B 30 August 2021, 21:19

View original

2 replies

Userlevel 7
Badge +10

Hi @kmauzoul97  Please find the sample Parent and Child DAC fields for your reference.

 

// Parent DAC Field

#region ParentProcessID

[PXDBInt]
[PXUIField(DisplayName = "Process ID")]
public virtual int? ParentProcessID { get; set; }
public abstract class parentProcessID : IBqlField { }

#endregion




//Child DAC Field

#region ProcessID

[PXDBInt()]
[PXUIField(DisplayName = "Process ID")]
[PXDBDefault(typeof(SOOrderProcessLog.processID))]
[PXParent(typeof(Select<SOOrderProcessLog, Where<SOOrderProcessLog.parentProcessID, Equal<Current<SOOrderLevelProcessLog.processID>>>>))]
public virtual int? ProcessID { get; set; }
public abstract class processID : IBqlField { }

#endregion

 

For your example, it should be like below.

//I'm assuming that 

// RSSVRepairPrice --> Parent DAC
// RSSVLabor --> Child DAC


#region ServiceID
[PXDBInt(IsKey = true)]
[PXDBDefault(typeof(RSSVRepairPrice.serviceID))]

[PXParent(typeof(Select<RSSVRepairPrice, Where<RSSVRepairPrice.serviceID, Equal<Current<RSSVLabor.deviceID>>>>))]
public virtual int? ServiceID { get; set; }
public abstract class serviceID : PX.Data.BQL.BqlInt.Field<serviceID> { }
#endregion

 

Attaching article link for more details..

https://asiablog.acumatica.com/2019/04/grids-master-detail-relationship.html

Hi @kmauzoul97  Please find the sample Parent and Child DAC fields for your reference.

 

// Parent DAC Field

#region ParentProcessID

[PXDBInt]
[PXUIField(DisplayName = "Process ID")]
public virtual int? ParentProcessID { get; set; }
public abstract class parentProcessID : IBqlField { }

#endregion




//Child DAC Field

#region ProcessID

[PXDBInt()]
[PXUIField(DisplayName = "Process ID")]
[PXDBDefault(typeof(SOOrderProcessLog.processID))]
[PXParent(typeof(Select<SOOrderProcessLog, Where<SOOrderProcessLog.parentProcessID, Equal<Current<SOOrderLevelProcessLog.processID>>>>))]
public virtual int? ProcessID { get; set; }
public abstract class processID : IBqlField { }

#endregion

 

For your example, it should be like below.

//I'm assuming that 

// RSSVRepairPrice --> Parent DAC
// RSSVLabor --> Child DAC


#region ServiceID
[PXDBInt(IsKey = true)]
[PXDBDefault(typeof(RSSVRepairPrice.serviceID))]

[PXParent(typeof(Select<RSSVRepairPrice, Where<RSSVRepairPrice.serviceID, Equal<Current<RSSVLabor.deviceID>>>>))]
public virtual int? ServiceID { get; set; }
public abstract class serviceID : PX.Data.BQL.BqlInt.Field<serviceID> { }
#endregion

 

Attaching article link for more details..

https://asiablog.acumatica.com/2019/04/grids-master-detail-relationship.html

 

Thank you - this worked.  Any particular reason why this syntax works over the syntax I was taught in the training materials ?

Reply


About Acumatica ERP system
Acumatica Cloud ERP provides the best business management solution for transforming your company to thrive in the new digital economy. Built on a future-proof platform with open architecture for rapid integrations, scalability, and ease of use, Acumatica delivers unparalleled value to small and midmarket organizations. Connected Business. Delivered.
© 2008 — 2020  Acumatica, Inc. All rights reserved