How to use extended table fields in where condition? - acumatica

I have extended INItemLotSerial table by creating a new table InfoINItemLotSerialExtNV. The Table is left joined on InventoryID & LotSerialNbr.
I am trying to use the Extended table fields in the where condition. The fields are not show up in the INItemLotSerial. Do I have to link again the table using join or Just use the InfoINItemLotSerialExtNV in where condition?

Assuming you extended INItemLotSerial DAC by declaring InfoINItemLotSerialExtNV like that:
class InfoINItemLotSerialExtNV : PXCacheExtension<INItemLotSerial>
The custom fields contained in InfoINItemLotSerialExtNV should be accessible whenever INItemLotSerial is accessible. Extension DAC fields are loaded by the framework when the base DAC is loaded.
Your query should look like:
PXSelect<INItemLotSerial, Where<InfoINItemLotSerialExtNV.customField, Equal< ... >>

In BQL expressions, you have to refer to the custom field by its BQL name in the extension class. For an example please refer to Acumatica Customization Guide. The practice shown in documentation can be applied both to the regular DAC extension and the DAC extension mapped to an extension table.

Related

SumCalc attribute not working when trying to summarize usr Field from PMTask to PMProject

First, created a custom field in the PM.PMTask DAC called usrNumberofPanel
Second, created a custom field in the PM.PMProject DAC usrTotalPanels.
Want each of the lines from task to update the total number of panels on the project, so modified the attribute for PM.PMTask.userNumberofPanel and added a PXFormula as shown below to add the SumCalc.
[PXDBDecimal]
[PXUIField(DisplayName="Number of Panels")]
[PXFormula(null, typeof(SumCalc<PX.Objects.CT.ContractExt.usrTotalPanels>))]
Made sure the attributes for the Total Panel and set as follows to make sure no one types into the field.
[PXDBDecimal]
[PXUIField(DisplayName="Total Panels", Enabled = false)]
Any thoughts would be appreciated.
It's a known issue that SumCalc doesn't work properly across DACs that are linked with PXParent relationships.
I can only recommend to use a RowSelected or FieldSelecting graph event handlers to compute the sum instead of a solution involving DAC attributes. You can add a comment explaining the limitation of DAC attributes in the event handler if you are seeking Acumatica ISV Certification for your solution.

Is it possible to create my own custom KvExt table to fully implement and manage User Defined Fields for my custom table and page?

I have a custom table in SQL Server called AnimalBreed and maintenance page.
I wish to add User Defined Field support via the KvExt approach instead of
traditional practices involving either CSAnswers or a CacheExtension of the
DAC and underlying "Usr" fields.
Is this possible?
Can it be done for line-level (child) DACs, such as
existing INLocation and INLocationKvExt?
Thanks!
UPDATE:
It appears the feature needs at least:
ensure your table has the NoteID column as uniqueidentifier datatype and the DAC has the corresponding field: Guid? NoteID and [PXNote()] attribute.
In the ASPX, if not ListView, add the following to the PXDataSource tag:
EnableAttributes="true"
By making these changes, I can Manage User Defined Fields, choose Attributes to include, and I can store values to the KvExt table.
I am using Version = 19.205.0023
Sales Order page observation: if I add two UDFs on SO Order Entry page, one is combobox and one is checkbox, setting their values saves just fine, but then updating the combobox and save leads to loss of the checkbox (from true to false), unless you uncheck and recheck prior to the save. Is this a bug?
Maybe technically possible but definitely not recommended to use undocumented feature like KvExt.
If you need to deploy User Defined Fields on a page which already contains them. Configure them manually and then add them in a customization package in the user defined fields section for deployment as described here:
https://help-2019r2.acumatica.com/Help?ScreenId=ShowWiki&pageid=e01f29d3-b6b1-40f4-a2d1-45c9d01bdde3
Example:

Graph CacheAttached method

I want to make the SOLine Qty field to 1.0 by default, so I have changed at DAC level, by doing this it will be applied to the entire application?
Next, I can do same by writing Graph CacheAttached method also, I think this will apply only to that particular graph and if the same field is used in another graph or a custom new screen this will not affect in that graph.
Please suggest.
You are correct, adding an attribute to SOLine DAC extension will apply this attribute system wide. To limit its scope to a graph, use a CacheAttached.
Here are good reads on this subject :
DAC : https://help.acumatica.com/(W(12))/Wiki/ShowWiki.aspx?pageid=b3d24079-bda4-4f82-9fbd-c444a8bcb733
Append and replace of dacs attributes : http://asiablog.acumatica.com/2017/01/append-and-replace-of-dacs-attributes.html
These concepts are well explained in the T200 certification, which I suggest you do if you haven't already.

Acumatica Pass custom field vales into Cash Transaction detail table

I have added two custom fields in the Screens: Payment and Application(AR302000), Cash Transactions(CA304000), Funds Transfers(301000) and Back Deposits(305000), and I pretend to add those fields also in the Table CATran
I have a Generic Inquiry that mimic the Report Cash Account Detail (CA633500) where I can see that the Field ExtReference and Description are copied from the Original Ducument (AR302000,CA304000,etc) to the CATran records.
If I would like to pass the value of my custom field to the CATran Table, to get the same behavior that the External Reference and Description does.
Does anybody know what is the action'name to override the Insertion of CATran Detail?
Form AR302000 uses following class: PX.Objects.AP.APPaymentEntry. It means that you should create extension for this class in way similar to this:
public class APPaymentEntryExt : PXGraphExtension<APPaymentEntryExt>
{
}
Then you can use extending with help of CATran_RowInserting for initial values configuration and CATran_RowInserted for modification of inserted values

How to select nonextended columns?

I have the following code in my BLC:
PXResultset<ARInvoice> previous = PXSelect<ARInvoice,
Where<ARInvoice.projectID, Equal<Required<Contract.contractID>>,
And<ARInvoice.createdDateTime, Less<Required<ARInvoice.createdDateTime>>,
And<ARInvoice.customerID, Equal<Required<Contract.customerID>>>>>, OrderBy<Desc<ARInvoice.createdDateTime>>>.Select(this, contract.ContractID, invoice.CreatedDateTime, contract.CustomerID);
I have extended it to have additional column: "isInterestPenalty".
I would like to query it such that it only selects all non-interestPenalty.
Something like:
...And<ARInvoice.isInterestPenalty<Equal<Argument<bool>>>>>
.Select(..., false)
I don't know how or can't seem to find in Acumatica T300 or how to search it in Acumatica API framework.
In BQL expressions, you have to refer to the custom field by its BQL name in the extension class.
In you case BQL query should be composed as follows:
… And< ARInvoiceTableExtension.isInterestPenalty<Equal<Argument<bool>>>>>
.Select(…, false)
For more information on how to access extension objects from code, please refer to Help -> Customization:

Resources