Skip to main content

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.

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


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


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


@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;

 


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

 


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.


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

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


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


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


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