Solved

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


Userlevel 3
Badge

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.

icon

Best answer by sweta68 13 June 2023, 09:34

View original

10 replies

Userlevel 7
Badge +10

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

Userlevel 3
Badge

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

Badge +11

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

Userlevel 7
Badge +17

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

 

Userlevel 3
Badge

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

 

Userlevel 3
Badge

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.

Userlevel 7
Badge +17

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

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

Userlevel 3
Badge

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

Userlevel 7
Badge +17

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

Userlevel 3
Badge

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


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 — 2024  Acumatica, Inc. All rights reserved