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

Publish customization through Web Services API

HI All, Today I want to share with you one new cool feature in latest 5.3 update of Acumatica. You may know that Acumatica has a special type of Web Services API –  Service Endpoint. This API is designed to work with Reports and Report Designer. In genera Report designer is a standalone win form application that communicates with acumatica using web services API. Also this API contains some really old ways of integration that are here just for compatibility purposes. URL for this services API is: https://<instance>/api/servicegate.asmx But starting from version 5.30.2126 it also can work with customization packages. Newly available methods: UploadPackage – helps you yo upload zip package to acumatica… 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!

Hidden file revisions clearing action in Acumatica

Hi All, Today I want to show you one one trick that can help you to purge revisions history of all files in Acumatica and keep database lighter. Acumatica has a hidden button, that can go through all files in the system and check revisions. If date of revision is older that specified one, Acumatica will delete all revisions except the latest one. By default this function is hidden for security reasons, so if you want to enable it be really careful and restrict assess rights from all uses except system administrator. Ok, to enable this hidden function, you should use Acumatica customization tools for screen “Search In Files” (SM202520).… Read more

Export notes to excel from the grid

Hi All, Today want to share with you simple trick. Starting from version 5.2 Acumatica does not export notes to the excel file from the grid by default. This was done for performance optimizations. So if you go to Journal Transactions and export data, you will see something like this: But fortunately it can be easily changed by using Acumatica customization engine. Just click Customization->Inspect element and then click on the grid, than click customize. Customize button will open additional window where you can specify some configurations for the grid and other elements. We need just one – Export Notes. Set property to “True” and than you can publish customization… 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

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

Install Customized Package on Acumatica

Hi All, Acumatica is growing rapidly over the past several years. We are opening new offices in new countries and going to new markets. But some countries requires some specific adaptation. In general can be – language localization, government required reports, country specific taxes and so on. But as you may see, these functionality is required only for the specific markets, other users do not want to see not related reports and features. So we have decided to add it as a official customization to the standard product. Everyone who requires it can download and install package from Acumatica or request it from your contact person in Acumatica. I’m pretty… 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

Running Automaton Button from code

Hi All, Here I want to share one example of customization. We want to trigger a button that is defined as Automation action from code. The problem here is that the button is not defined in the code, so we need to trigger it the same way how UI does it. To do this we have do several tricks: Define a new custom PXView that will return record that we want to process Create an adapter, that will provide data for button handler. Adapter will get data from custom PXview. Create a separate instance of graph, that will handle action. Code example with comments: View the code on Gist. Big… Read more

Extend/Change Field Size

Hi Everyone, Today I want to show you how easy to change the size of control in Acumatica. Let assume that we have some field with big value. It is not very convenient for us to scroll value every time, so we want to change it. Let do it with several simple steps. But here we need to include customization. Create a new customization project using customization menu. Inspect element using customization menu. >On the popup window use customization button. In the customization browser find required field and specify size. In my case size should be bigger, so I set “SM” value. Save changes and publish customization project. Check and… Read more

Multiselect Combo Box

Hi All, Today I want to discuss with you one short topic – how to implement Combo box with multiple options for select. As an example I want to use scenario when we need to have a department associated with each particular customer. We have fixed and predefined number of departments so we do not want to configure them. Plus each customer can be associated with multiple departments, so we need to have a multiple options simultaneously. Based on provided requirements, we can find that Combo Box (Drop Down control) is the best option here. To do this I will use Acumatica customization engine. Lets go there and do it… Read more

Development Tools in Acumatica

Hi Everyone, Today I want to speak about tools and application that Acumatica team uses during development. Development Microsoft Visual Studio 2012+ ReSharper from JetBrains for faster development Databases and SQL Microsoft Sql Server Express + Microsoft Sql Server Management Studio Microsoft Sql Server Profiler My Sql + SQLyog MySQL GUI for MySQL Apex SQL Refactor – SQL Formating Tool Performance DotTrace from JetBrains for performance testing Memory .Net Memory Profil for memory analysing Windbg for deep process dump analysing Sources Git + Stash for sours control and analysing SourseTree + GitExtension as GUI tools for Git. Documentation and Tracking Jira for bugs tracking Confluence for specification, features and documents traking Mockups and Flow WireFrameSketcher… Read more

How to Debug Customization Code

Hi Everyone, Today I want to discuss how can you debug customization code that has been added from the user interface. The general plan is to move your code to from customization manager to Extension Library, than open in in visual studio and debug. 1) Select code that you need to debug. 2) Create Extension Library. 3) Move your code to Extension library 4) Open extension Library in Visual Studio 5) Find your code in Solution Explorer and put Breakpoint where you need it. 6) Use button “Attach to process” and select all w3wp.exe processes. 7) Click Attach 8) Use browser to trigger your code. Than system will automatically hit breakpoint and… Read more

Custom Snapshots Configuration

Hi Everyone, As you know Acumatica supports Snapshot functionality to copy, migrate, backup and restore data between one or multiple instance of Acumatica. Using snapshots you even can migrate data between different database types (Cloud, Microsoft Sql Serve, MySql). You can get more about snapshots from this video – Acumatica Snapshot on YouTube When you creating snapshot, system will go through all database tables, select appropriate data and put it into separate tenant (with negative tenant id, which is actually linked to original tenant by id number). You can define what data will selected from the database, by defining Export mode: Snapshots is database level technology that knows nothing about business logic and… Read more