Getting started with Acumatica xRP Platform

Hi All, Sometimes I get a questions like this: How to start development with Acumatica xRP platform? How complex is it? Where we can get some guidance? So here I want to summarize all thoughts that I have about it. I would select these steps that i would recommend you to do: Ensure Pre-Requisites Get Acumatica Prepare Development Environment Learn Acumatica xRP Platform Do Development Communicate & Support Lets go though each of these steps in details under the cut. Knowledge Pre-Requisites To be able to do development you need to have a knowledge of technology and programming language used in Acumatica. This knowledge outside of Acumatica training course: Proficiency… Read more

Most Popular Acumatica DAC Attributes

Hi All, Today I want to share with you some statistics on Acumatica xRP Attributes usage across Acumatica ERP Business modules. The goal of this article is to show you a full list of attributes that you may use for customization and also give you a chance to learn some new useful attributes, that you have not seen before. This data was collected from PX.Objects.dll of Acumatica 6 and may be different from version to version. All attributes are sorted by the usage frequency, highlighted by value and grouped by colours: Fields attributes Selectors and aggregate attributes Business logic Others In the brackets you can find approximate value of how… Read more

Acumatica Test Framework

Hi All, Acumatica has a strong focus on the Platform and Development tools, that can help all our clients and partners to provide better product faster and with lower cost. One of the nice and free tool that Acumatica provides as part of platform is Acumatica Test Framework. Acumatica test Framework is a set of tools and libraries that can be used for unattended black-box testing of any product or customization that is based on Acumatica Platform right in your favorite browser. For interacting with UI controls and components Acumatica Test Framework uses Selenium Web Driver. You can read more about Selenium here. The high level diagram of Test Framework… Read more

Replacing Cache with custom class

Hi All, Today i want to share with you a good trick how you can override original PXCache object. Why you may need it? To replace base cache logic, that should not be executed in some cases. Forbid cache to read data for database in case of virtual DAC Inject required logic to the standard workflow Do not clear cache data on graph clearing Access protected method And many other things. As you may know, that when you (or system) create a new instance of a graph, it will automatically instantiate all caches for each data views that are declared. Unfortunately, because this is unattended process it is almost impossible… Read more

Generate Grid Columns Dynamically

Hi All, Today I want to show you an example how you can generate grid columns dynamically. Sometime it is really important for dynamic inquiry report, where you want to show data that may be changed due to some other configurations. To add columns dynamically you should follow this plan: Create a separate method that will generate columns. Call method create above from the graph constructor. Please not that if you put method into any event you need to make sure that you generation columns only once. Also you logic assume that columns may be changes if user select some other values on the same screen you need to make… Read more

Custom Selector Attribute

