Monday, 5 December 2016

Custom Formula for ACH/GIRO Providers

Hi All,

In the previous article about custom payment providers i have mentioned that Schema file supports several build-in formulas, like:
  • Count - Count of details or nested groups in group
  • TotalCount -  Total lines in all nested groups
  • BlockCount - Count of internal blocks including adjustments for fixed structure
  • CountOneBased -  CountField  + 1. Required if you need calculate header or footer with details
  • TotalCountOneBased - TotalCountField +1. Required if you need calculate header or footer with details
You also can add more formulas there. For example if you want to have Count that will calculate header and footer together with details you may need TotalCountTwoBased formula.

Please check this code snippet for more details:

Have a nice development! 

Thursday, 1 December 2016

Client Events using JavaScript

Hi All,

Today I want to share with you one way how you can add some client validations/calculation using JavaScript right in the browser with no accessing server data.
In general i would suggest you to not do any complex calculations on client side and always use server for all data manipulations. However in some specific situations this approach may save a lot of processing time because client events may do calculations right in the browser.
Also note that client logic will be available only for browser users and will not be triggered from web services API and Mobile application.

The scenario that i want to do is quite simple - trigger the code after the value changes in some controls and validate/calculate its value. This example is designed for demonstrating purpose only so I would like just to show a notification box with new value when someone change GL Batch description.
As a much better example of client events may be a playing of sound on button/control click. Really good explanation and example example is provided on Stack Overflow.

Customization
To add required validation lets complete following steps:

Monday, 28 November 2016

PXUIEnabled and PXUIRequired Attributes

Hi All,

If you developing something on Acumatica xRP platform you know that changing of the UI fields visibility should be done through PXUIFieldAttribute on the RowSelected event.

This works perfect on small screens with limited number of controls. But most of ERP screens are not really small. So most probably you already saw such types of code on the RowSelected in SOOrderEntry graph and many others.

Not nice and really hard to support.
Luckily now we have a different way to do it:

  • PXUIEnabled - based on provided BQL conditions can automatically change UIFieldAttribute Enabled property.
  • PXUIRequired - based on provided BQL condition can automatically change PXDefaultAttribute PersistingCheck property.
  • PXUIVerify - based on provided BQL condition can automatically change validate that new value meets provided conditions. Also can trigger validation on update of dependent fields,

Usage of PXUIEnabled:

#region isActive
public abstract class isActive : PX.Data.IBqlField
{
}
[PXDBBool]
[PXDefault(true)]
[PXUIEnabled(typeof(Where<isFinancial, NotEqual<True>>))]
[PXUIField(DisplayName = "Active", Visibility = PXUIVisibility.SelectorVisible)]
public virtual Boolean? IsActive { get; set; }
#endregion


Usage of PXUIVerify:
#region TimeBillable
public abstract class timeBillable : IBqlField { }
[PXDBInt]
[PXTimeList]
[PXDefault(0, PersistingCheck = PXPersistingCheck.Nothing)]
[PXFormula(typeof(
       Switch<Case<Where<isBillable, Equal<True>>, timeSpent,
              Case<Where<isBillable, Equal<False>>, int0>>,
              timeBillable>))]
[PXUIField(DisplayName = "Billable Time", FieldClass = "BILLABLE")]
[PXUIVerify(typeof(Where<timeSpent, IsNull,
       Or<timeBillable, IsNull,
              Or<timeSpent, GreaterEqual<timeBillable>>>>),
PXErrorLevel.Error, Messages.BillableTimeCannotBeGreaterThanTimeSpent)]
[PXUIVerify(typeof(Where<isBillable, NotEqual<True>,
       Or<timeBillable, NotEqual<int0>>>),
PXErrorLevel.Error, Messages.BillableTimeMustBeOtherThanZero,
       CheckOnInserted = false, CheckOnVerify = false)]
public virtual int? TimeBillable { get; set; }

#endregion

Have a nice development!

Wednesday, 23 November 2016

Getting started with Acumatica xRP Platform

Hi All,

Sometimes I get a questions like this:
  • How to start development with Acumatica xRP platform? 
  • How complex is it? 
  • Where we can get some guidance?
So here I want to summarize all thoughts that I have about it.

I would select these steps that i would recommend you to do:
  1. Ensure Pre-Requisites
  2. Get Acumatica 
  3. Prepare Development Environment
  4. Learn Acumatica xRP Platform
  5. Do Development
  6. Communicate & Support
Lets go though each of these steps in details under the cut.

Monday, 21 November 2016

100 articles on the Blog!

Hi All!

Today we have a small anniversary - 100 articles:


Thank you for constant support and attention! I really hope that this information useful for you and will do my best to provide you more interesting articles in the future.

Meanwhile, your opinion is very important for me, and I would be really happy to hear your feedback, requests and topic suggestions that may help you to know Acumatica better.

Have a nice day ahead! Thank you.

Monday, 14 November 2016

Acumatica Test Companies

Hi All,

