Skip to main content
Solved

Need to avoid getting cancelled sales orders to the customized smart panel


Forum|alt.badge.img

Hi all,

I have a new customized screen . I’m adding sales orders to the grid of the screen taken from sales orders screen line level. To select sales order lines, I use a custom smart panel as below. 

As highlighted above,  I need to avoid loading sales orders when the status is ‘Cancelled’ to my smart panel. To accomplish that, can someone help me to modify the below view definition which I already use to get values form both SOOrder and SOline DAC’s to the smart panel or any other suggestion to do it?

public PXSelectJoin<SOLine,
          InnerJoin<SOOrder, On<SOLine.orderNbr, Equal<SOOrder.orderNbr>,
          And<SOLine.orderType, Equal<SOOrder.orderType>>>>, Where<SOLine.customerID, Equal<Current<APProforma.customerID>>,
          And<SOOrder.customerLocationID, Equal<Current<APProforma.locationCD>>>>>
          POrdersView;

Thank you.

Best answer by sweta68

Hi @oshadarodrigo64 ,

I have not implemented it yet, but could you please try the following view?

public PXSelectJoin<SOLine,
InnerJoin<SOOrder,
On<SOLine.orderNbr, Equal<SOOrder.orderNbr>,
And<SOLine.orderType, Equal<SOOrder.orderType>>>>,
Where<SOLine.customerID, Equal<Current<APProforma.customerID>>,
And<SOOrder.customerLocationID, Equal<Current<APProforma.locationCD>>,
And<SOOrder.status, NotEqual<SOOrderStatus.cancelled>>>>>
POrdersView;

I have just added the condition for SOOrderStatus to exclude the "Cancelled" status.

Hope, it helps!

Regards,

Sweta

View original
Did this topic help you find an answer to your question?

10 replies

Forum|alt.badge.img+10
  • Semi-Pro III
  • 229 replies
  • Answer
  • June 13, 2023

Hi @oshadarodrigo64 ,

I have not implemented it yet, but could you please try the following view?

public PXSelectJoin<SOLine,
InnerJoin<SOOrder,
On<SOLine.orderNbr, Equal<SOOrder.orderNbr>,
And<SOLine.orderType, Equal<SOOrder.orderType>>>>,
Where<SOLine.customerID, Equal<Current<APProforma.customerID>>,
And<SOOrder.customerLocationID, Equal<Current<APProforma.locationCD>>,
And<SOOrder.status, NotEqual<SOOrderStatus.cancelled>>>>>
POrdersView;

I have just added the condition for SOOrderStatus to exclude the "Cancelled" status.

Hope, it helps!

Regards,

Sweta


Forum|alt.badge.img

Hi @sweta68 , Thank you for the response, I will test your solution. However, I realized that SOOrder.status value for cancelled status is ‘L’ in database. If it is, how can I set it into a where clause with the above pxselectjoin? for example I tried like below but it didn’t set appropriately. 

Where<SOOrder.status, NotEqual<>>> 


darylbowman
Captain II
Forum|alt.badge.img+13

The SOOrderStatus.cancelled is a BQL constant, which at its root, will match the database value of ‘L’.


Naveen Boga
Captain II
Forum|alt.badge.img+19
  • Captain II
  • 3377 replies
  • June 13, 2023

@oshadarodrigo64   If we need to add such conditions, we should use the BQL constants like SOOrderStatus.cancelled, and adding characters in BQL queries will not work (L).

 SOOrderStatus.cancelled which is nothing but “L”

 SOOrderStatus.cancelled → BQL Constant

“L” → will be stored in the Database

 

As provided above, please use the below VIEW, so that it will load all the Sales Order except Cancelled Status

public PXSelectJoin<SOLine, InnerJoin<SOOrder, On<SOLine.orderNbr, Equal<SOOrder.orderNbr>, And<SOLine.orderType, Equal<SOOrder.orderType>>>>, Where<SOLine.customerID, Equal<Current<APProforma.customerID>>, And<SOOrder.customerLocationID, Equal<Current<APProforma.locationCD>>, And<SOOrder.status, NotEqual<SOOrderStatus.cancelled>>>>> POrdersView;

 


Forum|alt.badge.img

Thank you @Naveen Boga , @darylbowman for the clarification.

 


Forum|alt.badge.img

Hi @Naveen Boga , @sweta68 , @darylbowman 

sorry for the delayed update, I applied the suggested constant to the query but it shows me an error.

CS0305: using generic type 'where<unary operator>' requires 1 type arguments

how can I solve this? appreciate if you can help me on this as well. Thanks.


Naveen Boga
Captain II
Forum|alt.badge.img+19
  • Captain II
  • 3377 replies
  • June 16, 2023

Hi @oshadarodrigo64  I don’t see any issue with the above query.

Can you please share what you have added to your code?


Forum|alt.badge.img

oh @Naveen Boga , sorry for the mistake, There was an additional bracket in the query, that was the issue. apologize you again. Thanks.


Naveen Boga
Captain II
Forum|alt.badge.img+19
  • Captain II
  • 3377 replies
  • June 16, 2023

@oshadarodrigo64  No problem at all! I’m glad that you figured out !!


Forum|alt.badge.img

Hi @Naveen Boga ,

small favor please, If I need to add another condition to above query to restrict loading SOOrder.OpenQty == 0 orders, how can I do it?. I could see some conditions like Greater<decimal0> , the idea of this like greater than 0 isn’t it? if so, how can I apply with the above query? appreciate if you can help me on this as well. Thanks.
 


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings