Hide Action from Datasource

Hi All, When you new create action in the PXGraphExtensions, it is automatically getting visible in in the data-source actions bar, even if you have not customized ASPX. public class JournalEntry_Extension:PXGraphExtension<JournalEntry> {     public PXAction<PX.Objects.GL.Batch> NewAction;       [PXButton(CommitChanges = true)]     [PXUIField(DisplayName = “New Action”)]     protected void newAction()     {     } } It looks like here: But if you want to hide that button, it is very easy to do it with Customization Browser. Just drag and drop button to the data-source in page editor: Than just set the Name to your action name and Visible to false. That is all. Now Action is not visible anymore. Have a nice development!

Customization and Source Control

Hi All, I’m sure you know that Acumatica customization project is just a big XML file that has some links on external files. You can easily export ZIP archive with all linked files and store it on the file system. Unfortunately is not really good for tracking changes. But do you know that Acumatica has very easy-to-use integration with source control where you can export project as set of text files? Let me show you how to use it: As I said customization project is big zip file, but it can be split by items, that you can see using File -Edit Project Items menu: All of these items we… Read more

Override Static Method

Hi All, Unfortunately sometimes during customization you may need to override some logic in static methods and that is really bad task, as it requires to copy a lot of code. Here I will show you few examples that can give you idea how you can fix it. In general there is no way to really override static method, the only one way how you can replace it’s logic is just define a new one and replace all places where it is called. 3 different scenarios will be based on Acumatica Fixed Assets module: Not so good – static method on event AssetMaint.LiveUpdateMaskedSubs(PXGraph graph, PXCache facache, FALocationHistory lochist); Bad –… Read more

Conditionally Activate Extensions

Hi All, Today I want to share with the way how you can enable and disable extensions dynamically. You know that when you have published extension as a DLL or a Code file it will be automatically discovered by Acumatica Framework and used. However there is a hidden way to stop Acumatica from usage of that extension. Do do that you just need add static method IsActive() to your extension. public class GL_Batch_Ext : PXCacheExtension<PX.Objects.GL.Batch>   {           public static bool IsActive()       {         return false;       }   } Acumatica will automatically call that method by signature (you need to have correct name, public, static and return bool) and if it returns… Read more

Approval Workflow Customization

Hi Everyone, Today I want to share with you one important point about customization of automation approval workflow. Firs of all please read this article on Stack Overflow to understand how Acumatica Approval works. But here I would take Purchase Orders screen as example, because there we already have automation workflow configured. In the article below, you may notices that all approval logic is encapsulated into the special Data View – EPApprovalAutomation. On the Purchase Orders form it is designed like this: [PXViewName(Messages.Approval)] public EPApprovalAutomation<POOrder, POOrder.approved, POOrder.rejected, POOrder.hold, POSetupApproval> Approval; EPApprovalAutomation is just a class with multiple virtual methods that you can override and customize. So we can create our own approval… Read more

Append and Replace of DACs Attributes

Hi Everyone. Today want so share with you some ideas on how you can append, replace or merge attributes on standard Acumatica’s data access classes. Acumatica Framework attributes are used to add common business logic to the application components. Attributes implement business logic by subscribing to events. Each attribute class directly or indirectly derives from the PXEventSubscriberAttribute class. B Most attributes are added to data access class (DAC) field declarations. There are also attributes that are placed on a DAC declaration, view declarations in a business logic controller (BLC), and the BLC declaration itself. In general there are 4 places where you can define attributes: DAC attributes DAC fields. You… Read more

Enabling Upload from Excel for the Grid

Hi All, Today I want to share with you a way how to enable upload form excel for custom grid. Actually this is quite simple – Step 1 – define PXImportAttribute on data the data view under the grid. public class CSCalendarMaint : PXGraph<CSCalendarMaint, CSCalendar> { …        [PXImport]        public PXSelect<CSCalendarExceptions> CSCalendarExceptions; … } Step 2 – enable appropriate Grid Mode (Allow Upload) on the grid properties. This will enable upload button on the grid action bar with standard functionality. In some cases, you may want to have more control on the import process. In this case you also may implement optional interface: IPXPrepareItems. This interface should be implemented on… Read more

Using Colors in Acumatica

Hi All, Today I want to share with one way how you can highlight some Acumatica rows or data with colors or other text styles. Disclaimer: Please note that this way does not follows the standard customization way, so any changes may be not supported in future versions of Acumatica. Also it might be very complex to support this customization during Acumatica upgrades. Before we can change colors, first of all we need to do understand how Acumatica applies styles. Acumatica uses Cascade Style Sheets (CSS). All elements (Forms, Grids, Row, Fields, Buttons, …) are associated with one or many styles. All styles are defined in Acumatica folder itself You… Read more