As you may know Acumatica does not limit the number of users that can connect to the system but it limits the number of cores that may be used by the system and number of tenants (companies) that can be created and used in the database.
However these roles applies only for properly licensed instance. If you are using Acumatica in the trial mode (read more there), you have a limitation on 2 concurrently working users and maximum 10 tenants.

Here I want to discuss with you some points number allowed tenants.
When you apply license to Acumatica instance, you limit number of production tenants to allowed by the license. Usually it can be something like 3, 10, 20, ..., 50, .....
If you add more companies than is allowed, Acumatica will automatically restrict list of visible companies to maximum allowed number.
All other companies will be still safe in the database but you cannot access it.

But what to do if you want to have any additional tenant to test something or do an experiment, but install a demo data. Luckily this is possible with Test Companies feature.

The "Test company" is an additional tenant in the databases that is not included in the list of companies allowed by license. But in the same time Acumatica applies on the test company the same restrictions as on the trial mode:

  • can be used even if you have maximum number of production tenants
  • no limitations on number of test companies
  • for all test companies in the system you cannot have more than 2 concurrently working users.
  • any production company can be flagged as test at any time
  • if you make a company as test, it cannot be reverted.
  • all demo companies will be used as test.
If you want to make you company as test, it is very easy - just click appropriate button on manage companies screen.
As this operation is not revertible, you should confirm your operation:
Please confirm that you want to make 'Company8 (9)' a test company. Test companies are intended for training and demonstrating Acumatica, and are not for intended for production use. This operation cannot be reverted.

Now you can see that your company is marked as test:


Have a nice testing!

Wednesday, 9 November 2016

Keeping Session between API calls

Hi All,

If you using Acumatica Web Services you most probably saw the examples where you need to call Login and GetSchema methods before each valuable operation.

This is OK in general, but if you building some complex and high loaded integration as the result you may get something like this:

Not very nice as it creates additional traffic network traffic and unnecessary load to server.

Much better way is to cache Cookies and Schema on the client side and refresh it only if it was not in use for some period of time.

Here I want to share with you an example where I create a new class inherited from Screen and call Login operation automatically before each Submit operation if service was idle for more than 10 minutes.
This static class is more for your idea, i'm pretty sure you may have a better way to do it on the production environment.

Also note that you can encapsulate some additional logic in your class and make your integration code simpler.

Code Snippet:

Have a nice Integration!

Monday, 7 November 2016

Most Popular Acumatica DAC Attributes

Hi All,

Today I want to share with you some statistics on Acumatica xRP Attributes usage across Acumatica ERP Business modules. The goal of this article is to show you a full list of attributes that you may use for customization and also give you a chance to learn some new useful attributes, that you have not seen before.

This data was collected from PX.Objects.dll of Acumatica 6 and may be different from version to version.
All attributes are sorted by the usage frequency, highlighted by value and grouped by colours:
  • Fields attributes
  • Selectors and aggregate attributes
  • Business logic
  • Others
In the brackets you can find approximate value of how many time this attribute is used. Here you can find that was used more than 5 times on all DACs.
Also some attributes (like list attributes) was hidden from the list as they do not bring a value to the reader.

After the brackets you can find brief explanation of attribute meaning. Please note that most of the attributes have been described in the context help

and Acumatica Framework reference guide as well.

Welcome under the cut for more details:

Wednesday, 26 October 2016

Alter GL Transaction during Inventory Release

Hi All

Today I want to share with you one of possible ways how you can catch the process how Inventory release created a GL Batch and GL Transactions.

Lets assume that we want to change description or Sub-Account during inventory receipt release, than i need to do following things:

  1. Create extension of INReleaseProcess, that is responsible for release operation.
  2. Override ReleaseDocProc, that is doing main release job.
  3. In this method we have links to JournalEntry and INRegister, where we can check what is going on and add some additional logic
  4. Add RowInserting event to JournalEntry that will handle creation of batch or tran
  5. Change description or sub-account where it is required

In the end you have exactly required batch.


Code snippet:

Have a nice Development!

Thursday, 20 October 2016

Encrypted batch payment file (ACH, GIRO)

Hi All,

In Acumatica you can easily generate electronic payment files (such as ACH, GIRO and others). By using this process you will have a file that will have payment amounts and other required information.
But what about data protection? Bu default payment file will have clear text amounts.
Today i want to share with you how you can easily encrypt this file.

Payment file will be generated by Acumatica Integration Services Export Scenario. The main class that is responsible for generation file is Integration Services Data Provider. In Acumatica out of the box we have only 2 providers : ACH and GIRO.

In my Example i will show you standard .NET encryption using Triple DES encryption.

Steps:
  1. Using customization module create a new provider and inherit it from from base provider (ACHProvider or GIROPaymentProvider).
  2. Override SetFile method.
  3. Put your encryption logic there.
  4. Publish customization.
  5. Use new provider type in the export provider. Do not forget to update provider object and fields when you changing type. Also will be good to save previous object name, as Export Scenario is linked to provider object by name.

That is all you need to do. Now you can generate a file and it will be encrypted.


Full code snippet:

Have a nice decryption!