Contents tagged with Acumatica

  • 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

  • How pageSource in Acumatica works

    Hello everybody,

    recently I was asked by one friends of mine, how pageSource in Acumatica works, i.e. how to code/decode pagesource contents. 

    After different methods of trial and error I've created following C# code in order to code/decode pageSource:

    Snippet

    private static string Compress(string src)

            {

                if (src.IsNullOrEmpty())

                {

                    return null;

                }

                byte[] bytes = Encoding.UTF8.GetBytes(src);

                using (MemoryStream stream = new MemoryStream())

                {

                    using (DeflateStream stream2 = new DeflateStream(stream, CompressionMode.Compress))

                    {

                        stream2. … more

  • How to make grid to locate all available space

    Hello everybody,

    toda I want to document one simple how-to issue. Recently I've spent some time in figuring how to make grid to locate all available space.

    Below goes how to make it:

    <AutoSize Container="Window" Enabled="True" MinHeight="400" />

    You can add it somewhere before end of px:PXGrid tag. For example like this:

          <AutoSize Container="Window" Enabled="True" MinHeight="400" /> </px:PXGrid>

    more

  • How to add redirect to grid in Acumatica

    Hello everybody,

    today I want to write a few words on how to add links to some entites in Acumatica.

    So, recently I've had an assignment to add redirect into existing grid, so intead of showing some text show nice link which will lead to Purchase order.

    Here is what I've done in order to achieve it.

    First of all I've noticed, what is primary DAC class in graph. It was VendFilt. 

    Then following steps were needed:

    create code for button:

    Snippet

    public PXAction<VendFilt> gotoPOOrder;

    [PXButton(Tooltip = "Open Purchase order")]

    [PXUIField(DisplayName = "Open PO")]

    public virtual void GotoPOOrder()

    {

        var poOrdEntryGraph = PXGraph.CreateInstance<POOrderEntry>();

        var  … more

  • PXSplitter basic template for autosize grid in Acumatica

    Hello everybody,

    today I want to write a few words about UI in Acumatica and if to be more precise about combination of splitter with other UI controls.

    As you maybe know, in order to allow user to modify height of input control, splitter conrol should be used.

    For now I found following configuration of splitter useful: 

    Snippet

    <px:PXSplitContainer runat="server" ID="PXSplitContainer" Height="100%" Width="100%" Panel1MinSize="120" Panel2MinSize="120" 

        SplitterPosition="210" Size="3" SkinID="Transparent" Orientation="Horizontal">

        <AutoSize Enabled="true" Container="Window" MinHeight="300" MinWidth="100" />

        <ContentLayout AutoSizeControls="True" Orientation="Horizontal" /> … more