Custom Formula for ACH/GIRO Providers

Hi All, In the previous article about custom payment providers i have mentioned that Schema file supports several build-in formulas, like: Count – Count of details or nested groups in group TotalCount –  Total lines in all nested groups BlockCount – Count of internal blocks including adjustments for fixed structure CountOneBased –  CountField  + 1. Required if you need calculate header or footer with details TotalCountOneBased – TotalCountField +1. Required if you need calculate header or footer with details You also can add more formulas there. For example if you want to have Count that will calculate header and footer together with details you may need TotalCountTwoBased formula. Please check this code… Read more

Client Events using JavaScript

Hi All, Today I want to share with you one way how you can add some client validations/calculation using JavaScript right in the browser with no accessing server data. In general i would suggest you to not do any complex calculations on client side and always use server for all data manipulations. However in some specific situations this approach may save a lot of processing time because client events may do calculations right in the browser. Also note that client logic will be available only for browser users and will not be triggered from web services API and Mobile application. The scenario that i want to do is quite simple… Read more

Site Configuration using Customization

Hi All, Acumatica as most of web applications has some configurations that are stored on the file system. For example it can be a web.config or any other file that is stored in Site folder itself. During upgrade procedure Acumatica overrides all standard files to ensure that system will work correctly with all latest platform changes correctly. This is correct, as any automatic merge of configurations can cause to compilation errors. This is especially harmful if you site is in public cloud and you have no access to the instance. So that means if you do custom configuration (like redirection rules, filters or custom controls) your changes most probably will… Read more

Alter GL Transaction during Inventory Release

Hi All Today I want to share with you one of possible ways how you can catch the process how Inventory release created a GL Batch and GL Transactions. Lets assume that we want to change description or Sub-Account during inventory receipt release, than i need to do following things: Create extension of INReleaseProcess, that is responsible for release operation. Override ReleaseDocProc, that is doing main release job. In this method we have links to JournalEntry and INRegister, where we can check what is going on and add some additional logic Add RowInserting event to JournalEntry that will handle creation of batch or tran Change description or sub-account where it is required In the… Read more

Encrypted batch payment file (ACH, GIRO)

Hi All, In Acumatica you can easily generate electronic payment files (such as ACH, GIRO and others). By using this process you will have a file that will have payment amounts and other required information. But what about data protection? Bu default payment file will have clear text amounts. Today i want to share with you how you can easily encrypt this file. Payment file will be generated by Acumatica Integration Services Export Scenario. The main class that is responsible for generation file is Integration Services Data Provider. In Acumatica out of the box we have only 2 providers : ACH and GIRO. In my Example i will show you… 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

Provide Default Value for Report Parameter from Branch

Hi All, Really often you may want to have some default values for report parameters, that may depend on environment. For example different default warehouse depend on branch where are you working now. Or different warehouse depend on current employee. But unfortunately it is not out of the box functionality in Acumatica. Luckily, using powerful Acumatica Customization engine it is quite easy to do. Let me share with you a way to archive it. Scenario: lets assume that we want to have different default warehouse on Inventory Valuation report based on different branch that is selected as current. We will do this task in 3 steps: Adding custom field to… 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

Make compilation of extension library faster

Hi All, When you develop customization using Microsoft Visual Studio you may notice that compilation process (if you click F6 or Ctrl+Shift+B) is really long – you may wait for 5-10 minutes. Usually this happens because system compiles full solution that contains DLL and also Web Site. Site has multiple pages that have aspx markup and must be transformed before compilation. But actually this process is required only for validation purpose and does not require for Acumatica functionality, as ASP.NET will compile page any way one more time when you open it in browser. You may read more about it here. So as it is optional compilation you may guess… Read more

Custom Integration Services Data Provider

Hi All, Today I want to share with you one way how you can extend Acumatica data export/import providers or add a new one to integrate with new system. To accomplish this task you need some development skills as creation of new provider require some code writing. But you can write this code with any possible way: Visual Studio Acumatica Customization browser Notepad or any compatible application To create a new provider you need create new class that will implement a IPXSYProvider interface: public interface IPXSYProvider {        string ProviderName { get; }        string DefaultFileExtension { get; }        //Parameters        PXSYParameter[] GetParameters();        void SetParameters(PXSYParameter[] parameters);        PXStringState[] GetParametersDefenition(); … 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