Solved

ViewBag in Acumatica

  • 13 July 2021
  • 5 replies
  • 50 views

Userlevel 2

Hello,

 

Can we use the viewBag in Acumatica?

or pass a value for example from Graph CAEntry to CAReleaseProcess 

 

Thanks.

icon

Best answer by Gabriel Michaud 13 July 2021, 16:55

View original

5 replies

Userlevel 7
Badge +17

Hi @SadokHanini We have used sessions long back, please find the code below.. that may help you.

 

Store the value in session:

PXContext.Session.SetString( TOKENConstant , tokenIDvalue);

Read the value from Session:

string tokenID = PXContext.Session[TOKENConstant].ToString();

 

Userlevel 7
Badge +10

@Naveen B I personally think using session state is almost always the wrong solution -- take a look at the business logic in PX.Objects.dll; this is never used except for very very specific cases.

Userlevel 7
Badge +10

I have no doubt you know what you are doing @Naveen B, and payment processing is one of the scenarios where I see it used in PX.Objects 😉

The reason I mentioned it is because there are new users on this forum and they often try to replicate the same patterns they used in other systems without first getting a good understanding of how to do things the “Acumatica way”. This always comes back to bite you later and you discover issues that require major redesigning

Userlevel 7
Badge +10

Hi Sadok,

Can you tell us more about the requirement and process? There are different ways to pass state between graphs, but using a ViewBag is not possible.

Userlevel 7
Badge +17

Yes @Gabriel Michaud  We have used this session concept long back for specific reason in payment gateways, and currently we are NOT using it.

Since Sadok is looking for the Sessions, I just shared here.

Reply


About Acumatica ERP system
Acumatica Cloud ERP provides the best business management solution for transforming your company to thrive in the new digital economy. Built on a future-proof platform with open architecture for rapid integrations, scalability, and ease of use, Acumatica delivers unparalleled value to small and midmarket organizations. Connected Business. Delivered.
© 2008 — 2024  Acumatica, Inc. All rights reserved