Archives

Archives / 2019 / November
  • LastModifiedDateTime has wrong datetime information

    Hello everybody,

    today I want to share interesting use case which raised recently when dealt with syncrhonization of records between Magento and Acumatica.

    I had following declaration:

    #region LastModifiedDateTime

    [PXDBDateAndTime()]

    [PXUIField(DisplayName = "Last Modified Date Time")]

    public virtual DateTime? LastModifiedDateTime { get; set; }

    public abstract class lastModifiedDateTime : PX.Data.BQL.BqlDateTime.Field<lastModifiedDateTime> { }

    #endregion

    and for my disappointment as well as disappointment of Magento developers we had to add some hours shift to each call, in order to filter out properly by Last modified Date time.

    One of the solutions was to add one more flag to … more

  • New SQL Server 2016 features to use in Acumatica

    Hello everybody,

    today I want to write about new additions for SQL Server T-SQL language, which are there starting from 2016. It is create or alter syntax.

    In the past, if you've made some custom SQL view, it was needed to have constructions like this ( pseudo code ):

    if view ( stored procedure, function, trigger ) exists

         create view ( stored procedure, function, trigger )

    else

       alter view ( stored procedure, function, trigger )

    But startring from 2016 SP1 you can use following syntax ( pseudo code ):

    Create or alter view ( stored procedure, function, trigger ).

    Or in code form it may look like this:

    create or alter procedure yourProcedure

    as

    begin

     print (1)

    end;

    go … more

  • SelectFrom for usage in View.Select

    Hello everybody,

    I want to leave a short note on how to use SelectFrom for legacy code, and pass it in View.Select for Acumatica newer versions. 

    var cmd = new SelectFrom<PartsCatalog>.

        InnerJoin<INSiteStatus>.On<Use<PartsCatalog.inventoryID>.AsInt.IsEqual<Use<INSiteStatus.inventoryID>.AsInt>>.View(this);

    var s = (currentFilter.PageNbr ?? 0) * (currentFilter.PageSize ?? 0);

    int startRow = s > 0 ? s : PXView.StartRow;

    int totalRows = 0;

    int maxRows = (currentFilter.PageSize ?? 0) == 0 ? PXView.MaximumRows : currentFilter.PageSize ?? 0;

    var list = cmd.View.Select(new[] { currentFilter }, null, PXView.Searches,

        PXView.SortColumns, PXView.Descendings, PXView.Filters, ref  … more