Solved

Accessing data of current record via BQL

  • 19 July 2021
  • 4 replies
  • 32 views

Hi,

Appologies if this question is not clear, I am still learning -- I am trying to extend the SOOrderEntry graph and need to create a SelectFrom query that uses as a parameter the OrderNbr of the Sales Order that is currently opened by the user for editing. Is there a way to access this?

I have tried:

 public SelectFrom<WorkflowVars>.Where<WorkflowVars.refordernbr.IsEqual<Current<SOLine.orderNbr>>>.View WorkflowVars;

Among other similar queries, with no luck.

If it is helpful, the error I am getting with the above query is 

The type 'PX.Data.Current<PX.Objects.SO.SOLine.orderNbr>' cannot be used as type parameter 'TOperand' in the generic type or method 'BqlOperand<WorkflowVars.refordernbr, IBqlString>.IsEqual<TOperand>'. There is no implicit reference conversion from 'PX.Data.Current<PX.Objects.SO.SOLine.orderNbr>' to 'PX.Common.IImplement<PX.Data.BQL.IBqlEquitable>'.

Which I believe is because ‘Current’ is returning Null, but just a guess.

 

Any guidance would be much appreciated!!!

icon

Best answer by Naveen B 19 July 2021, 19:08

Hey @xkylewrightx  Can you please try below View and check once.

 

public PXSelect<WorkflowVars, Where<WorkflowVars.refordernbr, Equal<Current<SOLine.ordernbr>>>> WorkflowVars;

 

It would be recommended have the OrderType also in the condition.

 

View original

4 replies

Userlevel 6
Badge +8

Hey @xkylewrightx  Can you please try below View and check once.

 

public PXSelect<WorkflowVars, Where<WorkflowVars.refordernbr, Equal<Current<SOLine.ordernbr>>>> WorkflowVars;

 

It would be recommended have the OrderType also in the condition.

 

Hey @xkylewrightx  Can you please try below View and check once.

 

public PXSelect<WorkflowVars, Where<WorkflowVars.refordernbr, Equal<Current<SOLine.ordernbr>>>> WorkflowVars;

 

It would be recommended have the OrderType also in the condition.

 

 

This works! Thank you so much for the prompt and helpful response. Is there any way you can help me understand the difference between what you did and what I tried?

Userlevel 6
Badge +8

Hi @xkylewrightx  Please find the difference and syntaxissue.

Your Query

  public SelectFrom<WorkflowVars>.Where<WorkflowVars.refordernbr.IsEqual<Current<SOLine.orderNbr>>>.View WorkflowVars;

 

Modified above query and below both queries are working fine.

public SelectFrom<WorkflowVars>.Where<WorkflowVars.refordernbr.IsEqual<SOLine.orderNbr.FromCurrent>>.View WorkflowVars;

OR

public PXSelect<WorkflowVars, Where<WorkflowVars.refordernbr, Equal<Current<SOLine.ordernbr>>>> WorkflowVars;

      

@Naveen B I see now, thank you again for your help

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