Hi All, Today I want to discuss with you a ways to define selectors and data for them. Usually you define selectors like this: [PXSelector(typeof(Search<Carrier.carrierID>))] In this case system will automatically select value from database Carrier table and show list of Carrier IDs to user. In this case you have 2 potential problems: you should have a database table, otherwise you will see an error. There is no way to dynamically change or adjust data that is returned to user You can limited configurations to control selector behavior. To solve these problem Acumatica has a Custom Selector attributes: public class CustomerPriceClassAttribute : PXCustomSelectorAttribute {     public CustomerPriceClassAttribute()         : base(typeof(ARPriceClass.priceClassID))    … Read more

Restriction Groups Architecture

Hi All, Today I want to share with you some technology information about how Acumatica Restriction groups works inside Acumatica. For each group system assign one bit in the GroupMask Database column: Group 1 – 0x8000 = 1000 0000 0000 0000 Group 2 – 0x4000 = 0100 0000 0000 0000 Group 3 – 0x2000 = 0010 0000 0000 0000 Group 4 – 0x1000 = 0001 0000 0000 0000 Group 5 – 0x0800 = 0000 1000 0000 0000 Group 6 – 0x0400 = 0000 0100 0000 0000 ….. and so on Here you can see that Acumatica numbers groups using bytes. Each group – one unique bit. To maintain correct security… Read more

PXViewDetailsButton Attribute for better navigation

Hi All, Today want to share with you one new way how you can define navigation in Acumatica version 5.3. From T200 Acumatica Framework Fundamentalist you may know that if you want to map action to any cell in the grid and show it as link you need to define LineCommand: <px:PXGridColumn DataField=”ProductID” Width=”140px” LinkCommand=”ViewProduct” /> But to be able to use it, you should define action, action handler, throw appropriate exception, hide it in data source and so on. Quite log and boring. In Acumatica 5.3 there is a PXViewDetailsButtonAttribute that can do all these things for you. [PXViewDetailsButton(typeof(Contact),typeof(Select<Contact,     Where<Contact.contactID, Equal<Current<CROpportunity.contactID>>>>))] [PXViewDetailsButton(typeof(BAccount),typeof(Select<BAccount,     Where<BAccount.ccbAccountID, Equal<Current<CROpportunity.customerID>>>>))] public PXSelectReadonly<CROpportunit> Opportunities; This attribute will… Read more

Cool ways to use PXFormula

Hi All, Acumatica platform continuously evolving and includes more and more new cool features to optimize your code and save time on development and testing. Today i want to share with you some really cool features of PXFormula attribute and how to use it to significantly simplify your cod Here I want to cover following parameters: Validate – Validate<field> Current – Current<TRecord.field> Parent – Parent<TParent.field> IsTableEmpty – IsTableEmpty<TRecord> Selector – Selector<KeyField, ForeignOperand>  Welcome in details if you need examples. Validate The Validate<field> formula will raise dependentField’s FieldVerifying event each time the RelatedField is updated. Example: public class DacClass: PX.Data.IBqlTable {     public abstract class field : IBqlField { }     public virtual int? Field { get; set; }     public abstract class dependentField : IBqlField { }      [PXFormula(typeof(Validate<field>))]     public virtual int? DependentField… Read more

Using of PXRestrictorAttribute

Hi All, Today I want to speak with you about PXRestrictorAttribute usage and examples. Lets start with PXSelector, as they are lies together. The PXSelectorAttribute attribute is required for selecting some dependent data. Also selector maintain consistency and checks that referred data exists and meets required conditions. However from development stand point it has two major drawbacks: It gives the uninformative message <object_name> cannot be found in the system if a record with a given key does not meet the selector condition. When you change other fields of the object, the selector incorrectly gives the same message if the object referenced by the selector has changed and no longer meets the condition… Read more

Passing parameters from UI to PXSelectorAttribute

Hi All, Today I want to speak with you about passing UI parameters to the server code and PXSelector attribute. Lets assume that you have some document (like AR Invoice), where you have 2 keys: document type and document number. If you want to add reference to the this document for other screen (like payment), you need to have 2 selectors, that are depend on each other. In this example we have a selector that depend on MultiPaymentInvoice.invoiceType. But how to correctly define this dependency. Here I want to describe 3 ways to archive it: Current Parameter with Sync Position Current Parameter with SyncGrid Paramenter Optional Parameter with Control Parameter Lets… Read more

Sub-Menus for Action

Hi All, Today I want to share with you one cool way to organize your actions. Actually this is quite simple, you just need to add sub-actions as a menus text to the main action. MainAction.MenuAutoOpen = true; MainAction.AddMenuAction(SubAction); Code Snippet: View the code on Gist. If you want to have an action with sub-items on grid (like in my example) do not forget to hide actions on data source: <CallbackCommands> <px:PXDSCallbackCommand Name=”MainAction” DependOnGrid=”grid” Visible=”False” /> </CallbackCommands> Have a nice development!

New way to work with CustomInfo of PXLongOperation

Hi All, Today I want to share with you one change in Acumatica framework that may affects your development and customization. I will speak about PXLongOperation and Set/Get Custom Info methods. Idea of PXLongOperation is quite nice – it helps developers to automatically manage background processes as as the result save a lot of time. PXLongOperation class is designed to lunch, terminate and get the result of all processings, that takes a lot of time for some calculations. Acumatica Framework automatically creates thread, ensure its stability, catch errors (if any) and than notify end users about the result of the operation. As UI leaves separately from all server processing, you… Read more

Using PXView in DataView Delegate

Hi Everyone, Today I want to share with you one way how you can keep your code simpler. Lets assume you have some big data view declaration – PXSelect<Table, <InnerJoin, …. <AnotherJoin, … <MoreJoins, …. <Where<, …. <MoreWheres< …. SomeDataView And something like this for 10-20-30 lines of code. I’m pretty sure that you can understand what do i mean. And also this select declaration may be inside Acumatica base code and you want to customize it. Your task is to create a new data view delegate and select the same data with some additional filtering or dynamic calculations. But we cannot just create delegate and call dataview data, as… Read more

Restricting the list of fields selected from database

Hi Everyone Sometimes you need better control on how Acumatica selects data from database. And here Acumatica Framework provides you some ways to optimize data query. Using PXFieldScope you can specify what fields will be selected form database. This can save some traffic and processors time in large and extra-large statements. Also it can improve performance in case you have plenty of data, but use very few fields from the selected tables. And of course excluding of some complex sub-selects may significantly improve data selecting on SQL servers side. No RowSelecting events (e.g. from attributes) will be fired for the fields not fed into the FXFieldScope constructor. Note, that for… Read more

ScalarCount BQL Operator

Hi All, Today want to share with you one example of how you can extend Acumatica BQL operators. As an example I will take a sub-select that will calculate count of linked entities. Lets assume that we have a list of customers. Each of ours customers has some contracts. All contracts can be for different types of services. And we want to have an inquiry screen where we can show total count of each type of contract for each customer separately. Customer SaaS Contracts Perpetual Contracts ABARTENDE 1 3 BLUELINE 2 1 AVACUS 5 0 To save some performance on selects, we can use sub-selects and calculate count there. This… Read more

Sub Select For XML Attribute

Hi All, Today want to share with you one complex requirement that can be archived with Acumatica Cloud xRP platform. Let me describe scenario first. Lets assume we have customers certification system and we want to track their achievements. For each customer we have several persons (contacts) that want to do certification. Each person can choose one or several courses, depend on his knowledge, position and interest. Depend on each course person needs to complete one or more exams. For some coerces you may choose which of available exams do you want to complete (group 1 or group 2 of exams). And some of these groups are required and some… Read more

Hiding the tab from the user interface

Hi Everyone Today I want to discuss with you ways how you can control visibility of tab items in Acumatica User interfaces. You can do it in one of the following two ways: By setting a VisibleExp property on PXTabItem in ASPX page By enabling/disabling AllowSelect property of the view that serves as a DataMember of the grid that is displayed on that tab Welcome in this article if you want to see details. Method 1 – VisibleExp In this method, you directly write the conditions under which the tab should be visible in the screen’s ASPX code. <px:PXTabItem Text=”Tax Agency Settings” BindingContext=”tab”      VisibleExp=”DataControls[&quot;chkTaxAgency&quot;].Value = 1″> Note that… Read more

Dynamically changing an attribute property for a given data record

Hi Everyone, Suppose you need to change a particular property of a PXSomeAttribute residing on a Field of your data record. Way 1 A straightforward way of doing it: foreach (PXEventSubscriberAttribute attribute in cache.GetAttributes<Field>(dataRecord)) {     PXSomeAttribute someAttribute = attribute as PXSomeAttribute;     if (someAttribute != null)      {         someAttribute.Property = someValue;     } } Way 2 A less verbose / arguably more readable way of achieving the same goal with linq: cache     .GetAttributes<Field>(dataRecord)     .OfType<PXSomeAttribute>()     .ForEach(attribute => attribute.Property = someValue); Remember, that for many standard Acumatica attributes you already have standard static methods for changing attribute properties. Some existing examples: PXUIFieldAttribute.SetRequired<DAC.someField>(cache, true); PXUIFieldAttribute.SetVisible<DAC.someField>(cache, row, true); PXUIFieldAttribute.SetEnabled<DAC.someField>(cache, row, true); PXDefaultAttribute.SetPersistingCheck<DAC.someField>(cache, row, PXPersistingCheck); PXStringListAttribute.SetList<DAC.someField>(cache, row, labels, values); … And many others … Several… Read more

Debug Acumatica Code

Hi All, Today I want share with you one great way to make you development on Acumatica Platform better and faster – debug Acumatica source code. This can give you unlimited ability to: Investigate existing logic Planing and develop customization Understanding what code can be reused Analyzing issues Do performance tests Important Note: This approach works only on latest version of Acumatica ERP 5.3 Update 5 (Version number 5.30.1583) Welcome into the article, if you interesting in details. Installation First of all you need to install Acumatica with debugger tools: In general, these debugger tools are just additional PDB files that will be copied to bin folder of Acumatica web… Read more