Archives

Archives / 2014 / October
  • Acumatica Cache inserted updated objects

    Hello everybody,

    today I want to share one simple technic of how to filter inserted items in cache from other objects. I discovered it with reflector, while diffing in code of APInvoiceEntry. 

    Here it is: 

    Adjustments.Cache.Inserted - this item will give you which items were inserted in view Adjustments. 

    Another interesting details was updated:

    Adjustments.Cache.Updated

    will give you updated items in cache.

    And of course deleted: 

    Adjustments.Cache.Deleted more

  • SetValueExt and SetDefaultExt in Acumatica

    Hello everybody,

    today I want to share with you information about two functions:

    SetValueExt and SetDefaultExt. 

    Names of them are pretty self-explanatory, which means SetValueExt assigns specific value to field and SeDefaultExt assings default value to a field. But SetValueExt  method raises the field-level events for the data field as when a data record is updated. The SetDefaultExt<>()method of the cache to assign the default value a field. The method raises the field-level events for the data field as when a data record is inserted. more

  • PXDataBase.Update in Acumatica

    Hello everybody,

    today I want to note how to use PXDataBase.Update in Acumatica. 

    Two use-cases.

    1. Imagine, you need to set APSubID = 80 in APRegister with APAccountID = 5:

    you can use the following:

    PXDatabase.Update<APRegister>(new PXDataFieldAssign<APRegister.aPSubID>(80),

    new PXDataFieldRestrict<APRegister.aPAccountID>(5),

    new PXDataFieldRestrict("DeletedDatabaseRecord", PXDbType.Bit, false));

    2. Set DocBal = 80 and DocDesc = “blah blah blah”  in table APRegister with APAccountID = 5 and APSubID = 80:

    PXDatabase.Update<APRegister>(new PXDataFieldAssign<APRegister.docBal>(80),

    new PXDataFieldAssign<APRegister.docDesc>("blah blah blah"),

    new PXDataFieldRestrict<APRegister. … more