Archives

Archives / 2018
  • Azure Fabric Service Lifecycle

    Hello everybody,

    today I want to write few words about Azure Fabric Services lifecycle.

    Initially I'll describe what is going to happen in words, and then later I'll add picture. In any service creation participates two actors: Azure Service Fabric runtime and Service instance which will be created by Azure Service Fabric. Basically for each stateless as well as statetfull service following 5 steps are happening:

    1. Azure Service Fabric will create instance of your service

    2. Then Azure Service Fabric will ask your service to create listeners

    3. Azure Service Fabric will get list of your listeners.

    4. For each listener in the array Azure Service Fabric will try to open listener

    5. … more

  • How to make WPF ViewModel that will not crash during design time

    Hello everybody,

    today I want to describe following WPF use case: you make your View in xaml, then add some ViewModel in which instantiate reading from repository, and then try to open some that ViewModel in designer and see error message. Pretty disappointing situation, isn't it?

    In order to avoid such a situation, inside of your constructor of your ViewModle use DesignerProperties class, and it's method GetIsInDesignMode. If it returns true, it means that you try to see control in design mode, and then instead of executing some produciton code you can either return some hardcoded values for design time, or at least return from the construction. 

    For example like this:

    public class  … more

  • How to make alias for jar command

    Hello everybody,

    today I want to write few words about aliases in Powershell. First of all, why somebody may need aliases? Need in aliases arises, when you have some kind of big cumbersome commands. For example recently I've got a need to execute something like this:

    java -jar f:\utils\ANTLR\tpantlr2-code\code\antlr-4.7.1-complete.jar

    As you can see from the length, to type such a long string is pretty hard, even if you copy/paste it. In that case I've decided to use aliases. 

    My initial approach was like this:

    Set-Alias antlr4 'java -jar f:\utils\ANTLR\tpantlr2-code\code\antlr-4.7.1-complete.jar

    But when I've tried to execute such alias, Ive got the following error message:

    antlr4 : … more

  • WPF Controls are lookless

    Hello everybody,

    today I want to drop a note about WPF controls. For me it was very shoking to discover that WPF controlls are lookless ( that's official term from Microsoft ). That sounds countr-intuitive. Especially if you make code like this:

    <Window x:Class="Lookless.MainWindow"

            xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"

            xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"

            xmlns:d="http://schemas.microsoft.com/expression/blend/2008"

            xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"

            xmlns:local="clr-namespace:Lookless"

            mc:Ignorable="d"

            Title="MainWindow" Height="450" Width="800"> … more

  • Observable in microservices

    Hello everybody,

    today I want to document one important feature of implementing microservices. It is Correlation ID. Basically if you have ten microservices exeucting, and want to know how data is transformed between services, it is good idea to make some value which will travel between services. In that case it will be easy for you to see, what was condition of the systmem in case if you'll make some kind of analysis. It can be order filling with some information. Also that correlation id can be preserved in Central logging of microservices. more

  • Some notes on Microservices

    Hello everybody,

    today I want to write a few words about microservices and why they

    become so popular in our days. 

    First of all, take a look at the following picture,

    it shows how monlitic service look like:

    At this picture we have following elements: customer, which uses web site.

    Web site in turn has two parts: UI for customers and for company support.

    And inside of the web site quite often you will see interconnections between

    Accounts, orders, promotions, discounts, inventory, products and so on.

    And on separate computer as usually lives database.

    Now imagine that you need to modify part related to promotions. What will happen in case of upgrade? You'll need not just … more

  • Shared Access Signatures

    Hello everybody,

    today I want to write few words about Shared Access Signature for blob storage in Azure.

    First of all, I'd like to point that SAS is token, that provides access to blog item. And it has very interesting features. For example:

    You can give access which will start from some date time and finish at some date time.

    Limit access by IP addresses

    Allow file to be accessed by Https protocol or Https and Http.

    You can assign permissions to it. For example Read, Write, Delete, List, Add, Create, Update, Process.

    Pretty cool? I think yes.

    And one of the cool features is that you can create SAS in C# code.

    For example you can do it like this:

    Create in your class member … more

  • Azure cloud storage types

    Hello everybody,

    today I want to write a short notice about storage types in Azure. Here are they:

    Blob storage. Blob is abbreviation of binary large objects. But you can store there anything you like: small, big, binary, image etc information there. 

    Table storage. If to put simply it is Dictionary, but on Azure. Key/value pairs which you can persist. Can be useful for scalability apps.

    Queue storage. Storing and retrieving messages. As previous item from the list can be useful for scalable applications.

    File storage. That storage allows you to store SMB files to the system. SMB stands for Server message blocks. 

    Disc storage. Store any kind of information on hard drive that is … more

  • Staff that I plan to read in Accountancy

    Hello everybody,

    here I want to leave staff related to accountance that I plan to read in near future:

    “Accounting for Inventories” http://www.iesep.com/en/accounting-for-inventories-126176

    “Receivables Valuation” http://www.iesep.com/es/accounts-receivable-valuation-126107.html

    “Non-current Assets” http://www.iesep.com/es/noncurrent-assets-126110.html

    “Liabilities, General Issues” http://www.iesep.com/en/liabilities-general-issues-126173.html?___from_store=es

    “Shareholders' Equity” http://www.iesep.com/en/shareholders-equity-126152

    “Consolidation” http://www.iesep.com/en/consolidation-126158

    “Tax Accounting” http://www.iesep.com/en/tax-accounting-126155

    more

  • Some notes on Azure Services Fabric

    Hello everybody,

    today I want to make few notes on Azure Services Fabric.

    First of all, I'd like to point that Azure Services Fabric is a tool, intended for building scalable apps. Besides Azure Services Fabric, Microsoft Azure provides following options of working with scalable applications:

    Azure Container Service

    Azure Service Fabric

    Azure Functions

    Azure Container Service is docker orchestration technology. If you feel yourself as cool admin you can jump right into writing docker files, manage running docker containers etc. But there are three tools for container orchestration available at Microsoft Azure:

    Docker Swarm

    DC/OS

    Kubernetes

    Azure Service Fabric is purposed … more

  • How to make MS SQL stored procedure that is protected from SQL Injection

    Hello everybody,

    today I want to write a simple note on how to make stored procedures in MS SQL server which are protected from SQL injections. 

    Below goes example of SQL stored procedure, that is vulnerable to SQL injection attacks:

    -- Bad code, don't use it ever

    CREATE PROCEDURE SearchCustomers

    @searchCust varcahr(50)

    AS

    BEGIN

    DECLARE @query VARCHAR(100)

    SET @query = 'SELECT * FROM Customer WHERE NAME LIKE ''%' + @searchCust + '%'''

    EXEC (@query)

    END

    Why it is bad? Because if somebody passes into @searchCust value or 1=1 --- then SQL will return all customers. If to add a bit more creativity it's possible to get from that database plenty of information.

    If you wonder, … more

  • OWASP top 10 security risks

    Hello everybody,

    today I want to mention top 10 security risks according to OWASP ( Open Web Application Security Project ):

    Injection

    Cross Site Scripting

    Broken Authentication and session management

    Insecure direct object references

    Cross site request forgery

    Security misconfiguration

    Insecure cryptographic storage

    Failure to restrict url access

    Insufficient transport layer protection

    Unvalidated redirects and forwards

    This top 10 is 10 technology independent ways of checking security of any web site independently of used technologies: either .Net or PHP or Java Server Pages or NodeJS more

  • Proof of Work Schema

    Hello everybody,

    today I want to present schema of something named Proof of Work. 

    There are people which better understand situation with pictures then with words. Also there is a saying one picture is worthy thousands of words.

    First of all, imagine, that all blockchain is 6 computers. All of them of course connected. For example like on the picture:

    Computer 5 is in another colour for a reason. Read next part and you'll get why.

    Next think, imagine, that we have in blockchain 4 elements. Like this:

    And of course, task. It is needed to add one more chain: blockchain5 to all of this. Here is what will happen:

    It's not possible just to add blockchain5 via simple copy in memory … more

  • Unites of measure in Ethereum

    Hello everybody,

    today I want to make clear document on units of measure in Ethereum.

    Unit

    Quaintiti in one ETH

    Most appropriate uses

    Eher( ETH )

    1

    Used for denomination of transaction amounts and mining rewards

    finney

    1000

    szabo

    1 000 000

    Currently used for cost of transaction ( 500 szabo )

    Gwey

    1 000 000 000

    Used for Gas Prices

    Mwei

    1 000 000 000 000

    Kwei

    1 000 000 000 000 000

    wei

    1 000 000 000 000 000 000

    The base invisible unit used by Solidity programmers

    Honestly saying for me it was hard to find this info in such a format. more

  • Tools for local blockchain development

    Hello everybody,

    today I want to write a few words about local blockchain environment for development. 

    In order to have everything on one machine for development you can consider following tools:

    Chrome with metamask

    For coding you can use Visual Studio Code ( there are ways of working with Visual Studio Proffesional or Enterprise but I didn't find way for 2017 editions. Only 2015 )

    nodejs

    windows build tools ( installed via nodejs )

    ethereumjs-testrpc

    With list of those tools C# developers will fill themselves more or less in their plate and ready to go for development. At least I fealt :) more

  • Global variables in Solidity

    Hello everybody,

    today I want to write few words about global variables in Solidity. First of all I'd like to say that global means not only some global variable that you've declared in your code. Also it means part of memory whicy is automatically provided to your contracts.

    In other words global means that those variables are always avaialable for any part. 

    The first is msg. Those three letter stand for word message and it is a structure that has fields sender, value, data, gas, signature. 

    For example in order to get sender, you can use following fragment of code:

    address owner = msg.sender;

    Next very interesting is amoung of ethers send. In order to get it following code can be … more

  • Some Solidity data types from C# standpoint

    Hello everybody,

    today I want to write a few words about data types in Solidity, language of programming for Ethereum and how they can be declared.

    First of all there are simple types like byte, int, int256, uint128, bool etc. All of them are value types.

    There are also bytes, string which are reference types. 

    Reference types has interesting features. 

    bytes a; is equal to byte[] a; in C#.

    mapping is something like Dictionary in C#. For example you can make following dictionary Dictionary<string, int> prices; in Solidity like this:

    mapping (string => int) prices;

    In that case prices will a bit like a Dictionary in C#. For example you can write something like this:

    prices["potatoes" … more

  • Layout of Solidity program from standpoint of C# developer

    Hello everybody,

    today I want to make post about solidity program.

    Programs can start from pragma solidity line. 

    It looks like this:

    pragma solidity 0.3.1; 

    pragma line says what is maximal version in which contract should be compiled.

    often you can see line like this:

    import "filename"

    you can import some file which has extension ".sol" but file name should be without sol ending.

    If to speak in analogies in C# or Java everything or almost everything is a class, but in Solidity everything is contract.

    It can look like this:

    contract ContractName

    {

    }

    Inside of your contract you can declare any kind of variables which are commonly named state variables. 

    Declaration goes … more

  • What is solidity

    Hello everybody,

    Today I want to write a few words about what is solidity, and why on Earth it was invented.

    Before I'll do that few words about blockchain.

    Blockchain consists of two main words: block and chain.

    And special feature of blockchain is that it is made in a way, that each new part of it is made with taking into account previous blocks of information ( through hasing ). Another part is that everybody who is involved in blockchain has that information on theirs computers. In other words new additions somehow include information about previous pieces. 

    Then consider the following. Suppose government of some country want's to print more money. As usually they want to do it for … more

  • GDPR in Blockchain

    Hello everybody,

    today I want to notice very important note about personal information which you can store if you develop blockchain that is used at EU zone.

    Consider following scenario: you develop blockchain technology for your customers. For example you've bought from user some kind of service ( for example piece of source code ).

    According to GDPR rules user can expect right to be forgotten by your service of storing source code. But you can't erase information about his source code for some reason ( other developers built based on his codebase, 

    or in case if source code that you've bought causing harm and you want to avoid/double check his source code, etc).

    How to deal in that … more

  • Income statement abbreviations

    Hello everybody,

    today I want to write a few words about Income statment abbreviations which can be seen there. 

    First of all I'd like to say that Income statement often is named Profit and Loss account. In Acumatica it is named sometimes as PNL ....

    COGS - cost of goods sold

    SG&A expenses - Selling Generative and administrating. In other words operating expanses like salary, rent, electricity, etc.

    Gross Margin = Total Sales - COGS

    Gross Profit = Total Sales - COGS

    Operating profit = revenues - operating expenses - depreciation - COGS

    EBIT = Operating profit = Earnings before interest and taxes

    EBITDA = Earnings before interest taxes, depreciation and amortization = gros margin - … more

  • Depreciation vs Amortization

    Hello everybody,

    today I want to write a short note about Depreciation and Amortization and whati is the difference between both. 

    So both of them reflect information about loosing value of some non current asset. If company bought something for one price, and with time that something looses it's value.

    What the difference?

    Depreciation is connected to tangible asset.

    Amortization is connected to intangible asset.

    For example loosing of value of laptop is characterized by depreciation.

    Loosing of value of software is characterized by amortization. more

  • AR vs AP

    Hello everybody,

    this post is intended for Acumatica developers which wonder about difference between AR and AP screen or as they named accounts payable and accounts receivable. If to speak simply both of them are intended for future benefits. The difference is just who is receiver of those benefits: your company ( accounts receivable ) or not your company ( accounts payable ).

    Consider example: your company sells laptops. In case if HP gave you 10 latpops, then information about them will be written at your accounts payable. But for HP those laptops will be at accounts receivable. Let's say somebody made agreement with your company, that they will pay you in two months for 2 out of your 1 … more

  • Key features of Acumatica

    Hello everybody,

    today I want to make a post about by no means exhaustive but quite descriptive list of features in Acumatica.

    Main features Acumatica

    Accounts payable

    Accounts receivable

    Advanced CRM - convert prospects to accounts with 1 click

    Advanced accounting - multi-currency, consolidation ledgers

    Advanced billing

    Advanced distribution - inventory, sales, purchasing

    Allocate expenses

    Budget tracking

    CRM integration

    Campaign management

    Case management

    Cash management

    Currency management

    Customer management

    Customer portals

    Distribution management

    Employee portal (timesheets, expense reports)

    Enterprise features - mid-sized business costs

    Expense management … more

  • Contract API Optimization

    Today, I want to re-tell about Contract API Optimization. Materials get from conference of Acumatica and introduction by Joshua van Hoesen.

    Three point of ineterst

    Utilisation of ReturnBehavior

    Avoid graph logic by creating Generic Inquiry for data retrieval

    Multi-Threading

    Introduction

    With the continued advancement of integrated software solutions, there has also been a need to address legacy business processes and how they may be implemented in a modern framework. These business processes tend to rely heavily on collecting large amounts of raw data from disparate sources and aggregating it together for further processing.

    Some companies whose business process … more

  • Liabilities in Accountancy

    Hello everybody,

    now let's go for liability definition.

    Liability in accountancy word definition is like this: present obligation of the firm to transfer economic benefits in the future to another party that arise from a past event or transaction.

    Definition has following key parts:

    present obligation

    transfer benefits

    past transaction event

    From this standpoint bank loan is liability. 

    Potential lawsuite without estimated fine size can't be liability, but definetly should be mentioned in footnotes of balance sheet. 

    3 years warranty is also liability. For example warranty for the car. And if company can estimate their obligations on warranty then those kind of liabilities are … more

  • Asset non asset difference

    Hello everybody,

    today I want to write few words about difference between something important in the company, that can be asset and close to asset but not be considered as asset from acocuntancy standpoint.

    First of all let's start from definition. Asset has three key parts in its definition:

    ownership

    generates benefit

    arises from transaction

    Full definition of asset sounds like this: Asset is a resource owned or controlled by the firm that it is expected to generate future economic benefits and arises from a past event or transaction. 

    From this definition stnadpoint piece of equipment which is worth 1M $ is an asset because 

    owned by company

    will generate profit

    resulted … more

  • Development methodologies

    Hello everybody.

    Today I want to make a post about list of development methodologies. How much of them you can name? Agile/Scrum, Waterfal. Which else? Take a look at list that I've discovered for myself:

    Waterfall

    Prototype

    Agile

    Rapid Application Development

    Dynamic System Development Model Methodology

    Spiral Model

    Extreme Programming Methodology

    XP

    Joint Application Development

    Lean Development

    Scrum

    How many of those you know/tried/practiced? more

  • Two sets of principles in Accountancy

    There are two main standartizers of Accountancy:

    IFRS

    US GAAP

    IFRS stands for Inernational Financial Reporting Principles. IFRS is set in London by International Accounting Standards Board IASB.

    US GAAP - United States Generally Accepted Accounting Principles. US GAAP is set by Financial Accounting Standards Board.

    more

  • Prospectus

    Hello everybody,

    in order to become better Acumatica developer I've decided to take course on Accounting: Principles of Financial Accounting.

    Here I'll share some ideas that become new to me.

    So, I want to speak about Prospectus.

    Securities and Exchanges commision requires that any kind of company that borrows money from potential investors provide to them document which has following information:

    Company history

    Management biographies

    Financial statement

    Best-case scenario

    Worst-case scenario

    Other information that will help investors to make informed decision

    So, next time when I'll hear prospectus it will mean for me some kind of document which will say something like … more

  • Acumatica Test Framework in Acumatica. Part 2 (Practice)

    In this part we implement real automation test for creating POOrder - screen PO301000;

    Before to start, please read first part of rhis post. 

    The main steps:

    Create solution and add nedeed components from SDK folder

    Add new project (Net library) to solution 

    Configure generator and run it for create .cs class with all components on screen PO301000

    Add POOrder.cs and describe some methods for test

    Add the main class (for example F100_Part1_Lesson1.cs) where we describe Execute() method

    Run solution, view result of test

           Create solution and add nedeed components from SDK folder

    CCreate a test solution by using Visual Studio 2017 as follows:

    In Visual Studio 2017, … more

  • Acumatica Test Framework in Acumatica. Part 1 (theory)

    Ok, Acumatica provides as part of platform is Acumatica Test Framework. Acumatica test Framework is a set of tools and libraries that can be used for unattended black-box testing of any product or customization that is based on Acumatica Platform right in your favorite browser. For interacting with UI controls and components Acumatica Test Framework uses Selenium Web Driver. You can read more about Selenium here or nice example of it is this video.

    The high level diagram of Test Framework components is described here:

    Acumatica Test Framework Architecture:

    As you can see here the core thing of the test framework is Element IDs – Each HTML element has own ID how browser can find it. … more

  • How to use Chart component in Acumatica

    Hello everybody,

    today I want to share one more trick on how to chart in Acumatica. Imagine following case: you have some information about your sales orders, and want somehow to visualize it wiht nice picture. 

    How to do it? You can use charting component of windows. Here I've described building elements of charting library. Charting library is located at System.Drawing library.

    Main purpose of this article is to demonstrate how to use Charting library without going deep about image management. 

    Basically code shows how to load filtered information about sales order add data points, generate dynamic picture and show it on the form.

    Firstly let me show to you picture part:

    <%@ Page  … more

  • Dependency Injection with Acumatica and Autofac from inside customization

    Hello everybody,

    today I want to write a few words about something that I consider as cool achievement: dependency injection in Acumatica with help of Autofac. Before sharing any code I'd like to mention why Autofac and not other framework? Because Acumatica itself is built on Autofac. For you as a developer it basically means that you can omit nuger versioning or any kind of versioning with Acumatica. You just reference Autofac, and it will be available for you in your project.

    Keeping this idea in mind, let's suppose that you have following class in your code:

    public class EmailNotificationSender : IEmailNotificationSender

    {

        public void SendEmail(string to, string subject, string  … more

  • How to use column name in DB that differs from field name in DAC class

    Hello everybody,

    today I want to leave a short workaround for the following case:

    you have DAC class, with column Data, but in db you have column BlobData. How to map your BlobData on Data? For such case you can use attribute DatabaseFieldName.

    Take a note, how Acumatica used it:

    [PXDBBinary(DatabaseFieldName = "Data")]

    public virtual byte[] BlobData { get; set; } more

  • Technology is not the biggest threat to the bank

    In this article I want to express my opinion on why I disagree with title that technology is threat to the bank of Antony Jenkins.

    First of all, I'd like to point that anything that is new, can poses a threat to something, that already exists on the market. And task of those which exist is either to use it, or they will be forced to close themselves.

    First subheading of Antony is job losses of bank workers. I definitely agree that job losses of bank workers will happen. And absolutely agree that job losses will happen because of improvement of data collecting, AI process data faster etc. But I disagree that such a think poses any threat to bank. I can say even opposite, such job loss … more

  • Investments terms in Real estate

    Hello everybody,

    today I want to document some terms related to real estate investment with simple words.

    NOI or Net operating income

    NOI or net operating income is income after all expances but before morgage payment ( in case of real estate ). 

    Cap rate

    Cap rate or capitalization rate is something which says what profit you'll get in percentage from benefiting something that you use during one year.

    I assume with example it will be easier to understand.

    Suppose, you want to buy a flat which you plan to give as a rent for others.

    You pay for buying a flat 40 000$. Monthly rent of flat income after paying all bills is 350$. What is cap rate ( capitalization rate )? Below goes the … more

  • How to send email via Acumatica notifications mechanism

    Hello everybody,

    Today I want to share a note on how to send email via Acumatica notifications mechanism:

    var sender = new NotificationGenerator

    {

        To = "someone@example.com",

        Subject = $"Subject information {DateTime.Now:d}",

        Body = "Body od message",

        BodyFormat = EmailFormatListAttribute.Text

    };

    sender.Send();

    With such code, Acumatica will send email.

    more

  • Notes on Acumatica developers summit 2018

    Hi all,

    Recently I visited virtual developers conference for Acumatica.

    Here I want to document some details that were mentioned during that summit.

    First of all, I'd like to say that idea from Gabriel Michaud about making some global functionality for each page.

    Using PXGraph extension for creating a global button

    Consider for example how to implement a global button using PXGraphExtension:

    public class GloalGraphExtension : PXGraphExtension<PXGraph>

    {

        public override void Initialize()

        {

            if (!string.IsNullOrEmpty(Base.PrimaryView))

           {

               //Add a "Test" button in the toolbar    

               Type primaryViewItemType = Base.Views[Base.PrimaryView]. … more

  • Acumatica developers conference 2018 part 1

    Hello everybody,

    I want to summarize what I've seen and heard at latest Acumatica Developers conference.

    First of all, I'd like to say that idea from Gabriel Michaud about using of attributes that can save plenty of time during development.

    Part 1

    Everyday trips and tricks (Magic attributes and BQL operands)

    Lets start. For examle how to make a field required (or visible, or enabled) dynamically:

    Traditional way (old version):

    protected virtual void SOOrder_RowSelected(PXCache cache, PXRowSelectedEventArgs e)

    {

        SOOrder doc = e.Row as SOOrder;

        if (doc == null)

        {

               return;

        }

        if (doc.OrderType == "SO")

        {

              PXDefaultAttribute. … more

  • Microsoft Chart basic elements

    Hello everybody,

    recently I've found Microsoft Chart elements description picture, and was very much surprised with it. So I've decided to leave picture at mine blog as well.

    First of all take a look at those elements on the picture;

    Description of Chart Details

    Axis Label

    Labels along axis.

    Axis TitleThe title of an axis.

    Chart AreaThe chart picture consists of one or more chart areas, which are rectangular areas that are used to draw series, labels, axes, grid lines, tick marks, and so on. Multiple series can be plotted in one chart area, depending on the chart types involved.

    The plot area, used to plot chart data, is also contained within a chart area.

    Chart PictureThe chart … more

  • Select distinct values in Acumatica selector

    Hello everybody,

    today I want to post how to make distinct select from some column in Acumatica.

    So, imagine that you've decided not to normalize some column for Acumatica to SOOrder class. For example like this:

    public class SOOrderExt: PXCacheExtension<SOOrder>

        {

            #region Region

            public abstract class region : IBqlField

            {

            }

            [PXDBString(255)]

            [PXUIField(DisplayName = "Region", Visibility = PXUIVisibility.Visible)]

            public virtual string Region { get; set; }

            #endregion

    Then in other place, if you need to make distinct selector for Region, you can use code like this:

    #region Region

     public abstract class region  … more

  • How to speedup parallel processing in Acumatica

    Hello everybody,

    recently I've get advice from Acumaitca on how to speed up parallel processing of sales orders creation with usage of Multithreading. Their advice was to add following line in web.config:

        <add key="AsyncNumbering" value="true" />

    With that line your Acumatica graphs will have separate numbering sequences which can create some gaps in your numberings, but definetely speed up creation of new lines. more

  • Abbreviations in Warehouse management

    Hello everybody,

    today I want to leave a note on warehouse abbreviations. For me all of them are not easy to keep in mind, so I decided to post them here:

    Abbreviation

    Meaning

    3PL

    Third party logistics

    ADC

    Automated data collection

    APS

    Advanced planning & scheduling

    ASN

    Advanced shipment notifications

    ASRS

    Automated Storage Revival system

    ASP

    Application service provider

    ISV

    Independent software vendor

    AIDC

    Automatic identification and data collection

    BOM

    Bill of material is a list materials required to produce an item

    CCD

    Charged coupled device is a barcode scanner that takes digital image of the barcode instead of … more

  • Some properties of graph in Acumatica

    Hello everybody,

    today I want to mention few interesting properties of Graph in Acumatica:

    IsImport

    IsExport

    IsMobile

    Names are pretty self-explanatory, but let's go a bit deeper.

    IsImport

    Imagine following situation: you created some code in graph, and have huge desire to add some logic, which will be executed only when it is used in Import mode. For example in case of import you'd like not to add discount. How to tell this to Acumatica? For example like this:

    if (!sender.Graph.IsImport) AddDiscount(sender, doc);

    This will tell to Acumatica not to add discount to your entity during Import.

    IsExport

    Another use case. Imagine, that you want some logic to be executed during … more

  • Prediction customization

    Hello everybody,

    here I want to describe in more details what I mean when I say prediction customization.

    As name says by itself, I want to make something that will help you to make predictions. 

    Predictions for what? 

    Acumatica has plenty of entities: invoices, sales orders, employees, taxes, acounts payable, acounts receivable, fixed assets, etc. I want to make customization, that will use some machine learning techniques in order to say something like: in the next month based on history of your your sales, you'll have 2000 sales orders. Or based on your current history, you'll pay 300 000 taxes in the next two months. Or based on your history of hiring, in next three years you'll … more

  • Acumatica clipboard functionality

    Hello,

    today I want to drop few lines about working with copy/paste functionality of Acumatica.

    For full canceling insertion from Clipboard, you can use the following in your graph:

    public override bool CanClipboardCopyPaste()

    {

    return false;

    }

    Also you can use attribute PXCopyPasteHiddenFields. That attribute says that specified fields of the primary DAC of the data view will no be copied when the copy-paste feature is used.

    Another attribute which you can consider is PXCopyPasteHiddenView. This attribute says that cache corresponding to the primary DAC of the data view is not copied when the copy-paste feature is used.

    And one more useful fields in graph itself is … more

  • Make printing of one table per page with CSS

    Hello erybody,

    today I want to share one important note, which took significant amount of time from me to finish.

    I had page which as html output few tables. For me it was nessesary to make one page per table. In order to achieve it I've found following CSS:

    <style>

        table,

        table tr td,

        table tr th {

            page-break-inside: avoid;

        }

    </style>

    That was only one css that worked for me.

    more

  • How to add Database context to Filter in .Net Core 2.0

    Hello everybody,

    today I want to write a short description on how to add database context to IAuthorizationFilter.

    Imagine that you have following filter:

    public class HasApprovedFilter : Attribute, IAuthorizationFilter

    {

        private SomeDbContext _context;

        public HasApprovedFilter(SomeDbContext context)

        {

            this._context = context;

        }

        public void OnAuthorization(AuthorizationFilterContext context)

        {

            var user = context.HttpContext.User;

            if (!user.Identity.IsAuthenticated)

            {

                return;

            }

            var userAdd = _context.;

            //var um = context.HttpContext.RequestServices.GetService();

        }

    } … more

  • Types of fliters in .Net Core

    Hello everybody,

    today I want to make a short document about filters in .Net Core.

    There are by default four types of filters:

    Filters that implement IAuthorizationFilter which allow us to implement OnAuthorization method which allow us to add custom security logic.

    Filters that implement IActionFilter has two methods: OnActionExecuting, OnActionExecuted. Those two methods executed before and after action executing.

    Filters that implement IExceptionFilter has method OnException, which allows to handle exceptions.

    Filters that implement IResultFilter has two methods: OnResultExecuting, OnResultExecuted.

    Filters can be applied at controller or at action level. That gives following … more

  • How to override part of C# code in Automation Steps in Acumatica

    Hello everybody,

    today I want to share one interesting gotcha which took plenty of efforts from mine side in order to understand it.

    Recently I got an assignment to modify behaviour of Create Prepayment action at purchase orders. 

    If to look at CreatePreapyment implementation, it has following part of code:

    if (this.Document.Current == null)

      return;

    this.Save.Press();

    APInvoiceEntry instance = PXGraph.CreateInstance<APInvoiceEntry>();

    if (this.Document.Current.PrepaymentRefNbr == null)

    {

    if to put simply it checks if current purchase order already has a prepayment, and in case if it has, then give to a user error message. 

    Imagine, that you need to modify that behaviour for … more

  • How to override Create Prepayment in Acumatica without usage of custom delegate

    Hello everybody,

    today I want to share with you on how to override Action CreatePrepayment in Acumatica.

    General rule of overriding methods in Acumatica according to T300 manual is like this:

    Create delegate.

    Add [PXOverride] over your method which is named exactly as base method ( in our case CreatePrepayment )

    Add your implementation

    For example you can achieve it like this:

    //Create your delegate

    public delegate void CreatePrepaymentDelegate();

    [PXOverride]

    public void CreatePrepayment(CreatePrepaymentDelegate baseDel)

    {

        // your code of overriding

    }

    Way from manual T300 is perfectly workable, but  I propose you to use feature of .Net which is named Action, … more

  • Creating custom Autonumber which will be auto generated ID in Acumatica

    If you want to create custom Attribute for autonumbering field you need:

    Create Setup page for configuring autonumbering field or maybe you can use existing

    Create Attribute which you'll add to your entity

    Add attribute to field that you need increment 

    Create Setup page for configuration autonumbering field

    Setup.cs like this:

    [System.SerializableAttribute()]

        [PXPrimaryGraph(typeof(CurrencyMaint))]

        [PXCacheName("Your company Preferences")]

        public class Setup : PX.Data.IBqlTable

        {

            #region DocumentRefNbr

            public abstract class documentRefNbr : PX.Data.IBqlField

            {

            }

            protected string _DocumentRefNbr;

            [ … more

  • Entity Framework one to many relationship

    Hello everybody,

    today I want to make short post on how to confiugre one to many relationship in Entity Framework 6.

    Imagine following: One group can have multiple students. So one to many relationship. For this purpose you can use following convention configuration agreement:

    public class Student

    {

        public int StudentId { get; set; }

        public string StudentName { get; set; }

    }

    public class Group

    {

        public int GroupId { get; set; }

        public string GroupName { get; set; }

        public string Department { get; set; }

        public List<Student> Students { get; set; }

    }

    In presented example class group includes navigation property Students. 

    Another convention is … more

  • Complete description of arguments in jForex submitOrder

    Hello everybody,

    here I want to leave fragment of code related to submitOrder:

    public void onStart(IContext context) throws JFException {

    IEngine engine = context.getEngine();

    IHistory history = context.getHistory();

    Instrument instrument = Instrument.EURUSD;

    context.setSubscribedInstruments(java.util.Collections.singleton(instrument), true);

    ITick lastTick = history.getLastTick(instrument);

    double price = lastTick.getAsk() + instrument.getPipValue() * 5;

    double sl = lastTick.getAsk() - instrument.getPipValue() * 20;

    double tp = lastTick.getAsk() + instrument.getPipValue() * 10;

    long gtt = lastTick.getTime() + TimeUnit.SECONDS. … more

  • New class in Acumatica: PXImpersonationContext

    Hello everybody,

    here I want to document new scope in Acumatica: PXImpersonationContext. 

    As often is the case try to look at presented code:

    var thr = new Thread(

                                       () =>

                                       {

                                           try

                                           {

                                               using (new PXImpersonationContext(PX.Data.Update.PXInstanceHelper.ScopeUser)).

    .

    .

    }

                                foreach (var thread in threads)

                                {

                                    lock (thisLock)

                                    {

                                        thread.Start();

          … more

  • Manage serialization in .Net Core 2.0

    Hello everybody,

    today I want to write a short notice on how to manage uppercase/lowercase options for serialization in .Net Core.

    In mine practice I often had situation, when javascript or typescript code sends me some staff in lowercase class names, but in C# I'm used to Upper case class names. 

    Another option that you sometime can need is switching between xml and json serialization. How those options can be managed in .Net Core 2.0 ?

    For both of those options ( and even more ) you can use pipeline management of Startup class of ConfigureServices method.

    For example if you need to have xml serialization output you can use following code:

    public class Startup

        {

            // This  … more

  • Some notes on Jira usage

    Hello everybody,

    today I want to make a short recording of the following video: Introduction to Jira & Agile and Project management.

    Actually I just want to have short text version of Dan Chuparkoff's  advices.

    Task is something that is bigger then 30 minutes but smaller then 3 days to complete. It is practical don't have tasks that take more then one day to do.

    You can't wait in the middle of the task. If you are waiting in the middle of the task, then take another look, maybe you have series of tasks. 

    You can be in three modes: in progress, done, not started.

    Estimating is hard, but use estimates. And use story points, not the hours. 

    There are different kinds of story points.  … more

  • Ridge regression in C# with help of Math .Net Numerics

    Hello everybody,

    today I want to share a piece of code that took me almost few months of learning in order to implement it. It is Ridge regression. Below goes code that gives you weights for Ridge regression:

    public double[] RidgeRegression(double[][] xTrain, double[] yTrain, double lambda = 0.1)

    {

        var M = Matrix<double>.Build;

        var x = M.DenseOfRowArrays(xTrain);

        

        var ones = Vector<double>.Build.Dense(x.RowCount, 1);

        x = x.InsertColumn(0, ones);

        var y = Vector<double>.Build.DenseOfArray(yTrain);

        var xt = x.Transpose();

        var lambdaIdentity = lambda * M.DenseIdentity(x.ColumnCount);

        var sumDot = xt.Multiply(x) + lambdaIdentity;

        var  … more

  • Linear regression behavior with free weight

    Hello everybody,

    recently I've decided to implement some ML library in C#. But mine ultimate goal of that C# library was to make it use as much as possible TPL features of C#. 

    I'm aware about other ML libraries, but as often is said, if you wish to understand how some ML algorithm works, program it by yourself. I've decided to start with Linear regression.

    Here you can see how mine library utilizes processor:

    as you can see it uses 85% of mine 4-cores CPU, which is impossible with only one thread running.

    First step for me was to understand how that algorithm works. In order to understand it I've took course Machine Learning Specializationfrom University of Washington.

    I'll omit … more

  • Practical value of unit tests

    Hello everybody,

    Here will be another interesting benefit of writing unit tests which I've discovered recently for myself. 

    Simplified testability

    Imagine, that for you as for developer arrived some kind of bug. After investigation you've found that bug is caused with imporper method functionality. How can you fix method without unit tests? Way will be like this:

    Add code fix

    Execute application and make effort to re-prodcue bug

    If bug is not re-produced, you make commit/push and enjoy life

    If bug is not fixed, go to steps 1 - 3 one more time.

    Here is how those steps can look like in unit test:

    Add unit test that feed into method with bug wrong values

    Add fix to code … more

  • Some notes on xUnit usage

    Hello everybody,

    today I want to share with you small explanation about how xUnit works. 

    Take a look at presented code:

    [Theory]

    [InlineData(3, 4, 5)]

    [InlineData(7, 8, 9)]

    public void MethodDemo(int numberOne, int numberTwo, int numberThree)

    {

        double[][] data = new double[1][];

        data[0] = new double[3];

        data[0][0] = numberOne;

        data[0][1] = numberTwo;

        data[0][2] = numberThree;

        var sut = new Matrix(data);

    }

    If to describe this code in words, it has following meaning. 

    Attribute Theory says that it is test method which should be exeuted.

    Repeated twice Attribute InlineData says that method MethodDemo should be executed twice, with assigning to … more

  • Access rights in Acumatica

    Hello everybody,

    today I want to leave a short notice on how access rights work in Acumatica. So, if to enumerate them, there are following access permissions: revoked, select, update, insert, delete. 

    If to enumerate them in the list of smallest permissions to biggest, it will be list like this:

    Revoked - user can't see or edit

    Select - user can see, can't edit

    Update - user can see and edit

    Insert - user can see, edit, create new

    Delete - user can see, edit, create, delete

    So, if you configure permissions, and want to give highest level, then give Delete. But if you want to protect system from accidental deletion, then most probably you'll need give them Select set of … more

  • C# async/await usage

    Hello everybody,

    today I want to describe in simple words what C# does for .Net cases in IIS.

    Before I continue, I want to point the following. As usually IIS has 500 threads. It means that one IIS server can simultaneously server 500 customers. Keeping this idea in mind

    take a look at the following code:

    [HttpGet]

    public IEnumerable<string> GetSync()

    {

        string val1 = "value" +  LongRunningMethod().ToString();

        string val2 = "value2";

        return new[] { val1, val2 };

    }

    private int LongRunningMethod()

    {

        Thread.Sleep(10000);

        return 10;

    }

    and imagine that you have 600 customers simultaneously. For 500 lucky users of your web site it will mean that their … more

  • Import export data between different SQL servers

    Hello everybody,

    today I want to share some information on how to import some big chunks of data from one server to another. Need for this movement for me personally arised when I had a need to transfer big amounts of data on a regular basis. Big amount means 2.5 millons of records. My first apporach was to use SQL Server 2017 Import and Export Data. Initially I've used 32 bit tool, and found out that I sometime face strange error messages. After some googling I've found that for big volumes of data it's better to use SQL Server 2017 Import and Export Data 64 bit. 

    and all of the sudden strange configuration errors, drivers lack error, ODBC driver error had leave me. 

    So, one of the … more

  • 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

  • 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

  • How to construct complicated queries in BQL of Acumatica

    Hello everybody,

    today I want to describe the following situation. Imagine that you have to write following SQL statement in Acumatica:

    SELECT InventoryItem.InventoryCD, InventoryItem.imageUrl, UploadFile.Name, NoteDoc.FileId, * FROM InventoryItem

    LEFT JOIN UploadFile ON InventoryItem.imageUrl = UploadFile.Name

    LEFT JOIN NoteDoc ON UploadFile.FileID = NoteDoc.FileID where imageurl is not null

    I myself prefer to have way to write a code that is easy to modify and maintain. So instead of creating one big BQL statement I'd like to make it as few smaller statements. Is it achievable with Acumatica BQL? Yes, it's achievable. Take a look at following code that does exactly what I've … more

  • How to set command time out part 2

    Hello everybody,

    today I want to document few ways on how to modify command time out. Sometime it may happen that you have some kind of long runnig queries, and at some particular graph you may want to make it live longer. 

    For such purposes very convenient is PXCommandScope object. Below goes code sample that allow you to achieve this purpose:

     using (new PXCommandScope(PXDatabase.Provider.DefaultQueryTimeout * 2))  // increasing 2 fold {               var results = PXSelect<BAccount>.Select(this); }

    with such code you can get twice a time for your BQL statements.  more

  • Monitor diagnostics window of Visual Studio

    Hello everybody,

    today I want to share interesting feature of Visual studio Diagnostics Tools window. 

    Take a look at picture below:

    as you can see on the picture it has plenty of gray diamonds with few red ones. Try to guess, what is purpose of red diamonds or red rhombs? It shows that some exception happend during exectution and also if you point cursor of mouse on that diamond, it will show you text of exception. Pretty cool, huh ?

    more

  • How to increase display size of items in SQL server management studio

    Hello everybody,

    today I want to document one interesting feature of SQL Server management studio. Some time it happens, that you work with big XML data files.

    For example if you have sql statement like this:

    SELECT @xm=( select rowid, count(rowid) as IdsNumber from SOLine s where s.rowid like 'fdsafewvvcxkfdsla'fslf%' group by rowid for xml raw, root) select @xm

    in SQL server management studio and would like to increase size that is workable by SQL server management studio. I found that following value in system registry is very helpful:

    HKCU\Software\Microsoft\SQL Server Management Studio\14.0_Config\XmlEditor\MaxFileSizeSupportedByLanguageService

    set it's value to 100 and you'll … more

  • How to modify Query timeout in Acumatica

    Hello everybody,

    today I want to share with you some trick which I used for cases if I get error message that some select from Acumatica timed out. Sometime if you work with big tables ( ~2 millions of records ) you may face timeout errors. Especially it is troublesome for processing screens when you are ready to wait for some kind of functionality just in order to be complete. Let me introduce you to property DefaultQueryTimeout of PXDataBase.Provider static class. By default it's value is set to 90, which means that it will be executed by sql server for 90 seconds. I should admit that for majority of cases it is more then enough. Except for cases when you need to fix some bugs in code. … more

  • Convenient parsing of XML nodes in C#

    Hello everybody,

    today I want to share with you code that I use in order to conveniently to parse different xml nodes in C#. 

    Take a look at this class:

    public static class XmlNodeProcessor

        {

            public static int? ParseInt(this string s)

            {

                if (string.IsNullOrEmpty(s))

                {

                    return null;

                }

                return int.Parse(s);

            }

            public static long? ParseLong(this string s)

            {

                if (string.IsNullOrEmpty(s))

                {

                    return null;

                }

                return long.Parse(s);

            }

            public static Guid? ParseGuid(this string s)

            {

          … more

  • Create customization to MYOBAdvanced(Acumatica), part 3 сreate customization and publish it

    So, continue the work:) 

    Part 3 сreate customization and publish it

     Create customization

    To create customization for import to MYOBAdvanced (acumatica) I need go to Customization - Customization Project and add new customization (Screenshot 10):

    In this example I use design of acumatica ( add screen, add page,  files and scripts) see Screenshot 11.

    Also I add sql script that will add new column "UsrBodyWithoutHtml" to table "CRActivity" (Screenshot 12"):

    After this click on "Publish"; I see whether validation has passed and there are no errors. If all ok I can close window and click export customization. ActivityCustomization.zip folder will be downloaded.

           

        … more

  • Create customization to MYOBAdvanced(Acumatica), part 2 сreate page, graph, DAC class extension and xml page for mobile

    So, continue the work:). Part 1 is here.

    Part 2 сreate page, graph, DAC class extension and xml page for mobile

    First of all, In project I create folder "DAC" and add two clasess:

    ActivityTypes.cs

    This class need to filter types rows from table CRActivity(column name - Type). Client asked display all events for that Business Account of type "Phone Call", "Client Visit" and "Futile Visit" So for this I do next:

    public static class ActivityTypes

       {

           public const string F = "F";

           public const string M = "MEET";

           public const string P = "P";

           public class fType : Constant<String>

           {

               public fType()

                   : base(F)

               … more

  • Create customization to MYOBAdvanced(Acumatica), part 1 description of the task, prepare to start

    I want to tell you some little history about how was created customization to existing MYOBAdvanced (Acumatica) project.

    One guy who buy and use acumatica from MYOBAdvanced (myob.com), asked me to create customization.

    He wrote:

    "

    The standard platform under Business Accounts has the Activities tab, which is where we record the data. Refer to attached screenshot.

    I need a search page as follow on the app/mobile device:

    Search field which only searches the Business Account Name field. 

    The user enters text, then Business account names that match that text are displayed, the user then selects the required account.

    The page then display all events for that Business Account of type " … more

  • How to separate Automation schedules in Acumatica

    Hello everybody,

    take a loot at the following picture:

    Let's say that you would like to have two Acumatica instances connected to the same database. Is it possible? Definetely yes, just with pointing both of them to the same connection string and you'll get some kind of scalability. 

    But imagine that your Acumatica has execution of some automation schedules. How to make sure, that only one of them will be executor of Automation schedules, not both of them?

    Very simple. Just add this key to web.config of Acumatica which should not be Automation schedules executor:

     <add key="DisableScheduleProcessor" value="True"/>

    Default value of DisableScheduleProcessor key is false, so you need … more

  • How to modify Stock Item screen ( IN202500 ) in Acumatica with adding master detail selectors

    Hello everybody,

    today I want to describe how to extend Stock Item screen IN202500 in Acumatica. Imagine that you need to add to tab General settings two selectors. Suppose that you need to have two selectors:

    as you can see following need to be achieved:

    To tab General Settings it is needed to add selectors: "Clase articulo web" and "Subclase articulo web".

    In case if selector "Clase articulo web" changes, then "Subclase articulo web" should show some other values.

    The first step should be start Acumatica developer project as described here.

    For cases if we have dependency of one selector from another it is possible to program in two ways:

    Custom selector for dependent code. … more

  • Clock

    Hello everybody,

    today I want to leave a note about one of mine customers. And you know, as soon as I've started to write this post I've caught myself that I can't name one person for whom I provide services for money with word customer. Please continue reading and you'll grasp what I mean. 

    Have you ever wonder how it could happen that Steve Jobs, guy that is not a designer, not UI-UX designer could orchestrate development of such cool devices? I always dreamed to meet such a person in life, not just read about them in wikipedia, or to read their books. And I can say that recently I've meet such a person. 

    Everything started from project that he asked me to create. And of course, I'm … more

  • Operator IN in BQL

    Hello everybody,

    today I want to write a few words about operator in which was presented in SQL for long ago, but weren't available in Acumatica BQL. But time goes on and now you can use it. For example like this:

    Object[] values = new String[] { "BXW000004", "BXW000005" };

                    POOrder item = PXSelect<POOrder,

                        Where<POOrder.orderNbr, In<Required<POOrder.orderNbr>>>>.Select(Base, values);

    that code will generate following sql statement:

    Select * from POOrder POOrder Where POOrder.OrderNbr In ('BXW000005', 'BXW000004')

    Order by POOrder.OrderNbr

    I can say that such approach simplifies some tasks that require dynamic passing of arguments.

    more

  • Functions map, zip and lambda in Python

    Hello everybody,

    today I want to describe three elements of Python: map, zip, lambda and *.

    Zip and *

    The first step that I want to describe is zip and * usage. Take a look at the following code:

    a = [5, 6]

    b = [7, 8]

    c = zip(a,b)

    print(*c)

    How do you think, what will be output, if I'll tell you that zip function zips arrays? If your guess is (5, 6) (7, 8) then unfortunately you are wrong. Output will be the following:

    (5, 7) (6, 8). I suppose that zip name was chosen because as usually zippers on clothes as usually vertical. Zip functions "zips" elements by columns, like presented on the picture:

    Now one more question, what is purpose of * ? It tells to Python interpreter to … more

  • Scaling Acumatica horizontally

    Hello everybody,

    today I want to share one interesting piece of information about horizontal scaling of Acumatica. I mean as usually for majority of people it is clear that Acumatica can work on one machine when DB, IIS and Acumatica lives on one machine. 

    One more variant of scaling can be when you have IIS with Acumatica on one machine, and DB on another machine. It can look like this:

    Here User lives on his machine, Acumatica ERP server lives on second machine, and site database lives on third machine. That is pretty good working schema especially for cases if you need vertical scalability.

    But recently I've discovered little bit more horizontal scalability for Acumatica which … more

  • How to merge precision and recall

    Hello everybody,

    today I continue writing notes about measuring quality of learning. You can read my previuos artcile 1 and article 2 about measures of quality of learning. If to summarize two of those articles we have the following:

    accuracy is good measure, but if samplings is unbalanced then accuracy can have great numbers, but total model will be very bad.

    precision tells you how objects model a(x) can find

    precision and recall work fine on unbalanced samplings

    And then question arises, is it possible somehow to merge them, but not as accuracy but as something more meaningful then accuracy?

    I'll decribe different ways to describe it going from worsest to better and hopefully … more

  • 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

  • How helping others can transform your life

    Here in Ukraine there is a joke: nothing spoils health of Ukrainian more then richness and welfare of his neighbor.

    Also I often hear statement that helping others can transform your life to better. I've spent some time on finding the ways to help others. But helping not via giving money. As one man once said give somebody fish for two times and for third time that person will demand fish from you. So I wanted to be a person that can give fishing rod to people instead of just giving them fish.

    As result I've decided to teach some close friends of mine programming. Well, it is not a surprise because I'm quite skillful in that area and what else can I teach? And you know, it changed my … more

  • How to measure quality of learning part 2

    Hello everybody,

    today I want to add few more notes about measuring of quality of learning, but today about tasks of classification. 

    So, one of the ways can be measuring number of wrong answers. For example with usage of the following formula:

    Imagine that your classification set has three possible labels: a (10 elements ), b ( 15 elements ), c ( 20 elements ). And let's say that your model wrongly classified 2 out of a, 3 out of b and 4 out of c. In that case following formula is applicable:

    Historically it happend that in classification tasks it is common to maximaze function, while in regression learning vice versa. 

    Another common measurement of quality of classification is … more

  • How to measure quality of learning

    Hello everybody,

    Today I want to describe some ideas about measure quality of learning. 

    First of all I want to point areas where you can apply those measurements. It can be in three areas:

    For setting funtional during learning

    For picking hyperparameters

    For evaluation of ready made model

    Another way can be combination. You can measure quality during learning with one measurement, but final model you can analyze with other measurement. 

    MSE

    So, let's start with most common formula: mean squared error:

    In words it reads the following: difference between prognozed value and desired value, squared, summed and finally averaged. 

    MSE has following featues:

    Easily minimizable … more

  • InvokeIfRequired template

    Hello everybody,

    today I want to document simple but very useful feature if you work with multiple threads in Winforms application. 

    Quite often it happens that you execute in some paralel thread long running calculations and would like time from the time notify results to UI. 

    But if you try to do this then you'll get an error that will say to you that parallel thread doesn't have permissions to some control because it didn't create such a control. So, how then update UI?

    The answer is simple, you should use method Invoke of the control. In that case everything inside of method Invoke will be executed from UI thread. 

    Needless to say that such approach is workable but to some degree … 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

  • 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