How to show a custom filed in another page in different BLC? - acumatica

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:

Related

How to add the OrderNbr hyperlink in SOLine

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.

SOOrder Entry Screen not working

My SOOrder entry screen grid is automatically taking me to the SOOrder page with a new order instead of showing the grid anytime I attempt to navigate to SOOrders.
When I edit the Generic Inquiry, it shows an error next to the Entry Page selector that has SOOrder selected:
It also does not allow me to select any fields on the Navigation tab -> Field selector to associate with a parameter for the navigation.
Is there any way to fix this?

Subaccount selector for user field

I have added a user field to the Non-Stock Items screen that I want to hold a subaccount selection selected via a selector that works the same way as the other standard subaccount fields on that screen. When looking at source DAC for the other SubAccount fields, there is an attribute for [SubAccount...] that works in a way that I don't really understand. I also have an Account user field that uses a standard PXSelector lookup to the Account table (that works properly).
I've added a modified version of the attribute I found on the other SubAccount fields as follows:
[SubAccount(typeof(InventoryItemExt.usrCOGSAccount), DisplayName = "COGS Subaccount", Visibility = PXUIVisibility.Visible, DescriptionField = typeof(Sub.description))]
Where InventoryItemExt.usrCOGSAccount is my user field which holds the Account ID from the lookup on that user field.
However, when I use this, I get an error on rendering the screen (index outside the bounds of the array).
Bottom line: Is there a way I can make this Subaccount user field have a lookup just like the other Subaccount fields, with the F3 on each segment working independently?

How to add a foreign key reference to the primary key selector control

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.

acumatica fastfilter (inventory item search within sales order entry grid)

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.

Resources