What is the difference, PXSelector vs PXDBScalar - acumatica

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.

Related

Is their a way to set value for all existing records using Acumatica code without modifying the screen

User requirement is to create duplicate customer field in Invoice screen and that custom field is using for some historical data, But by default we are passing current Invoice customer value and later we are allowing user to change the custom field.
so in this case is there a way to set the value for existing records through code with out refreshing/modifying the existing record.
I have tried by using field level PXDefault attribute but that will not work in my case so their any events or some code to update custom field value for existing fields.
Thanks in advance.
I believe PXDefault would only execute when a new Row is being inserted. Perhaps one option could be to explicitly call cache.SetDefaultExt(e.Row) if value is null, but I am not sure whether it is 'legal' to do it on a row Selected
One other possibility is to use Generic Inquiry Mass Update (https://asiablog.acumatica.com/2016/09/mass-processing-using-gi.html). This way to could perhaps update past records in bulk. But be careful of Acumatica Transaction License limits.

Netsuite. Saved Search, how to join another table

I'm trying to make Saved Search which has Transaction fields that I want to join any other type's fields.
When I make Criteria, Result in Saved Search, I realized there is limitation to bring certain field.
I know the Type & Internal ID, so I used formula(numeric) and insert custom_item.realamount(This is actually what I want to know). But this wasn't show a value.
How can I make these two types to join each other?
There is no field in Netsuite called custom_item If you are trying to join a custom item field on a transaction search formula field then you'd be looking at a join like
{item.custitem_uniquepart_}
Where _uniquepart_ is either an integer if the custom field was created without a custom id value or it's the value entered for the id field of the custom field.

Inventory attribute values DAC

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.

NoteID in lotus notes view defaluts to NT00000000

I have a form with a computed when composed field containing #NoteID in it.
I then want to display that field in a view which is being exported to Oracle ( the NoteID is acting as a key)
The problem is sometimes during document creation the field stores the NoteID value but the view displays NT00000000
Any idea the cause, and how can I refresh the documents with the issue?
You can't get the real note id of a document until after the document is saved, so #NoteID in a field won't produce a useful result until after saving.
I suggest not using a field at all, and instead having the view column formula as #NoteID.
Also: Don't rely on note id if you have replicas of the database.
The same document in a different replica can have a different note id.
If you need an id represented as a string that remains the same across all replicas, use the formula #Text(#DocumentUniqueID).

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.

Resources