Question

How do you add a search to form? (Purchase Receipts)

  • 17 November 2021
  • 7 replies
  • 73 views

When entering payables (bills to be paid) there is a lovely search box that you can type in an order number and it pulls in any transactions matching that PO.

Unfortunately, the purchase receipts screen is not the same can be a nightmare (especially for those that have multiple warehouses).

You have the option to use the small search functions within each section (i.e. “Type” “Order Nbr.” “Date” “Status” etc. – see below), however, the problem with using those is that the search history stays for the next purchase receipt you do and therefore the purchase receipt screen comes in completely blank.

Ultimately, we need the same search box needs to be available within the Purchase Receipts screen as in the Bills and Adjustments screen.
 

Are there any guides on how I might be able to add this search bar to the “Add Purchase Order” screen?


7 replies

Userlevel 3
Badge +1

There actually already is a field for the Order Number on the POOrderFilter view. You should be able to add that via a customization project. Make sure to set CommitChanges to true so the view will update when you select an order number.

 

Once you have that in you will need to create a graph extension to modify the view to filter based on the order number. It’s quite a lot of BQL but essentially all I did below was add an And2 clause that filters the POOrder by the order number if it is not blank.

    public class POReceiptEntryExt : PXGraphExtension<POReceiptEntry>
{
public static bool IsActive() => true;

[PXCopyPasteHiddenView]
public PXSelect<
POOrderS,
Where<POOrderS.hold, Equal<boolFalse>,
And<POOrderS.status, NotEqual<POOrderStatus.awaitingLink>,
And<POOrder.orderType, NotEqual<POOrderType.regularSubcontract>,
And2<
Where<Current<POReceipt.vendorID>, IsNull,
Or<POOrderS.vendorID, Equal<Current<POReceipt.vendorID>>>>,
And2<
Where<Current<POReceipt.vendorLocationID>, IsNull,
Or<POOrderS.vendorLocationID, Equal<Current<POReceipt.vendorLocationID>>>>,
And2<
Where<Current<POReceiptEntry.POOrderFilter.vendorID>, IsNull,
Or<POOrderS.vendorID, Equal<Current<POReceiptEntry.POOrderFilter.vendorID>>>>,
And2<
Where<Current<POReceiptEntry.POOrderFilter.vendorLocationID>, IsNull,
Or<POOrderS.vendorLocationID, Equal<Current<POReceiptEntry.POOrderFilter.vendorLocationID>>>>,
And2<
Where2<
Where<Current<POReceiptEntry.POOrderFilter.orderType>, IsNull,
And<Where<POOrderS.orderType, Equal<POOrderType.regularOrder>,
Or<POOrderS.orderType, Equal<POOrderType.dropShip>>>>>,
Or<POOrderS.orderType, Equal<Current<POReceiptEntry.POOrderFilter.orderType>>>>,
And2<
Where<POOrderS.orderType, NotEqual<POOrderType.projectDropShip>,
Or<POOrderS.dropshipReceiptProcessing, Equal<DropshipReceiptProcessingOption.generateReceipt>>>,
And2<
Where<POOrderS.shipToBAccountID, Equal<Current<POReceiptEntry.POOrderFilter.shipToBAccountID>>,
Or<Current<POReceiptEntry.POOrderFilter.shipToBAccountID>, IsNull>>,
And2<
Where<POOrderS.shipToLocationID, Equal<Current<POReceiptEntry.POOrderFilter.shipToLocationID>>,
Or<Current<POReceiptEntry.POOrderFilter.shipToLocationID>, IsNull>>,
And2<
Where<Current<APSetup.requireSingleProjectPerDocument>, Equal<boolFalse>,
Or<POOrderS.projectID, Equal<Current<POReceipt.projectID>>>>,
And2<
Where<Current<POReceiptEntry.POOrderFilter.orderNbr>, IsNull,
Or<Current<POReceiptEntry.POOrderFilter.orderNbr>, Equal<POOrderS.orderNbr>>>,
And<POOrderS.cancelled, Equal<boolFalse>,
And<POOrderS.status, Equal<POOrderStatus.open>,
And<POOrderS.curyID, Equal<Current<POReceipt.curyID>>>>>>
>>>>>>>>>>>>,
OrderBy<
Asc<POOrderS.orderDate>>>
openOrders;

}

 

Userlevel 3
Badge

Here is a simple way to fix your issue by setting up AutoReload = True to Add Purchase Order Dialog box. 

Userlevel 3
Badge

@mtreske1 Forgot to mention you need to set AutoRepaint = False, follow the below steps you will achieve your requirement. 

  1. Create Customization
  2. Add Existing Screen - PO302000
  3. Select Dialogs - Add Purchase Order
  4. Set AutoReload = True
  5. Set AutoRepaint = False (By default, it will be set to true)

 

  1. Select Grid - openOrders
  2. Set AllowFilter = True
  3. FastFilterFields = OrderNbr (you can add other fields as well)
  4. Publish the customization
  1. You should be able to see search text box under the gird to filter the records based on the order nbr. 

 

AutoReload property is the key here to reloads and clears the caches in the dialog box every time you open it.

Quick test: 

Filtered the list using the newly added search textbox under the grid
Reopened the same dialog box and there is no previous selection, so all the list appears again in the gird

Happy Coding!

Outstanding.  I can’t thank you all enough for the responses.  This is going to make our lives 100x easier as we continue to integrate more companies and warehouses into our system.

Hopefully Matt understands this more than I do (I’m not a coder), however, I can tell you that last screenshot I see via @Vinay K is literally exactly what I was asking Matt to see if it was possible.

Userlevel 3
Badge

Outstanding.  I can’t thank you all enough for the responses.  This is going to make our lives 100x easier as we continue to integrate more companies and warehouses into our system.

Hopefully Matt understands this more than I do (I’m not a coder), however, I can tell you that last screenshot I see via @Vinay K is literally exactly what I was asking Matt to see if it was possible.

Thank you :relaxed:  @ptreske76 ! 

Thank you so much to both of you for the completely thorough responses. I was just hoping to get a bit of direction and to know whether or not it was even possible. I will give this a go and update with the results. This is fantastic. 

Userlevel 3
Badge

@mtreske1  you are most welcome! will appreciate your feedback. 

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