Archives

Archives / 2018 / May
  • Some notes on usage Table variables

    Hello everybody,

    today I want to share some fragment of SQL, that I've used for updating tables in Acumatica.

    First of all, I'd like to show table variable that I've created:

    DECLARE @SalesOrderInformation TABLE

    (

      OrderType nvarchar(2),

      OrderNbr nvarchar(12)

    )

    It has nothing special, just two fields: ordertype and ordernbr. 

    I need them as temporar storage for future update. T-SQL allows to use two kind of temporary tables: table variable and temp table, which starts from #.

    I prefer table variables for the following reasons:

    1. Performance. Because limited scope, as usually performance fo table variables is faster then temp tables. 

    2. Temporary tables instead of table … more

  • GDPR trainint certificate

    Hello everybody,

    today I want to share a screenshot of GDPR training completion and a few words about training from Business Fraud Prevention Partnership.

    First of all, I'd like to say that Business Fraud Prevention Partnership made a great explanation of what GDPR is, and what it is not. 

    I've enjoyed from the way how they split information. They used for splitting differnet wordings, picures which made it easy to memorize information. 

    Prior to taking their course I've spent some time reading about GDPR, but if I just read without any quiz in the end, most probably information will move in brain in some passive mode and that's it. But with their tests it will stay longer and will be … more

  • How to set some value in Acumatica screen and tell about it to Acumatica

    Hello everybody,

    today I want to write a short note about persisting something to Acumatica.

    Sometime it happens that in your code you have something like this:

    SomeDacInstance.Field = somevalue;

    and following workflow:

    User clicks on save, you code is executed, you go in record, refresh page and surprise: somevalue is not there. How to deal with it? In such cases you'll need to use method SetValueExt.

    For example one of readers of mine blog had the following code:

    row.LotSerialNbr = modificado2;

    cache.Insert(row.LotSerialNbr)

    but that approach didn't save value for two reasons:

    1. simple assign of value doesn't tell acumatica cache about any changes.

    2. Inserting something … more

  • 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