I have a grid which displays only SOLine and SOOrder data. In my case, SOLine is the main DAC, because the purpose of the grid is to perform mass updates of the transactions. I wish to add the OrderNbr in the grid, so the user can select and open the sales order popup. I notice the order number field does not appear as a hyperlink, if use SOOrder table in my grid. Next I try SOLine.orderNbr. However the field type is only TextEdit. Here is a workaround
I created the SOLine cache extended and defined a non-bound field. Something simple like ExtraSOOrder field. Next I create a PXAction which creates the SOOrderEntry graph and performs the redirect, and achieves the goal. I notice something odd in the grid. OrderNbr is displayed twice. Although the field is only added once in the grid, the webpage adds the field a second time. In fact, the user is unable to remove the duplicate order number field, in the column selector. The duplicate field has a yellow icon which I have not seen before.
What is the best way to add the redirect, to the sales order entry page? The behavior works perfectly for the Inventory item field in this grid. OrderNbr is more challenging.
All that was required was to add the SOOrder.orderNbr to the grid columns collection. Then assign the action to the Linkedcommand property, to that field. No need to create a cache extension for all of this.
Related
For example, I had created a custom field 'Brand' at detail of stock items in BLC 'InventoryItemMaint'.
But how to show the 'Brand' custom field at detail of sale order page? In different BLC 'SOOrderEntry'.
I'm assuming you added your custom column to InventoryItem DAC like this:
First locate the other DAC where you want that custom field to appear. You can use Acumatica Inspect Element feature in Customization menu and then click on the grid where you want the field to appear:
This will tell you which DAC is bound to the grid, SOLine in this case:
SOLine contains a selector for the InventoryItem (SOLine.InventoryID). Add your custom field to SOLine InventoryItem selector so it becomes available in the selector window. You can do this by extending SOLine DAC, choose Add Field->Change Attributes of Base Field. The selector columns button will add stub code containing the existing columns, you can add your custom field in there:
This will make the custom column visible in Sales Order detail InventoryItem selector window:
Now you can add a new custom unbound (non-persisted) field to SOLine that will display your InventoryItem custom field using the SOLine InventoryItem selector:
Notice the PXFormula attribute that will fetch the custom field in InventoryItem DAC extension using SOLine.InventoryID selector:
[PXFormula(typeof(Selector<SOLine.inventoryID, PX.Objects.IN.InventoryItemExt.usrBrand>))]
Customize the Sales Order Entry screen to add the SOLine custom field to the detail grid:
Final result, custom field is displayed in Sales Order Entry screen detail grid:
In the stock item screen, a custom grid is added. The DAC for the custom grid contains InventoryItem.inventoryID. That particular grid has a custom field in which the user wishes to search for, inside the inventory item selector control. I refer to the primary Inventory Item selector control for the stock item screen.
In normal circumstances, the customization manager allows you to select a particular field, and add that to the grid which appears inside the selector control. That is simple, since the field is a member of the same DAC. But in my case, I wish to add a column from the related data view. Since the primary data view has no knowledge of grid, the needed column is not available for selection. Also there is a high probability that records will be repeated inside the selector control, since the relation is one to many. This is acceptable.
I try the following suggestions.
1) use Cache_attached event handler, for InventoryItem.InventoryCD.
I add my own custom PXSelect statement which joins InventoryItem & CustomTable. But an error occurs: A foreign key reference cannot be created from the type 'PX.Data.PXSelectJoin`3[PX.Objects.IN.InventoryItem (ect)
2) Declare data view delegate for Items which yields type InventoryItem & CustomDAC. This approach returns no errors. However I am unable to select the user field, in the field selection panel.
3) Create a Project on InventoryItem DAC and write a PXSelect to join the two tables. I am unsure if this is the correct approach.
I wish to know if anyone has suggestions
You should follow the approach suggested here to concatenate field values from a related data view into a custom text column inside the InventoryItem table.
Looking to 'exclude' the inventory item description but 'add' a custom field against the inventory item master (called model).
I thought I found where this is stored in the aspx of the screen but any changes I make don't seem to make a difference.
Does anyone know if fastfilters can be edited/altered to exclude/include different fields? Thanks in advance.
FastFilter fields in Form/Detail inquiry grid are inclusive, you pick only the one you need, the others are excluded by default.
For an Inquiry Grid, modify the property FastFilterFields of the Grid element. The value is a comma separated list of the field names you want to use as fast filters:
For an Inquiry Grid inside a Selector popup window, select the RowTemplate Editor for the Selector and look for the FastFilterFields in the collapsible GridProperties section. If required, expirement with the FilterByAllFields property.
My scenario involves fetching data from a table that returns multiple results to be displayed. My problem is that when I add the fields on the screen, the labels are all the same. I am pulling notes from 3 different screens onto one screen to display for the user. The notes are from a Sales Order, Customer, and Inventory Item. The data is being pulled correctly for each screen, but the label for each text box is "NoteText." I would like to change these labels to more accurately reflect which screen the note is from.
Thanks.
If I'm understanding your question correctly, you'll want to use a Cache Attached event handler for the fields in question. CacheAttached event handlers allow you to change the attributes of a field within the graph.
[PXUIField(DisplayName = "SO Notes")]
protected void SOOrder_NoteText_CacheAttached(PXCache sender)
{}
This may be specific to my situation, but I found a solution. What I am doing is suppressing the generated titles and customizing RowSelecting() of the DAC to add my own titles within the NoteText based on the note's GraphType parameter. I have all other parameters to filter down to the three notes I would need to display for that specific page. I use the GraphType to insert the text in front of the note to generate my own label for it.
Scenario: I have a DAC called Table1. That DAC has a key field, and that key field has a selector with a condition. Let's say,
[PXSelector(typeof(Search<Table.keyField, Where<Table.fieldCheck, IsNull>>))]
So, on the page, the Selector works just fine; I get all keyFields from Table where fieldCheck is null. But, when I click the navigation buttons, they completely ignore the "fieldCheck is null" condition and loads those records anyways. How can I bind my navigation buttons to the conditions laid out in the selector?
Unless I am missing some other condition of your page, you should be able to use a filter object on your primaryview, or just limit your primary view by the same condition that you have in your Selector, you would then only retrieve the records desired.