Skip to main content
Answer

Getting Invalid Object Name when trying to press removeFromHold in Generic Graph Extension

  • July 5, 2022
  • 4 replies
  • 274 views

aaghaei
Captain II
Forum|alt.badge.img+10

I am trying to press RemoveFromHold button on APInvoiceEntry from a Generic Graph Extension but I’m receiving the below error. Can someone help please? The error is “System.Data.SqlClient.SqlException: 'Invalid object name 'PXMappedCacheExtension'.'” For the sake of claification, when I press this button from inside the APInvoiceEntry Extension it works. But since this is repeating for 7 screens, I’m converting some of the logics of these extensions to GGE to prevent from repeating.

 

 

Best answer by aaghaei

Hi ​​​@Chris Hackett I couldn’t make Acumatica’s GGE method work so Instead, I used c# built-in “dynamic” declaration of objects I am going to perform actions on them and it works. It basically follows the same logic but doesn’t rely on Acumatica’s function library. ie 

public static IEnumerable UnholdProcessor(PXAdapter Adapter, PXGraph Graph, dynamic Document, dynamic DocumentExt)
{
dynamic Base = Graph;
// Do stuff
Base.Actions[RemoveFromHold].Press();
// Do stuff
Base.Document.Update(Document);
Base.Save.Press();

return Adapter.Get();
}

then I call this method in any graph extension “RemoveFromHold” action that I want.

4 replies

Shawn Burt
Jr Varsity I
Forum|alt.badge.img+1
  • Jr Varsity I
  • July 5, 2022

The error seems to indicate a bad table name. Do you have an unbound DAC, if it is not properly annotated that might cause this.


aaghaei
Captain II
Forum|alt.badge.img+10
  • Author
  • Captain II
  • July 5, 2022

@Shawn Burt it is not the case. What causes the problem is GGE mapping and I’m unsure how I can fix it. If I copy the code into an extension to APInvoiceEntry, It works flawless.


Chris Hackett
Community Manager
Forum|alt.badge.img
  • Acumatica Community Manager
  • October 27, 2022

Hi @aaghaei - were you ever able to find a solution to your issue? Thank you!


aaghaei
Captain II
Forum|alt.badge.img+10
  • Author
  • Captain II
  • Answer
  • October 28, 2022

Hi ​​​@Chris Hackett I couldn’t make Acumatica’s GGE method work so Instead, I used c# built-in “dynamic” declaration of objects I am going to perform actions on them and it works. It basically follows the same logic but doesn’t rely on Acumatica’s function library. ie 

public static IEnumerable UnholdProcessor(PXAdapter Adapter, PXGraph Graph, dynamic Document, dynamic DocumentExt)
{
dynamic Base = Graph;
// Do stuff
Base.Actions[RemoveFromHold].Press();
// Do stuff
Base.Document.Update(Document);
Base.Save.Press();

return Adapter.Get();
}

then I call this method in any graph extension “RemoveFromHold” action that I want.