Contents tagged with Acumatica

  • Pagination in custom inquiry

    Hello everybody,

    today I want to share with everybody, and with myself code fragment, that allows to achieve pagination in custom inquiry pages. 

    Take a look on the code below:

      public class YourGraphInquiry : PXGraph<YourGraphInquiry>

      {

        public PXCancel<YourDACFilter> Cancel;

            public PXFilter<YourDACFilter> Filter;

            [PXFilterable]

            public PXSelect<YourDACDetails,

                Where2<

                    Where<YourDACDetails.Someid, Equal<Current<YourDACFilter.SomeID>>, 

                        Or<Current<YourDACFilter.SomeID>, IsNull>>,

                    And<

                        Where<YourDACDetails.Somepartid, Equal<Current<YourDACFilter.SomePartId>>, 

         … more

  • Three states of fields in Acumatica

    Hello everybody,

    today I want to write a short note on three states of fields existing in Acumatica:

    Exists but is empty

    Exist and have value

    Has null

    If to speak about string, it can exist like this:

     

    Some value

     

    Do you see difference between 1 and 3? Not easy. As usually developers of C#, show this difference like this:

    ""

    "Some Value"

    null

    And following screenshot with explanation shows how it works in case of SOAP contracts:

    so, while you make integration, keep that in mind more

  • New functions for redirect in Acumatica

    Hello everybody,

    today I want to say few words about new functions for redirect in Acumatica, and particularly about class PXRedirectHelper. 

    Classical approach from T200/T300 manual may look like this:

    var currentCse = Cases.Current;

    if(currentCse == null)

    return;

    var graph = PXGraph.CreateInstance<CRCaseMaint>();

    graph.Case.Current = graph.Case.Search<CRCase.caseCD>(currentCse.CaseCD);

    if (graph.Case.Current != null)

    {

    throw new PXRedirectRequiredException(graph, true, "Case details");

    }

    But with new function all of those lines can be simplified to this:

    PXRedirectHelper.TryRedirect(Cases.Cache, Cases.Current, "Edit case", PXRedirectHelper.WindowMode.NewWindow); … more

  • Simplest cachinng explanation

    Hello everybody,

    today I want to give one more explanation of how to use caching and slots for caching purposes. Also there are plenty of articles on the subject,  I want to give one more with simplest recipe. So, if you need to cache something, you'll need to follow this procedure:

    declare you class as something that inherits IPrefetchable

    Create some placeholder in your class for storing items in the cache

    Implement Prefetch

    Implement GetSlot

    Take a look on the code below, how it can be done:

    public class ArTranFetcher : IPrefetchable

    {

    private List<ARTran> _arTranList = new List<ARTran>();

    public void Prefetch()

    {

    _configurableList = new List<ARTran>(); … more

  • Acumatica Page Missing under Google Chrome Browser

    Hello everybody,This one is a hot topic, recently chrome team released some changes to the Chrome Browser, so that some PAGES could get missing.You still see Menu, still see screen list but the page itself is gone, blank, empty.How to fix?Just change settings in the Chrome:1. Type chrome://flags/ in the browser address bar and press Enter.

    2. You should see the list of options:

    3. In the search bar type Lazy Frame or just Lazy:

    4. Under Enable lazy frame loading choose Disabled:

    5. Press Relaunch Now at the right bottom corner:

    more

  • Four types of programmers

    Hi.It is first time I write on topic of management and recruitment. Question is about one way of classifying your programmers, who work with you now or will come in a future. My main thesis is: all developers, roughly speaking, are divided into 4 large types and each of these types has its own application area.Attempting to send the wrong type to solve inappropriate tasks leads to a failure ( inefficient work, or the employee leaves the team ). If you want to know why, you are welcome. Get ready, we have a lot of information. Basicallly what I say is my perception of world of programmers.

    It is important to understand that there are no "bad" types. If any of the types you think is bad, … more

  • How to modify activities behavior on Business Accounts page

    Hello everybody,

    today I want to write a few words on how to modify behavior of buttons Add task, Add event, Add email, Add activity, ..., Add work item of Business Accounts page, one of which is shown on screenshot below:

    The main issue of chaning it is in the fact, that it is not just ordinary buttons, but separate class, which has injection of logic. Part of it's declaration goes below:

    public class CRActivityList<TPrimaryView> : CRActivityListBase<TPrimaryView, CRPMTimeActivity>

      where TPrimaryView : class, IBqlTable, new()

    {

      public CRActivityList(PXGraph graph)

        : base(graph)

      {

      }

      public CRActivityList(PXGraph graph, Delegate handler)

        : base(graph,  … more

  • How to deal with PX.Data.PXException: Cannot access the uploaded file. Failed to get the latest revision of the file error message

    Hello everybody,

    today I want describe how to deal with following Acumaitca error message: 

    Publish Customization

    Compiled projects: GAPRojectsBusinessAccounts,PayrollV2Acu2018Build20190328,EBizCharge2018R2,GACustomization

    Validation started.

    PX.Data.PXException: Cannot access the uploaded file. Failed to get the latest revision of the file a4353331-8f7f-4b3b-a881-2cdb4d5451e3

    at Customization.CstBinFile.GetFileFromDb() in C:\Bld\AC-FULL2018R226-JOB1\Sources\NetTools\PX.Web.Customization\CstDocumentDOM\CstBinFile.cs:line 120

    at Customization.CstBinFile.SaveFiles(FilesCollection context) in C:\Bld\AC-FULL2018R226-JOB1\Sources\NetTools\PX.Web.Customization\CstDocumentDOM\ … more

  • DashboardPageTitleModule does not implement interface member PX.Web.UI.ITitleModule.GetDefaultVisibility in Acumatica

    Hello everybody,

    today I want to describe how to live with following error message:

    Compilation Error

    Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately. Compiler Error Message: CS0535: 'DashboardPageTitleModule' does not implement interface member 'PX.Web.UI.ITitleModule.GetDefaultVisibility()'Source Error:

    Line 2: using PX.Web.UI;

    Line 3:

    Line 4: public class DashboardPageTitleModule : ITitleModule

    Line 5: {

    Line 6: public void Initialize(ITitleModuleController controller)

    Source File: c:\Program Files\ … more

  • Merge few customizations into one

    Hello everybody,

    today I want to leave a short notice on how to join few customizations into one. Basically all you need is publish customizations you want to have merged, and then on Customization Projects form ( SM204500 ) click on button View Published and then click on Download package. In that way you'll get Customization.zip which will be merged result of published customizations. more

  • How to modify PXIntList dynamically in Acumatica

    Hello everybody,

    today I want to leave a short code sample on how to modify PXIntList or dropdown list in Acumatica. Below goes code sample of it:

    protected virtual void _(Events.RowSelected<CROpportunity> e)

    {

        if (e.Row == null)

            return;

        var opportunityExtension = e.Row.GetExtension<CROpportunityExt>();

        if (opportunityExtension.UsrProduct == 0)

        {

            var listInts = new List<int>();

            var listStrings = new List<String>();

            listInts.Add(0);

            listInts.Add(1);

            listInts.Add(2);

            listStrings.Add("String 1");

            listStrings.Add("String 2");

            listStrings.Add("String 3");

             … more

  • Creating the new Company, set settings for it from snapshot

    Hello everybody,today I want share with you, how you can create new Company and set it settings.

    For creating new company, we should go to "Tenants" screen:

    Notice, that in old vercions of acumatica instead the "Tenants" was the "Companies":

    Let create new company, and give it name "Exotic Places":

    When process of creation is finished, we'll automatically be logged out:

     

    To fix this, let's copy the settings from existing company to our. First of all let us sign out from "Exotic Places" and sign in to "Company". Then open "Tenants", chose the "Company" and click to "Create Snapshot" button:

    We get a warning message, but it possible easily deal with it, only go … more

  • Warning: you are not in maintenance mode

    Hello everybody,

    today I want to make a post about new security feature of acumatica, which guard you from creating corrupted data. Suppose you are System Administrator and want to make snapshot for being able use it to set settings to new company, which you just created. However, some user might use it too, and this may cause the creation of bad records. For this reason, in latest versions of Acumatica (from 2017 R2), when you try to create snapshot, you'll recieve an warning message: 

    Warning message informs, that you should switching the maintenance mode, so do it, as shown below, by click "SCHEDULE LOCKOUT":

     

    Now you able, without any risk, create snapshot:

    On the end, … more

  • FBQL brackets

    Hello everybody,

    today I want to speak about one very interesting feature of FBQL, which I don't know if exists in BQL. Function Brackets!

    Take a look on following code sample:

    var bracketsDemo = SelectFrom<SOOrder>.InnerJoin<SOLine>.On<SOLine.orderNbr.IsEqual<SOOrder.orderNbr>>.InnerJoin<SOShipLine>

    .On<SOShipLine.origOrderNbr.IsEqual<SOOrder.orderNbr>>.Where<

    Brackets<SOShipLine.confirmed.IsNotNull.

    And<SOShipLine.baseOrigOrderQty.IsNotNull>.

    And<SOShipLine.completeQtyMin.IsNotNull>.

    And<SOShipLine.confirmed.IsEqual<True>.

    Or<SOShipLine.confirmed.IsNull>>.

    And<SOShipLine.baseOriginalShippedQty.IsGreater<SOShipLine.unassignedQty>.

    Or<SOShipLine. … more

  • 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