Jacob created a new topic ' Custom Searches' in the forum. 5 years ago

Hello,

There are a few Custom searches that we are trying to set up so that we can change what is shown to our users when they are, for example, searching Customer Orders. In this example we want to show additional information from a related custom table, that is in the join. I have spent some time in the Search Manager and managed to construct a new search from a custom view within the system, and I also managed to get that view to show as on option in Find Customer Order. All the information displays how I would expect it to, however when you click an order, the form opens as a new sales order, rather than Sales Order details. No errors are returned, just the New Sales order form. Is this the correct approach for what I am looking to do? If so, how do I get the search to open a Sales Order Detail form instead of a New Sales Order form?

The following are the two views, the original one used for finding a sales order, and our custom one.

CustomerSalesOrderSearchListView (Original)
SELECT SO.SalesOrderCode,
SO.BillToCode AS CustomerCode,
SO.BillToName AS CustomerName,
SO.ShipToName AS ShipToName,
SO.SalesOrderDate AS [Date],
SO.POCode AS CustomerPO,
SO.SalesRepOrderCode AS Ref2,
WF.Stage,
SO.TotalRate AS Total,
SO.CurrencyCode AS Currency,
SO.IsPrinted,
SO.UserCreated,
SO.Type,
SO.IsProcessed,
SO.IsVoided,
SO.CBNState ,
ISNULL(SO.IsPriority,0) AS [Priority],
W.WarehouseDescription
FROM CustomerSalesOrder SO INNER JOIN
( SELECT SalesOrderCode,
CASE WHEN COUNT(*) > 1 THEN 'Multiple' ELSE MIN(Stage) END AS Stage
FROM CustomerSalesOrderWorkflow
GROUP BY
SalesOrderCode) WF ON SO.SalesOrderCode = WF.SalesOrderCode
INNER JOIN InventoryWarehouse W ON SO.WarehouseCode = W.WarehouseCode
WHERE SO.Type = 'Sales Order' OR SO.Type = 'Back Order'

CustomerSalesOrderSearchListViewSHG_C (Custom)
SELECT
SO.SalesOrderCode,
SO.BillToCode AS CustomerCode,
SO.BillToName AS CustomerName,
SO.ShipToName AS ShipToName,
SO.ShipToCode AS ShipToCode,
SO.SalesOrderDate AS [Date],
SO.POCode AS CustomerPO,
SO.SalesRepOrderCode AS Ref2,
WF.Stage,
SO.TotalRate AS Total,
SO.CurrencyCode AS Currency,
SO.IsPrinted,
SO.UserCreated,
SO.Type,
SO.IsProcessed,
SO.IsVoided,
SO.CBNState ,
SO.WarehouseCode,
ISNULL(SO.IsPriority,0) AS [Priority],
W.WarehouseDescription,
CAST(DIFOT.MPXJobID_C AS INT) AS MPXJobId
FROM CustomerSalesOrder SO INNER JOIN
( SELECT SalesOrderCode,
CASE WHEN COUNT(*) > 1 THEN 'Multiple' ELSE MIN(Stage) END AS Stage
FROM CustomerSalesOrderWorkflow
GROUP BY
SalesOrderCode) WF ON SO.SalesOrderCode = WF.SalesOrderCode
INNER JOIN InventoryWarehouse W ON SO.WarehouseCode = W.WarehouseCode
LEFT JOIN CustomerSalesOrderDIFOT_C DIFOT ON SO.SalesOrderCode = DIFOT.SalesOrderCode_C
WHERE SO.Type = 'Sales Order' OR SO.Type = 'Back Order'
All changes have been made in the client.

The view works perfectly fine, it is just that clicking on a record opens a New Sales order.

The Form it is targeting was SalesOrderForm and the Accessibility Action is CustomerFindOrder.

As far as I understand that should open the form with the details of the record that is selected. I could not find anywhere to set a condition along the lines of "where SalesOrderCode = [clickedSalesOrderCode]"

Read More...