Contents tagged with Acumatica

  • Automation schedule screen is not executed

    Hello everybody,

    today I want to describe interesting feature of Acumatica related to back ups of database. Imagine the following: you've restored database from back up at your dev environment. And let's say you have automation schedule that every hour you should send to each contact some emails. So, you've restored customization and would like to find the button that will block sending of all emails. At which screen it is? At none. It is interesting to know, that Acumatica already "pressed" at this button when you've restored db from back up. But for now you probably have another question. How to debug execute any schedule at all?

    I propose following steps:

    Delete all automation … more

  • How to modify default time zone at Acumatica

    Hello everybody,

    today I want to make a short notice on how to change default time zone in Acumatica. 

    In my case such need appeard when it was needed to modify default time zone of Acumatica that I've restored from database backup. In order to do this you'll need to go to screen that is named Site preferences. Id of that screen is sm200505.  more

  • Branch restriction in Automation schedule in Acumatica

    Hello everybody,

    today I want to describe one behaviour of Acumatica processing screen. 

    So, once upon a time I created processing screen. Purpose of that screen was simple: take data from some external source and insert it into Acumatica. 

    As that processing screen worked fine, it was taken a decision to create automation schedule step that will make that screen to be executed by Acumatica automatically. And then following issue arised: also that screen worked great in manual mode, it didn't work at all in Automation schedule mode at all. 

    After long investigation I found the following:

    Automation screens are executed from the user acount admin

    Also admin should have access to … more

  • Different types of search in Acumatica

    Hello everybody,

    recently friend of mine gave me wonderful question:

    In PXSelect command, I saw Search, Search2, Search3… keywords, please explain the difference.

    Thats really good question which shows his attentiveness to details.

    So, no let's go part by part.

    Targets

    First of all, Search statement can be applied to those kinds of attributes: PXSelector, PXDbScalar and PXDefault. 

    Also you can apply Search statement to cases when you updated something in cache of Acumatica and what to reopen that part. It can look like this:

    Document.Search<POOrder.orderNbr>(currentPoOrder.OrderNbr, currentPoOrder.OrderType);

    or like this:

    [PXDefault(typeof (Search<Company.baseCuryID>))]

    Don' … more

  • How to modify Approve and Reject actions in Purchase orders screen

    Hello everybody,

    today I want to share some knowledge about interesting feature of Acumatica: Approve and Reject actions in Purchase orders screen.

    When I was asked how long it will take to modify behaviour of Approve and Reject actions, I've thought it will be easy task. Find appropriate Actions, overload then and enjoy life. But with those two actions life is more complicated. 

    After speaking with Acumatica support I've realized that those two actions are declared as Automation steps, so in order to work with those actions it will be needed to look into knowledge about Automation steps. The only memeber that has relation to those actions are type of EPApprovalAutomation. 

    So, in order … more

  • How override Persist method in Acumatica

    Hello everybody,

    today I want to show sample of code on overriding Persist method in Acumatica. 

    Consider following scenario, you need to modify saving logic of screen Purchase Orders in Acumatica. How you can achieve this? Following steps can help you to do this:

    Create extension class for POOrderEntry

    Override Perist method

    Both of those details implemented below:

    public class POOrderEntryExt : PXGraphExtension<POOrderEntry>

    {

        [PXOverride]

        public void Persist(Action del)

        {

            //Here you can add some of your code that should be executed before persisting PO Order to database

            del();

        }

    }

    With such simple steps you can modify persisting … more

  • How to hide tab in Acumatica

    Hello everybody,

    today I want to share piece of knowledge about Acumatica controls. Recently I was asked to add one more tab to page Checks and payments.

    Let's suppose it was named Allocations. It should be displayed only if type of payment is set to Prepayment.

    Such kind of behaviour is possible to implement via three steps:

    Add tab with name Allocations

    Set VisibleExp to the following: 

    VisibleExp="DataControls[&quot;edDocType&quot;].Value==PPM"

    Set BindingContext to the form like this:

    BindingContext="form"

    Or just more detailed picture:

    </px:PXTabItem>

    <px:PXTabItem Text="PO Allocations" VisibleExp="DataControls[&quot;edDocType&quot;].Value==PPM" BindingContext=" … more

  • DeletedDatabaseRecord in Acumatica

    Hello everybody,

    today I want to write few words about interesting feature of Acumatica: column DeletedDatabaseRecord. As you may know plenty of ERP systems have strategy of holding everything that ever passed through them, and even if user has huge desire to ask ERP system to forget something via deletion of some entity, ERP "pretends" that record was deleted, but leaves it in db. 

    From this standpoint Acumatica can be exception. It allows to preserve records that lived inside of it. Allows mean can preserve or not preserve. 

    How programmer can achieve this kind of behaviour? Via column DeletedDatabaseRecord. 

    If you want Acumatica to hold some kind of entities in db, just add this … more

  • Multithreading in Acumatica

    Hello everybody,

    today I want to say a few words about my practice of usage Multithreading in Acumatica. I have a dedicated server which has 40 cores. And I have a need to read plenty of records from some other system. General schema is like this:

    Create some graph instance.

    Fill created graph instance data views with needed data

    At created graph instance call method graphInstance.Actions.PressSave();

    And that schema is perfectly workable, but for my disappoitment my 40 cores were not busy at all with doing something useful. So I had to figure out how to use them more fully. 

    Here are some fragments of code that I've used:

    int numberOfLogicalCores = Environment. … more

  • Some notes on Buttons creation in Acumatica

    Hello everybody,

    today I want to write few words about buttons usage in Acumatica.

    So, first of all, if you just need to add button at your form, you can use following syntax:

    public PXAction<PrimaryDACClass> SomeAction;

    [PXButton(CommitChanges = true)][PXUIField(DisplayName = "Some Action")]protected virtual void someAction(){      ...}

    Following syntax will create a button for you in the top buttons panel of Acumatica.

    Take note of CommitChanges=true attribute. In case if you need just some activity without persistance to database, then you can set it to false. But if you want button to save some changes to database then set it always to true.

    There is one more way of declaring … more

  • Some digging in tables of Acumatica

    Hello everybody,

    today I want to document one useful sql query that can be beneficial for cases if you need to dig in Acumatica tables, and need quickly to find type of some particular column.

    Here it is:

    select * from information_schema.columns where table_name = 'SOLine' and COLUMN_NAME like '%OrderQty%'

    that sql will let you know all information about column OrderQty. more

  • Unit test Acumatica PXGraph

    Hello everybody,

    today I want to make another description of how to cover with Unit Tests Graphs in Acumatica. 

    First of all I want to say that Acumatica controllers or as Acumatica names them graphs do not have any way to inject any dependency from interface. In such case it can be useful idea to use Microsoft Fakes library. 

    So in order to unit test Acumatica code you will have a need to make mix of Acumatica code with Microsoft shims. Imagine that you have following graph declaration:

    public class PAllocs : PXGraph<PaymentsAllocation>

    and somewhere in your graph you have method like this:

    [PXButton(Tooltip = "Saves values from grid")]

            [PXUIField(DisplayName = "Save" … more

  • Types of screens in Acumatica

    Hello everybody,

    today  I want to describe one more feature of Acumatica: types of screens in Acumatica. In Acumatica majority of screens are the following:

    Data Entry pages

    Maintenance pages

    Inquiery pages

    Setup pages

    Processing pages

    Reports.

    Now let's talk in more details about those screens:

    Data entry pages

    As usually data entry pages located at following icon in the red rectangle.

    These pages are the most frequently used pages of the Acumatica. Typically, data entry pages are used for the input of business documents, such as sales orders in a distribution module.

    Maintenance pages

    As usually maintenance pages located at following icon in the red rectangle. … more

  • Types of controls in Acumatica

    Hello everybody,

    today I want to describe with some screenshots kind of controls that you can get from Acumatica developer like me or any other Acumatica programmer.

    Main purpose of this blog post is the following. Imagine, that you want to write super detailed instructions for Acumatica developers. After reading this article I suppose you'll be able to write instructions to them with any kind of detalization. Or even super detailed.

    First of all, I want to point that as usually Acumatica pages consists of two parts: top and bottom. Top part often is named summary, and bottom is considered to be detalization of top. Take a look at following screenshot:

    At presented screeshot red part … more

  • How to override action "Create " at form SO301000 or "Sales orders"

    Hello everybody,

    today I want to document one important piece of functionality in Acumatica. Sales order screen. This is very important screen and has many staff. One of the important screens in it is "Sales orders"  screen. From prospective of understanding Acumatica source code of method "Actions" has plenty of food for mind.

    Take a look at it's declaration:

    public PXAction<SOOrder> action;

    [PXUIField(DisplayName = "Actions", MapEnableRights = PXCacheRights.Select)]

    [PXButton]

    protected virtual IEnumerable Action(PXAdapter adapter,

    [PXInt]

    [PXIntList(new int[] { 1, 2, 3, 4, 5 }, new string[] { "Create Shipment", "Apply Assignment Rules",

                    … more

  • Acumatica DAC class generator

    Hello everyboydy,

    today I want to share with anybody mine implementation of DAC class generator.

    By default Acumatica provides you with DAC class generator which is pretty good.

    But time from the time I had a need to generate DAC class into text field, and then

    put it somewhere in my solution, and Acumatica DAC class generator didn't feet to

    mine needs. So I decided to create my own DAC class generator. 

    This form has simple interface. In the first line you enter Connection string, at second

    line you enter table name, press at generate, and receive DAC class.

    You can download source code here. 

    Below goes also some C# code which I've comment later:

        public  … more

  • How to add sitemap into your customization

    Hello everybody,

    today I want to describe some simple steps of how to add into your customizaiton sitemap. As you already know, sitemap of Acumatica is saved in database. And if you make customization of your sitemap you may need to add to your project.xml something like this:

    <Customization level="0" description="" product-version="5.30">

        <SiteMapNode>

            <data-set>

                <relations version="3" main-table="SiteMap" />

                <layout>

                    <table name="SiteMap" />

                </layout>

                <data>

                    <SiteMap>

    <row Position="72" Title="Warehouse"  Url="~/Frames/Default.aspx"  … more

  • How to make yourself as Administrator in Acumatica with SQL

    Hello everybody,

    today I want to share some piece of SQL code that can help you to add yourself to Administrators group in Acumatica:

    INSERT INTO [dbo].[UsersInRoles]

               ([CompanyID]

             ,[Username]

             ,[Rolename]

             ,[ApplicationName]

             ,[CompanyMask]

             ,[CreatedByID]

             ,[CreatedByScreenID]

             ,[CreatedDateTime]

             ,[LastModifiedByID]

             ,[LastModifiedByScreenID]

             ,[LastModifiedDateTime])

       VALUES

               (2

             ,'yourAccountName'

             ,'Administrator'

             ,'/'

             ,0xAA

             ,'B5344897-037E-4D58-B5C3-1BDFD0F47BF9'

             ,'00000000'

             ,'2010-07-27 17:25:00.000' … more

  • How to validate input on Insert

    Hello everybody,

    today I want to document small feature in Acumatica which I can call validation of insert. 

    As usually if you need to validate some logic of insertion you can use something like RowXXXXd event. But for simple validations you can use PXUIVerify attribute. Below goes example take from Acumatica itself:

    [PXUIVerify(typeof (Where<LandedCostTran.curyLCAmount, NotEqual<decimal0>>), PXErrorLevel.Error, "The value must be greater than zero", new System.Type[] {}, CheckOnInserted = false)]

    What this command says to you is pretty obvious:

    Verify at ui level ( generate javascript verification code ) that value at LandedCostTran.CuryLCAmount is not equal to zero.  … more

  • One more example of selectors

    Hello everybody,

    today I want to present one more example of selectors, but the one, that has multiple fields in it. 

    Consider following code:

    using System;

    using System.Collections;

    using System.Collections.Generic;

    using System.Linq;

    using System.Text;

    using System.Threading.Tasks;

    using PX.Data;

    using PX.Objects.CS;

    using PX.Objects.CT;

    using PX.Objects.DR;

    namespace MyBlog

    {

    public class DeliverySelectorAttribute : PXCustomSelectorAttribute

    {

    public DeliverySelectorAttribute(Type selectorField, params System.Type[] fieldList)

    : base(selectorField, fieldList)

    {

    }

    public override void FieldVerifying(PXCache … more