Tuesday, 27 June 2017

Redirect On Page Load

Hi There,

You know that you can embed custom pages right inside Acumatica. Best examples here are YouTube, Binq, Stack Exchange, Currency Rates or something else
custom pages acumatica

But what if you need something like this, but dynamic - have a special URL depend on user, screen or other environment variables. In that case you cannot just hard-code URL in sitemap, as it will be always the same.

Here we need to be able to redirect user to special URL form code.
And I can suggest you 2 possible options to do that:

When page is shown and graph is loaded, you can throw a redirect exception that will be handled by base code and user will be redirected.
Note that using WindowMode you can control should new URL be opened in new or same window.
However, here we have a small problem, empty screen will be shown for a second before redirect takes places. Somethings it might be not acceptable.

Redirect on PageLoad
Another way is to have a dummy page and register it in the sitemap. You can create dummy page with Customization Brower tools. Paige can be empty and does not require any business logic there.
As soon as page is loaded we can do a redirect.

In that approach you cannot use PXRedirectException, as there is no base code that can handle that, but we can use other ways to do redirect. And it should be different depend on requiest type: is current call Callback or GET/POST.
  • In case of callback we can provide special redirect instruction to response - eRedirect0 - that will be handled by Acumatica JavaScript on page
    • Number in redirect keyword means special configuration of redirect, for example redirects 0,1,5,6 will be in the same window; 3,4 in new tab; 7,8 in new window; Other numbers can suppress frame-set of keep session.
  • In case of GET/Post we can use JavaScript that will open a separate page
Here I have an example on how to do redirect to dynamic URL from PageLoad:
protected void Page_Load(object sender, EventArgs e)
       System.Web.HttpContext context = System.Web.HttpContext.Current;
       String url = "http://acumatica.com";

       Boolean iscallback = context.Request.Form["__CALLBACKID"] != null;
       Boolean isget = String.Equals(context.Request.HttpMethod, "GET",
       Boolean ispost = String.Equals(context.Request.HttpMethod, "POST",

       if (iscallback)
              context.Response.Write("eRedirect0:" + url);
       else if (isget || ispost)
                     String.Format("window.open(\"{0}\",\"{1}\");", url, "main"));


If you add that code to your page code-behind, you will be able to see Acumatica page right when you click on the sitemap node.
custom pages acumatica

Have a nice integration!

Wednesday, 21 June 2017

Acumatica Cloud xRP Summit

Hi All,

acumatica cloud erp

Join us for our inaugural interactive & engaging Virtual Developer Conference, where we have lined up some great speakers & content that will help you, the developer – whether you’re a seasoned veteran or new to the platform. Learn a new tip or trick in the advanced framework session or learn about new features in our roadmap session.


And I am one of panelists!
Join us and we will have great fun there!

Monday, 19 June 2017

Maintain Table Schema within Customization Project

Hi There,

Today I want to stop your attention on how Acumatica handles updates for custom tables/columns.
Acumatica handles updates
In Case you doing medium to complex customization to Acumatica, you most probably will have a lot of custom columns.
You know you can add all these custom columns to the standard tables in Acumatica, but in this case you several issues

  • Each new column has to have an Usr prefix to each column. That is required to split standard and custom columns in one table
  • You columns depend on Acumatica table. In case Acumatica have any changes in the tables, you columns may also be affected. But do not worry, they are never be deleted.

So in case of multiple custom columns it might be good idea to split them in custom table. Using Acumatica framework you easily can create as many custom tables as you wish.
Also even if you need to link new columns to original records, you always can use Extension Tables, that actually give you ability to have benefits of custom columns and new table.

Ok, now we have a new table, but how to support it in case we need to add a new column there?

Tuesday, 6 June 2017

Validating AP/AR Accounts Balances before Releasing Imported Invoices

Hi There,

If you ever was involved in any implementation project and data migration process you have seen how complicated is to validate data after migration.
It is especially important if you have documents that have to be released - if you release wrong document than there is now way to change document anymore and you have to reverse and create it again, that basically litteres documents history.
documents history acumatica

Ok, we can see the problem, but is there any way to validate balances before releasing of the documents to minimize number of errors?

When I have faced that problem, I have tried to find a solution and basically have found it with Generic Inquiries and Pivot tables.

So I have followed that scenario:
  1. Import all AP/AR Invoice to Acumatica on Hold
  2. Created 2 Generic Inquiries that get AP and AR invoices with following fields: Type, Ref Number, Branch, AP/AR accounts, Amount in Base Currency, Customer/Vendor, Class and Date
  3. Than I have create a Pivot Table based on that GI where I have accounts as columns and document types as rows
Pivot Table based onGI
Total on that report give me total amount that would be recorded on AP/AR account after releasing.
Basically using that report I can reconcile AP/AR accounts with Trial balance even before releasing of them. 

Thursday, 1 June 2017

Recurring Notifications about Expiring Quotes

Hi There,

Any ERP system is designed to help users as much as it is possible. And one of very common human bug is bad memory. So ERP should solve this issues by recurring notification on multiple possible documents/items.
acumatica erp
Just as for example, how cool is to have notification on expiring contract, quote or cases, so we can take an action in advance.

Based on the previous article on notification from templates that I have shared with you few days before, we can design an processing screen that will send notifications for us.

So the main idea around it is - every day Acumatica scheduler will trigger our logic, that will get all Sales Quotes that will expire in some days form now and send notifications to them.
notifications acumatica