Dependency Injection in Acumatica ERP

Recently I had a chance to work with Dependency Injection in Acumatica ERP. I want to share how it works and how one can use it. Let’s assume that we have a REST Service, which we want to inject into Sales Order Entry and work with it using Actions. First, we need to create interfaces that we will use for injecting the implementations into the Sales Order Entry. Now we can add the implementations of the interfaces : and The final step will be to register our implementations with Autofac, which is done by defining an Autofac Module and overriding the Load method: Now we can inject our types into… Read more

Playing with PXSelectorAttribute

Sometimes it’s necessary to add some columns to Selector to show different values , calculated based on complex formulas involving multiple tables. Usually these kind of tasks are requested by customers to show different quantities for item/warehouse selectors based on some simple or complex calculation rules. For example, you are implementing custom availability based on some item parameters and need to show the quantity by warehouse. Below I will describe one of the ways to implement this kind of field. Let’s assume that we need to show some Available Quantity for the Warehouse in the Warehouse Selector on the Sales Order Line. Below is the SiteID field definition from the… Read more

Show user-friendly description instead of a field value in the grid for a selector

In many cases it will be more usable to display a user-friendly description instead of a field value in the grid for a selector. To do that, firstly you should add DescriptionField for the corresponding selector definition in your DAC, and then either add SelectorMode to the selector definition, or add DisplayMode property to the aspx. For example, before adding DisplayMode property, my grids contains just field values: After I add DisplayMode=”Text”, a DescriptionField value is displayed instead of field value: The other supported values of the DisplayMode property are “Hint” (the column cell contains the value-description pair of the field) and “Value” (default value, the column cell contains the… Read more

Random Value cannot be null error on implementing EPApprovalAutomation.

It took me weeks to figure out what is happening on my screen when I implement the Standard approval automation on my customized screen. The Culprit: The NoteID field with [PXDBGuid()] which is the default attribute when you generate new dac via Customization Project. just change it to [PXNote] because NoteID is required in EPApprovalAutomation class for the reference of Document to Document relationship. Happy Coding!

Redirection to a Dashboard in Acumatica ERP

In this article I cover different ways to navigate to a dashboard in Acumatica ERP. Redirection from Generic Inquiry Let’s start with the simple example of navigation to a dashboard from a generic inquiry. For this example I use generic inquiry that just shows a list of customers. Our goal in this example is to add navigation from the generic inquiry to the Customer View dashboard for specific customer. To do that we need to edit the generic inquiry as following: Open the generic inquiry in edit mode and open Navigation tab. Click Plus button in Screens section. Select sitemap node corresponding to the destination dashboard. As the dashboard in… Read more

Switch between Old and New Processing result UI

Hi All, You know that starting from Acumatica 2019r1 there is a new processing result window that shows more information about record processed and pending. However you should know that it is possible to control this behavior via graph code. There is a virtual property at PXGraph -> IsProcessing which identifies if this page should display processing result in the new format. And you can override this property in a processing graph to not display the Processing dialog box on the processing page. If the value is false, the progress and the result of the processing are displayed on the page toolbar. By default, the value is true (the Processing… Read more

Maximize Selector Drop-Down with JavaScript

Hi Everyone, Some time ago I had a question – is it possible to automatically maximize (expand) selector window when we opens it. Out of my research I know now that there is no settings for that in the selector configurations but this is very possible with Javascript. And following another example of Javascript in Acumatica I want to share this example with you. First thing we need to do is to add a Javascript control to Acumatica grid where you are planning to expand selector. Than we just add the Javascript method that finds the selector panel from passed parameters and calls it’s method to expand Now we need… Read more

Implement PXTransactionScope

Sometimes, part of your coding requires you to revert any transactions that were processed in the middle of a transaction. Acumatica Framework has the function to cope with that. That is using the PXTransactionScope(); As mentioned also in the Blog before by Sergey Marenich (ctrl + click to follow link : https://asiablog.acumatica.com/2015/11/using-scopes-in-acumatica.html) PXTransactionScope– this scope will initialize new transaction, so you can wrap-up some changes into transaction, when system will revert all changes together on any exception. Do not forget to call commit for the transaction scope before dispose it. Sample code snippet below is one of the many ways you can implement the PXTransactionScope. You must call the method ts.Complete(); to… Read more

Rename Acumatica Instance

Hi All, Once in a while everyone need to rename Acumatica instance to the better name. In this article I want to share with you 2 ways how you can do that Using Wizard Acumatica Configuration Wizard has a nice function to rename any of the installed instances. Renaming includes the Instance name and Virtual Directory Name. To do so: Open Wizard Go to “Perform Application Maintenance” Choose instance you want to rename Click “Instance Info” Use “Rename” links next to “Instance Name” or “Virtual Directory Name” Don’t forget to Save and close the window using OK button. Sql Server Database should be renamed manually, but wizard can help to… Read more

Run report with Side Panel

Hi everyone, Since version 2018R2, Acumatica has released feature call Side Panel on generic inquiry screen. It is a great feature to enhance the usability. In case that you have missed it, you can also check released notes here and configuration here. With side panel now, you can help user work more effectively by avoiding to many navigation. In one screen, you can do a lot of things for instance: view details of record or linked object, review dashboard, report, etc … Today I would like to share about the configuration. It can help user who need to work with some report or printed form can access it easier. Let… Read more

Acuminator Outlining

Hello everyone!This is a third post in the series describing Acuminator. It will be dedicated to the feature called outlining. So, what does outlining mean? It’s an ability to collapse code parts unimportant to you at the moment in the code editor. I’m sure every .Net developer that uses Visual Studio or VS Code has seen this feature. You can collapse classes, methods and many other syntax structures. In C#, you can also add your own collapsible blocks with regions. Acuminator Outlining Now you may ask: “How is this feature related to Acumatica?” There are many really big BQL queries in Acumatica code. Some of them do not even fit… Read more

Where Acumatica name came from?

Hi All, Just a short interesting question “Why Acumatica is named Acumatica”? Actually it is combination of words Accounting (accou-) and Automatics (-matic). So we get “Accu-matic-a” 🙂 Last “A” is just for good sound. Also if you ever found wandering why PXGraph is named as Graph, than there is a reason – it is related to data structure inside. Using DataViews you define relation between database tables. These relations looks like a graph-structure as has a lot of direct and indirect references back and forth. So that is the reason.

Field Event Sequence

Hi All, As you may know from, Acumatica events are triggered in the specific sequence. But there is sequence not only for event types, events for different row and field will be triggered within a specific sequence too. Rows With rows it is a bit easy:Insert/Update happens in the sequence how it was triggered. If you update a value it will trigger an event sequence for specific cache that was updated. In case event updates other caches, that they will be triggered also as soon as cache.Update/Insert/Delete is called.Save/Delete happens for primary cache first as it is associated with the button, than it will call PXParent Attributes in the sequence… Read more

Page Refresh and Redirection

Hi All, As you know Acumatica page submits all data to the server though different callbacks. This is good for network performance, but brings some limitations – like redirection. Unfortunately it is not possible to use Response.Redirect() during the callbacks as browser script does not expect it and can’t properly react. To solve some of these issues Acumatica uses different exceptions (like PXRedirectRequiredException, PXReportRequiredException and so on). These Exceptions will be handled by base code (Callback Manager) and translated to text commands that will be handled in JavaScript. For instance, PXRedirectRequiredException(WindowMode.New, SuppressFramceset = false) will be translated to eRedirect3:+<SomeURL>. You can read more about this mechanism here. This code is… Read more

Flags in PXGraph

Hi All, A short but useful article today – PXGraph is a center of the whole business logic in Acumatica framework and can be triggered from different places: UI, Web Services API, Mobile, Import and so on. As a developer you sometimes need to know what is the context of the request you are processing right now, so you can adjust the business logic. For this purpose PXGraph has a set of flags that are automatically triggered during different operations. Here they are: graph.IsImport – flag will be automatically set when Import/Export engine is working. This will be true for Import/Export scenarios, Web Services, Copy/Paste action, Mobile. So almost all… Read more

Success Story in Acumatica

Original Post is located here: https://www.facebook.com/acumaticarussia/posts/323585055218750 If you ask me about my 12 years story in Acumatica, I would say it was the story of luck multiplied by hard work. Part 1: Moscow: Hiring It was all started right after bachelor’s degree at my university. I started to search for a job and a friend of mine recommended a company with name SW Soft. I went there on interview where Mike and Andrew gave me two tasks (we still give it to all new candidates). Later these guys became great mentors for me. One of the tasks I have completed only from the second attempt. I still remember my fillings… Read more

Calculating Grid Totals on an Inquiry Form

One of the common requirements that one may have for the inquiry form is to have Totals calculated for some column in the grid. It may seem a simple task, but there are some unexpected obstacles that make it hard to implement the feature properly. Straightforward Solution We can implement the requirement with the help of a filter delegate. Assume that we have the filter view and the grid view. Add a field for accumulated result to the filter DAC. In the filter delegate get records from the grid view. For example: This code works, but it has several issues: It does not consider user defined filter for the grid Filter… Read more

Configuration Lot/Serial with Custom Date Format

Hi all, In Acumatica, we have ability to configure for the auto incremental number Lot/Serial in the stock item. Today I would share about using the configuration with Custom Date Format. Firstly, you need to make sure that the Lot/Track Serial need to be enable in Feature. Secondly, you need to create the configuration by navigate to the screen Lot Serial Classes. As you already know in this screen, we will defined how we can track our Lot/Serial. Now try the configuration as image bellow: Thirdly, navigate your browser to stock item screen. In this scree, we will mapping the configuration to specified stock item. Finally, you have finish the… Read more

Acuminator Coloring

Good day, everyone!This is a second post in the series dedicated to the Acuminator. Today I would like to tell you more about the Acuminator syntax coloring. Feature Overview Syntax coloring is one of the most common and useful features given to programmers by development tools. It uses a simple idea – to emphasize some text in program by coloring it in different colors. This allows quickly and clearly show to a reader keywords, variable declarations and many other useful things. Our attention is drawn to words with a different color and this is used to show us the important parts of the code. The color itself also gives some… Read more