Inventory attribute values DAC - acumatica

What table(s)/DAC(s) are used to hold the attribute values on the Stock Items screen/Attributes tab? I need to access them in a GI and I can't figure out how.

The Attributes are stored in CSAnswers. The refNoteID in CSAnswers maps to the NoteID in InventoryItem. Each attribute is listed by the AttributeID, so to join specific attribute(s) you'll need to specify the AttributeID also.

Related

What is the difference, PXSelector vs PXDBScalar

I'm trying to figure out when to use PXDBScalar. Do you guys know the difference between PXSelector and PXDBScalar and when to use which one?
In short PXDBScalar is normally used for unbound DAC fields (not stored in the table). For example if you wanted to have a Vendor name handy within a DAC fetch you could configure a DAC field with the vendor name without having to actually store it in the table. Also this works well with GI's.
PXSelector is an attribute for a DAC field that will allow the GUI to perform a look up of 'possible values' as related to the field.
The below explanations are from help.acumatica.com.
PXDBScalar:
Defines the SQL sub request that will be used to retrieve the value for the DAC field.
You should place the attribute on the field that is not bound to any particular database column.
The attribute will translate the provided BQL Search command into the SQL sub request and insert it into the select statement that retrieves data records of this DAC. In the BQL command, you can reference any bound field of any DAC.
Note that you should also annotate the field with an attribute that indicates an unbound field of a particular data type. Otherwise, the field may be displayed incorrectly in the user interface.
You should not use fields marked with the PXDBScalar attribute in BQL parameters (Current, Optional, and Required).
PXSelector:
Configures the lookup control for a DAC field that references a data record from a particular table by holding its key field.

Can PXFormula aggregate non-bound fields

I have a header and detail user field of type decimal. Both are not bound to the Db. The value of detail user field is set during RowSelected event. My goal is to accumulate the user field values in the details cache, and assign the value to the header field. Both user fields are defined in cache extensions.
I see PXFormula defines RowSelecting event handler to calculate values for unbound DAC fields. So I define the PXParent & the PXFormula in the child DAC. T200 recommends to add the PXParent in the first FK field. But I defined a cache extension, so a different user field is used.
Unfortunately the header field still displays zero, even though detail field has values. Is this not possible when using non-bound user fields?
Chris, PXFormula (same applies to PXUnboundFormula) has never supported aggregates for unbound header fields. You can still use PXFormula to handle changes the user makes in UI, but this will still require use of a RowSelecting handler from your side to calculate aggregated unbound header fields when record is retrieved from DB.

Make default primary required field into a lookup

When creating a new entity, a new form is automatically created for you where it automatically is given 2 fields, name and owner. For the name field, it is possible to make that into a lookup?
No, the primary field can only be of the type Single Line of Text.
When creating a new entity, you cannot select other types:
This does not stop you from changing the requirement level of the primary field to None and creating your lookup field.

How to add duplicate record in relation entity coredata

I have two entity
Box
Items
I want to add multiple items on same box object but when i try to add multiple(duplicate) items on same box object then its store unique object record.
Kindly help me to solve that issue.
A Core Data relationship is a set, not an array. One of the defining characteristics of a set is that it doesn't contain duplicate entries. So, you can't have the same object appear twice in the same relationship. It's hard to tell what that would even mean... A Box is related to an Item twice?
If you're trying to do this to indicate quantity (i.e. two of the same Item in a Box) you'll need a third entity type that stores the quantity and has a relationship to the Item. Probably something like
Box <---->> BoxItem <<----> ItemType
Here the ItemType replaces your Item, and BoxItem stores the quantity and relates to one Box and one ItemType. Any time you add one ItemType to a Box you create a BoxItem with a quantity of one. If you add another of the same type, increase the quantity.

How to sort items in view by field of lookup entity?

Is there any way to enable sorting on column which represents field of related entity?
For example, Case contains one lookup field - Contact. In view I added FullName and Email of Contact. Header in view of these two columns is not clickable (Sort is not enabled).
No. Sorting is not possible for fields of a referenced entity.
If you really need this, you have to build a custom view (html page) or for example a report

Resources