Skip to main content
Solved

Accessing data of current record via BQL

  • Jul 19, 2021 5:04 PM UTC
  • 4 replies
  • 641 views
  • Translate All

xkylewrightx
Semi-Pro I
Forum|alt.badge.img+1

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!!!

Best answer by Naveen Boga

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

Naveen Boga
Captain II
Forum|alt.badge.img+20
  • Captain II
  • Answer
  • Jul 19, 2021 5:08 PM UTC

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.

 

Translate

xkylewrightx
Semi-Pro I
Forum|alt.badge.img+1
  • Author
  • Semi-Pro I
  • Jul 19, 2021 5:12 PM UTC

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?

Translate

Naveen Boga
Captain II
Forum|alt.badge.img+20
  • Captain II
  • Jul 19, 2021 5:29 PM UTC

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;

      

Translate

xkylewrightx
Semi-Pro I
Forum|alt.badge.img+1
  • Author
  • Semi-Pro I
  • Jul 19, 2021 5:35 PM UTC

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

Translate