Blog

Here I document some issues for searching of which I spent more then 15 minutes

  • 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

  • Update-Database Error on switching from .Net core 1.1 to 2.0

    Hello everybody,

    today I want to share some strange behaviour that I faced. 

    Recently I needed to switch from .Net core 1.1 web app to .Net core 2.0 app. 

    I found over internet that simplest way to achieve it will be just opening project in Visual Studio 2017 and VS will switch your project by itself. I decided to give to such attempt a try. 

    Initially all went fine. Visual Studio 2017 gave me very nice looking report which convinced me that life is easy and wonderful. Actually it said that project was switched to .Net core 2.0 with success.

    Then I've tried to execute in package manager console Update-Database command. Unfortunately I've seen following error message:

    An error occurred … 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

  • Kaggle competition attempt. Not successful

    Greetings everybody,

    here I want to preserve for future usage my code which I've used to train model for one of Kagglecompetitions:

    1 package org.deeplearning4j.examples.convolution;

    2

    3 import com.google.common.io.LittleEndianDataInputStream;

    4 import org.deeplearning4j.api.storage.StatsStorage;

    5 import org.deeplearning4j.datasets.iterator.BaseDatasetIterator;

    6 import org.deeplearning4j.datasets.iterator.FloatsDataSetIterator;

    7 import org.deeplearning4j.datasets.iterator.impl.ListDataSetIterator;

    8 import org.deeplearning4j.datasets.iterator.impl.MnistDataSetIterator;

    9 import org.deeplearning4j.eval.Evaluation;

    10 import org.deeplearning4j.nn.api. … more

  • How to create learning set for neural network in deeplearning4j

    Hello everybody,

    today I want to document one simple feature of Deeplearning4j library. Recently I had an assignment to feed into neural network for Deeplearning4j.

    If your learning set is not big ( later I'll explain what big means ) then you can put all your data into INDArray and then based on that you can create DataSet. Take a look at fragments of XorExample.java:

    1 // list off input values, 4 training samples with data for 2

    2 // input-neurons each

    3 INDArray input = Nd4j.zeros(4, 2);

    4

    5 // correspondending list with expected output values, 4 training samples

    6 // with data for 2 output-neurons each

    7 INDArray labels = Nd4j. … 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

  • Normalization formulas for neural networks

    Hello everybody,

    today I want to write a short note about normalization for neural networks. 

    So, first goes formula how to normalize input in range [0, 1] ( taken from here ): 

    Another good for me example is going below ( taken from here ):

    p = [4 4 3 3 4;

    2 1 2 1 1;

    2 2 2 4 2];

    a = min(p(:));

    b = max(p(:));

    ra = 0.9;

    rb = 0.1;

    pa = (((ra-rb) * (p - a)) / (b - a)) + rb;

    In this example ra stands for maximum value of range, rb stands for minimum value of range that we want to make. 

    more

  • How to read little endian file of floats in Java

    Hello everybody,

    today I want to document another issue that took from me plenty of time. Recently I've used following code in Python in order to save array of numpy numbers:

    import numpy as np

    newImage = ...some way of getting array

    np.ndarray.tofile(newImage, newFn)

    But when I tried to get that content in Java code, I faced issue that my inputs where unreadable by Java. After spending some time over net I've found that Python uses little endian encoding, while Java uses another encoding for saving floats. 

    So my research of little endian gave me the following code result in java for reading little endian:

    InputStream inputStream = null;DataInputStream dataInputStream = null; … 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

General information

Greetings to everybody stopping at my blog. Purpose of this web site is to be google of my brain. Everything I found useful, or of possible beneficial for usage in future I've save here at this blog

Contact information

If you want to contact me more on any subject printed at this web stie, you can email me: zaletskiy(at)gmail.com

Job information

If to speak in general, I'm developer. For now I work as team lead in company GlobalLogic.