Blog

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

  • Required instead of current in Acumatica

    Hello everybody,

    today I want to fulfill my promise that I gave to one of my readers. 

    He left at mine blog following question:

    How do we use required<> in place of current<> and pass some string constant for selector? That question was asked in context of this article. 

    That is good question and I also want to add that answer on it will be at least to some degree disappointing. First of all, if you work with selectors, you can't use Required. Required is intended for use in Graphs.

    But if you want to use some constant filtering conditions, you don't need Required attribute at all. You can use mechanism of Constants, which works perfectly without Required. 

    Take a look at the … more

  • How to insert correctly new Sales order into Acumatica with external graph

    Hello everybody,

    today I want to write a short notice on how to create new sales order in Acumatica properly.

    So, first of all take not that SOOrder type has two keys. One key is or order type, and second key is for OrderNbr.

    It means that you can't do code like this:

    var newSOrder = sOEntry.Document.Insert();

    sOEntry.Document.SetValueExt<SOOrder.orderType>(sOEntry.Document.Current, sorder.AcumaticaOrderType);

    or actually you can, but later you'll face some issues with duplicated sales orders ( as I recently faced ).

    But what you should do if you wish create new Sales order is the following code snippet:

    var newSOrder = new SOOrder();

    newSOrder.OrderType = sorder.AcumaticaOrderType; … more

  • Cross validation. Sklearn.model_selection, sklearn.cross_validation

    Hello everybody,

    today I want to describe a bit more about cross validation and how to work with it in Python. Here I describe how to split learning set once or how to use different cross validation strategies. 

    Before I'll continue, I'd like to describe different types of splitting data for training. 

    There are following ways to split data:

    1. Split on 70/30 ( sometime 80/20 ) on two sets: Training data, Validation data. 

    You train data on training data, and validate on holdout data. 

    This approach has following pros/cons:

    (+) model is trained only once

    (-) depends from the splitting

    (+/-) works fine for big data sets

    In order to understand one more case take a look at … more

  • Built in data sets in Sklearn and visualization with Pandas

    Hello everybody,

    today I want to write a few words about built in data sets in sklearn library of python but from Visual Studio 2017 prospective. You may ask why Visual Studio 2017 if there are plenty of other options? I can say that main reason is becuase I like debugging features that availabile in Visual Studio which make my life much simpler. 

    Initial headers and one function

    So, before we continue, we need as usually in Pythong import some basic libraries. You can do it in Visual studio like this:

    import sklearn

    from matplotlib import pylab

    import matplotlib

    import matplotlib.pyplot as pyplot

    import numpy as np

    from sklearn import datasets

    def sanitize_sequence(data): … more

  • Different kinds of tests

    Hello everybody,

    Today I want to write a really short description of different kind of tests, which can be perfomed by code.

    Unit test: Specify and test one point of the interface of single method of a class. This should have a very small and well described scope. Complicated dependencies and activities to the outside staff are stubbed or mocked.

    Integration test: Test the correct co-operation of multiple subsystems. There is whole ecosystem here, from testing integration between two classes, to testing integration with the production environment.

    Smoke test (AKA Load test, AKA Sanity check): A simple integration test where we just check that when the system under test is … more

  • How to check Automation step settings in Acumatica

    Hello everybody,

    today I want to describe some tricky feature of Automation steps. 

    Quite often in Acumatica I face interesting challenge. I've added some code in Row_Selected, open some screen, and to mine disappointment I find that screen totally ignores mine code. What can stand behind such weird behaviour?

    One of the explanations can lie behind automation steps. If to put simply, automation steps is a feature of Acumatica, that allows to program it without any usage of C# code. All that is needed from you as Acumatica user is just add via GUI designer staff on the form and then via automation steps configure it's behaviour. 

    So, let's consider some details, that can help you to … more

  • C# feature nameof

    Hello everybody,

    today I want to share with you one cool feature of C#.  It is nameof. Take a look at the following code:

    var abc = 3;

    var varName = nameof(abc);

    How do you think, what will go into varName? It will be equal to "abc". Probably you can puzzle why on earth I can need such an operator?

    Consdier following cases:

    1. If you work with reflection, then instead of rely on hard coding names of fields, you can rely on compiler to subsitute it instead of you. 

    class Program

    {

        public class NameOffDemo

        {

            public string SomePropertyOne { get; set; }

            public string SomePropertyTwo { get; set; }

        }

        static void Main(string[] args)

        {

             … more

  • PXPrpojection, Data Projection what is it?

    Hello everybody.

    Imagine that you need to have implementation of several tables with possibility to update them all. 

    Also you want to implement by the Acumatica side rather than by the database.

    You know that Joined tables in Acumatica are read-only and you cannot update fields there

    Can we create/use SQL-like views in Acumatica?

    How can I join grouped (statistical) view to the DAC?

    So, yes we can do it. For this purpose Acumatica gives you PXprojection attribute.

    PXProjection attribute  binds the DAC to an arbitrary data set. The attribute thus defines a named view, but is implemented by the server side rather than by the database.

    Lets start)

    Steps:

    Think whats tables you … more

  • Amazon storage

    Hello everybody,

    today I want to write a few words about Amazon storage. 

    So, first of all I'd like to say that Amzaon provides to kinds of storage: 

    Ephemeral

    S3

    If to speak about ephemeral, then I can say that main purpose of this storage is temporary storing of your data. If to compare ephemeral storage with S3 it has following limitations:

    access speed is not guaranteed

    there is not service level agreement for this service

    You can use ephemeral storage for the following staff:

    buffer

    cache

    scratch data

    etc...

    Let's talk now about S3. Question 1, why it is named S3? Amazon Simple Storage Service, or three letters S. 

    it has following features:

    Accessible via … more

  • Inventory items images structure in Acumatica

    Hello everybody,

    today I want to document some information about how images for inventory items are stored in Acumatica. 

    Database structure (Acumatica)

    InventoryItem - A table that contains all InventoryItem data

    > ImageURL - A data field where the image file name being saved.

     

    UploadFile - A table that contains attachments data

    > Name - A data field where you can use to join with InventoryItem using InventoryItem.ImageURL = UploadFile.Name

     

    NoteDoc - A table that contains all NoteDoc data

    > FileID - A data field unique ID where you can use to join with UploadFile using UploadFile.FileID = NoteDoc.FileID

     

    A SQL query that get data necessary to create the imageExternalLink … 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.