Skip to main content
Solved

How do I access the extension of the ARTran table to access a custom field in that table?

  • 29 March 2023
  • 2 replies
  • 102 views

Hi,

I have added a custom field to the ARTran table but I am getting an error when trying to access the extension of this table to update this custom field via code.

I imagine I need to replace ‘ARTran’ with something else, but not sure what it would be.

Here is the code I am currently using to access this extension:

var row = (ARTran)e.Row;
ARTran rowExt = row.GetExtension<ARTran>();

And here is the error I get:

\App_Code\Caches\ARInvoiceEntry.cs(55): error CS0311: The type 'PX.Objects.AR.ARTran' cannot be used as type parameter 'TExtension' in the generic type or method 'PXCacheEx.GetExtension<TExtension>(IBqlTable)'. There is no implicit reference conversion from 'PX.Objects.AR.ARTran' to 'PX.Data.PXCacheExtension'.

What do you suggest I replace ARTran with to access the custom field via the extension?

 

Kind regards,

Andrew

var row = (ARTran)e.Row;
ARTranExt rowExt = row.GetExtension<ARTranExt>();

Hi Reza,

Thanks so much for that, completely forgot about adding that ‘Ext’ bit on the end, I’ll make sure to remember that for next time.

Kind regards,

Andrew


Reply