Blog

Here I document some issues for searching of which I spent more then 15 minutes

  • Master-Detail relationship in Acumatica

    Hello everybody,

    today I want to make a post about Master-Detail relationship between DAC classes in Acumatica. Maybe you already familiar with C# and SQL and know this theme.  But how acomplish this in  Acumatica? Lets consider. 

    Suppose that we have table in our database with students. In another table we store detail data about them. First table has name "Student", second - "StudentDetail".

    First of all, let we set up master-detail relationship between the Student and StudentDetail data access classes. For this we need to add PXDBDefault attribute to the StudentDetail.FirstName and for StudentDetail.LastName fields:

    #region FirstName

           public abstract class firstName :  … more

  • Adding report page to customization

    Hello everybody,

    today I want to make post on how to add your report page (.rpx) to customization, so than you will be able to use it in another progect.

    For this purpose open customization window as showed below and click "Reports" button:

    Then click on plus and select report you want to change:

    The name of your report page you can find, when run report from acumatica page in browser:

    If you will follow those steps, you'll be able to add report to customization:

    But this works only if your report is available in database.

    Suppose your report is saved only in file, in ReportsDefault folder of your site. Then you should save it also to database.

    For achieving … more

  • How to pass data into processing method with help of lambda expression

    Hello everybody,

    today I want to leave a short note on how to pass some additional parameters into Processing method of processing page with help of lambda expression. Syntax is pretty simple:

    public class SSShipmentDateResetter : PXGraph<SSShipmentDateResetter>

    {

    public PXFilter<ShipmentFilter> ShipmentFilter;

    public PXFilteredProcessing<SOShipment, ShipmentFilter> ShipmentsForProcessing;

    public SSShipmentDateResetter()

    {

    var shipmentFilter = ShipmentFilter.Current;

    ShipmentsForProcessing.SetProcessDelegate(shipments =>

    {

    ResetDate(shipmentFilter, shipments);

    });

    }

    public static void ResetDate(ShipmentFilter filter,  List<SOShipment> shipments)

    { … more

  • How to work with unbounded DAC in Acumatica

    Hi everybody,

    today I want to leave a short note on how to deal with Unbounded DAC classes in Acumatica. Unbounded in other words means DACs that doesn't have dirrect persising target in database.

    For Unbounded DAC classes to work like this, two steps are needed:

    Add attribue [PXVirtualDAC] to PXSelect or PXSelect.....

    Add attribute PXVirtual over your DAC class declaration

    With those two details you'll have complete independence of your classes from Database. more

  • How to restore snapshot of Acumatica

    Hello everybody,

    today I want to leave a post on how to restore Acumatica snapshots with help of Acumatica Wizard.

    Before creating snapshot you may need to switch Acumatica to maintenance mode. Below are the steps for achieveing it:

    1. Go to System --> Management --> Apply Updates, click on the button "Schedule Lockout" and specify the reason for lockout 2. Don't forget to remove the lockout after you'll restore Snapshot.

    Steps are the following:

    1. Create a snapshot of the tenant you wish to back up

    2. Export that snapshot (I recoment  xml format).

    3. In the folder where the corresponding Acumatica Wizard is installed (usually c:\program files\Acumatica ERP\), find the folder … more

  • How to enable some control in Acumatica

    Hello everybody,

    today I want to leave a short note for the following situation:

    Imagine that you need to enable some control in Acumatica ( for example Mark for PO ) on page Sales orders ( SO301000 ).

    As usually for enabling control there are two ways:

    RowSelected

    Automation steps.

    Recently I found third option, when neither 1 nor 2 did work. After spending some time I found third option: Cache has property AllowUpdate. After I've set it to true, I was able to modify lines in Document details. 

    In your code it may look like this:

    protected void SOLine_RowSelected(PXCache cache, PXRowSelectedEventArgs e, PXRowSelected del)

    {

            if (del != null)

                  del(cache, e) … more

  • New syntax of SetVisibility method in Acumatica

    Hello everybody,

    today I want to write a few words about changes of PXUIFieldAttribute.SetVisibility method. 

    In the past, if you wanted to turn on some column, you could write in RowSelected event something like this:

              PXUIFieldAttribute.SetVisibility<APRegister.finPeriodID>(Documents.Cache, null, true);

    If you want to turn it off, then this:

    PXUIFieldAttribute.SetVisibility<APRegister.finPeriodID>(Documents.Cache, null, false);

    But for quite a long time ( even in 2017 version ), Acumatica team introduced PXUIVisibility enum. In code it looks like this:

    [Flags]

    public enum PXUIVisibility

    {

      Undefined = 0,

      Invisible = 1,

      Visible = 3,

      SelectorVisible = 7,

       … more

  • How to change all emails in Acumatica

    Hello everybody,

    today I want to leave a post on how to change all emails, which are contained in Acumatica. For this purpose you may use script below:

    UPDATE contact SET    email = email + '.ts' UPDATE socontact SET    email = email + '.ts' UPDATE apcontact SET    email = email + '.ts' UPDATE pocontact SET    email = email + '.ts' UPDATE crcontact SET    email = email + '.ts' UPDATE arcontact SET    email = email + '.ts' UPDATE fscontact SET    email = email + '.ts' UPDATE crcasecontacts SET    email = email + '.ts' UPDATE crcontact SET    email = email + '.ts' UPDATE pmcontact SET    email = email + '.ts' 

    If you wonder, what can be the usage of such SQL, consider following … more

  • Required of BQL in FBQL of Acumatica

    Hello everybody,

    today I want to describe how analogue to Required works in Acumatica Framework.

    For example, in the past ( before 2019 R1 ) you may read something from Acumatica with help of Required:

    var contact = PXSelect<Contact, Where<Contact.displayName, IsNotNull, And<Contact.displayName,  Contains<Required<Contact.displayName>>>>>.SelectWindowed(graph, startIdx, 1, ' ').First();

    Now, you can use @P.AsString, as shown on code sample below:

    var contact = SelectFrom<Contact>.Where<Contact.displayName.IsNotNull.And<Contact.displayName. Contains<@P.AsString>>>.View.SelectWindowed(graph, startIdx, 1, ' ').First();

    Conclusion

    Also take a note, that … more

  • Different methods of PXInstanceHelper class in Acumatica

    Hello everybody,

    today I want to document one important class in Acumatica: PXInstanceHelper.

    I have found it long time ago, but finally time arrived to show how it works and what features it has. So, PXInstanceHelper include such methods:

    Method AppDataFolder.

    In code it looks like this:

    var result = PXInstanceHelper.AppDataFolder;

    Screenshot of it's execution may give you additional hint of what it does:

    This method returns physical path to folder App_Data inside of Acumatica instance. As you can see from the screenshot, on my dev machine App_Data folder lives at

    C:\Program Files\AcumaticaERP\InstanceHelperDB\App_Data

    2. Method CurrentCompany.

    In code looks like this: … more

General information

Greetings to everybody stopping at my blog. Purpose of this web site is to be google of my brain. Everything I found useful, or of possible beneficial for usage in future I've save here at this blog

Contact information

If you want to contact me more on any subject printed at this web stie, you can email me: zaljur1989(at)gmail.com

Job information

If to speak in general, I'm developer. For now I work as team lead in company GlobalLogic.