Contents tagged with PXDatabase Update with params

  • 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