nickivey
nickivey

Reputation: 193

Acumatica Can't access Extension DAC from BLC

Im trying to assign variables to my graph from InventoryItem and InventoryItemExt.

Code enter image description here (First Column is a InventoryItem Selector) enter image description here

I've also tried using another PXSelectorAttribute, doing so I received an attribute error on runtime

InventoryItemExt item2 = PXSelectorAttribute.Select<atcProjectLinesTable.itemNumber>(cache,line) as InventoryItemExt;

Upvotes: 0

Views: 631

Answers (1)

RuslanDev
RuslanDev

Reputation: 6778

Your FieldUpdated handler was declared for the atcProjectLinesTable DAC - cache parameter represents PXCache instance created for the atcProjectLinesTable DAC, not InventoryItem. I would assume the issue to happen when the system invokes cache.GetExtension<InventoryItemExt>(item).

Try replacing the following line

InventoryItemExt item2 = cache.GetExtension<InventoryItemExt>(item);

with

InventoryItemExt item2 = item.GetExtension<InventoryItemExt>();

Upvotes: 2

Related Questions