Maximize Selector Drop-Down with JavaScript

Hi Everyone, Some time ago I had a question – is it possible to automatically maximize (expand) selector window when we opens it. Out of my research I know now that there is no settings for that in the selector configurations but this is very possible with Javascript. And following another example of Javascript in Acumatica I want to share this example with you. First thing we need to do is to add a Javascript control to Acumatica grid where you are planning to expand selector. Than we just add the Javascript method that finds the selector panel from passed parameters and calls it’s method to expand Now we need… Read more

Implement PXTransactionScope

Sometimes, part of your coding requires you to revert any transactions that were processed in the middle of a transaction. Acumatica Framework has the function to cope with that. That is using the PXTransactionScope(); As mentioned also in the Blog before by Sergey Marenich (ctrl + click to follow link : https://asiablog.acumatica.com/2015/11/using-scopes-in-acumatica.html) PXTransactionScope– this scope will initialize new transaction, so you can wrap-up some changes into transaction, when system will revert all changes together on any exception. Do not forget to call commit for the transaction scope before dispose it. Sample code snippet below is one of the many ways you can implement the PXTransactionScope. You must call the method ts.Complete(); to… Read more

Run report with Side Panel

Hi everyone, Since version 2018R2, Acumatica has released feature call Side Panel on generic inquiry screen. It is a great feature to enhance the usability. In case that you have missed it, you can also check released notes here and configuration here. With side panel now, you can help user work more effectively by avoiding to many navigation. In one screen, you can do a lot of things for instance: view details of record or linked object, review dashboard, report, etc … Today I would like to share about the configuration. It can help user who need to work with some report or printed form can access it easier. Let… Read more

Calculating Grid Totals on an Inquiry Form

One of the common requirements that one may have for the inquiry form is to have Totals calculated for some column in the grid. It may seem a simple task, but there are some unexpected obstacles that make it hard to implement the feature properly. Straightforward Solution We can implement the requirement with the help of a filter delegate. Assume that we have the filter view and the grid view. Add a field for accumulated result to the filter DAC. In the filter delegate get records from the grid view. For example: This code works, but it has several issues: It does not consider user defined filter for the grid Filter… Read more

Saving Entry from Custom Button

Hey! It’s a pretty common situation when you need to call the Save action from your button. You could use it in graph extension or directly in the base graph. We will use the extension as the example but the code almost the same for the pure graph. There are two requirements: A button should use the IEnumerable version of the method, not void. A method without the return brokes navigation after saving. A user could get blanked screen when saving a new document. A method should be decorated with PXButton attribute with CommitChanges = true property, otherwise, the Save button could stay in enabled status after saving. Not tested with CommitChanges in… Read more

Open a Report in Acumatica

Hi All, Following a previous post about redirection architecture I want to show you an example of how can you use it to open a report. Here we need to use PXReportRequiredException, as it designed to open reports. But also we need to provide a report name and report parameters. Report Name is just a Screen ID that you can find in the sitemap Report Parameters is a Dictionary<string, string> that is basically a key-value pair. Key is a parameter name and value is a value. Parameter names are taken directly from the report. Here is the example code to create a button for report. I get this code from… Read more

Non-Programming Customization with Automation Step

Hi all, As you many know about this ” Some Acumatica ERP functionality is implemented through automation steps, which are steps to be executed on an Acumatica ERP form for specific records or objects generated in the system, depending on the properties of the record or object. For a data entry Acumatica ERP form, you can create any number of automation steps that redefine the functionality of toolbar actions, add values to combo box lists, or provide default values for the form elements, based on the properties of the records under processing. ” – Help Document Today I would like to share with you about the ability to do customization with… Read more

Access Restrictions by Workgroups

Hi All, Today I want to share with you a quite advanced customization that can significantly enhance your data security. Lets start with business task first: Customer want to limit visibility of certain documents and entities between different users and group of users: Users should see the entity or document if he is creator, owner or belongs to a workgroup that can see the document. If users see the entity or document than all his managers should also see the same document. Users who don’t belong to assigned workgroups should not see the document or entity. It is possible that documents or entities are assigned to multiple workgroups simultaneously For… Read more

Files Sync Providers

Hi All, Acumatica architecture is very extensible and many functions can be extended just with new class of specific interface/base class.Import Data Providers, Dashboards, Credit Card Processing, Bank Statement Import and so on. Most of them already described in different sources. However today I want to show you how to create a custom File Sync Provider. The list of providers that you can see in the Synchronization Types is actually dynamic. That means you can add there more functions without changing base code of Acumatica. To add a new File Sync Provider you need to to 2 things: Create a Provider class that can handle files Export/Import Extend Combo-box to… Read more

Prevent SO Invoice from Posting Inventory

Hi All, A quick customization tip for you – if you need to cut Inventory posting from SO Invoice you can just simple override PostInvoice and don’t call the base method.In this case Invoice will be successfully released, but inventory transaction will be totally ignored. This customization might be important in some cases and have an easy customization!

Cash Discount Customization

Hi Everyone, Today want to share with you a ways to customize cash discount calculation in AP and AR. The main payer there is a TermsAttribute, that does all required discount calculations. It is linked to fields it need through parameters in constructor: ARInvoice.docDate – input – date of the document ARInvoice.dueDate – output – due data of the document ARInvoice.discDate – output – data where discount is applicable ARInvoice.curyOrigDocAmt – input – total document amt from where discount will be calculated ARInvoice.curyOrigDiscAmt – output – end discount value As there values are configurable it very easy to replace its calculations using customization framework and use different values as a… Read more

Easier way on adding Action Menu in Existing Graph

Hi Guys, to help you with coding or adding a Menu Action to an existing screen. Level: Basic Example Scenarios: Grouping Customized Reports  Organized Action Buttons Folder instead of displaying all buttons in toolbar First we need to define our Action Buttons Folder Action Action1 Action2 Then we override the screen’s Initialize() or Initialization Process Using public override void Initialize() then we add the Actions to the Action Folder with  this.ButtonFolder.AddMenuAction(ButtonItem1); Furthermore, please include  MenuAutoOpen = true to make the button not clickable as button and will act as a dropdown button. Please refer to the code below: Just publish the Customization Project, and it will apply accordingly. That’s it, have a nice… Read more

Extend Tax Calculation Precision

Hi All, A while ago I got a question about extract from document tax calculations in Acumatica. In Thailand there is requirement by law to calculate tax from Document Amount, however in Acumatica we have only option to extract tax from item amount. However this calculation is not aways correct due to rounding differences between line amounts and document amount. For example if you have 7% tax and 3 lines (47000, 18000, 9000) with total 74000 than: If you calc taxes from each line and sum it than you get Taxable Amt = 69,158.87, Tax Amt = 4,841.13 If we calc if using excel (Amt – Amt*1.07), than Taxable Amt… Read more

Tenant Selector In Acumatica

Hi All, Quick trick for you. If you need to link several tenants together, you can use the code from this article Tenant selector attribute: #region NeuralCompanySelectorAttribute public class CompanySelectorAttribute : PXCustomSelectorAttribute { public CompanySelectorAttribute() : base(typeof(UPCompany.companyID)) { DescriptionField = typeof(UPCompany.loginName); } protected virtual IEnumerable GetRecords() { PXCache cache = _Graph.Caches[typeof(UPCompany)]; Int32 current = PX.Data.Update.PXInstanceHelper.CurrentCompany; foreach (UPCompany info in PXCompanyHelper.SelectCompanies(PXCompanySelectOptions.Visible)) { if (current != info.CompanyID) yield return info; } } public override void DescriptionFieldSelecting(PXCache sender, PXFieldSelectingEventArgs e, string alias) { if (e.Row == null || (sender.GetValue(e.Row, _FieldOrdinal) == null)) base.DescriptionFieldSelecting(sender, e, alias); else { UPCompany item = null; Object value = sender.GetValue(e.Row, _FieldOrdinal); Int32 key = (Int32)value; foreach (UPCompany info… Read more

Put Document on Hold with Code

Hi All May Acumatica documents have an imbedded workflow. Hold/Unhold is usually a part of this worflow. Sometimes we may want to emulate user behavior thought the code, but there is a trick here. Acumatica’s Hold checkbox usually adds a hidden button that is triggered automatically when you check/uncheck hold. When you work thought the code you need to consider it and call button as well. Here is example on how to call hold on Purchase Order: public PXAction<POOrder> PutOnHold; [PXButton()] [PXUIField(DisplayName = “Put On Hold”)] public void putOnHold() { POOrder row = Base.Document.Current; if (row != null) { //row.Status = POOrderStatus.Hold; row.Hold = true; row = Base.Document.Update(row); Base.hold.Press(); }… Read more

Dashboards based on Real Screen

Hi All, You may know that it is easy to do a dashboard in Acumatica based on Generic Inquiry. But you also can enable your custom real screen to be a dashboard source. To do this you actually need only 3 things: Mark your Graph as dashboard source: [PX.Objects.GL.TableAndChartDashboardType] Mark you Data View as Filterable: [PXFilterable] Add a Data View delegate. For some reason dashboard does not work without it. I hope this issue will be solved soon. Full code source: using System; using System.Collections; using System.Collections.Generic; using PX.Data; using PX.Objects.AR; namespace CUrrentBranch { [PX.Objects.GL.TableAndChartDashboardType] public class CurrentBranchInvoices : PXGraph<CurrentBranchInvoices> { public PXCancel<ARInvoice> Cancel; [PXFilterable] public PXSelect<ARInvoice> MasterView; public virtual… Read more

Override Action – Confirmation Dialog

Hi Everyone, Want to give you an example of how to modify an action in Acumatica. specifically I’ll customize a Release action on Payments and Applications with adding a Confirmation Dialog with conditions. To customize an action we should follow the Acumatica customization guide. In simple words we should do following: Find the original action. Create a graph extension. Redefine the original action with the same parameters. Add own logic in the new action. Call base action code. Base Action Code To find the original Action you can use Source Code browser. Custom Code Your code will be called instead of the base action. You can put your custom code… Read more

Selecting data though Acumatica PXSelectorAttribute

Hi everyone, Today, I would like to share with you small tip to work with PXSelectorAttribute base on my experiences. Here is the story, let me image that you have the DAC and you want to add more information which is just supporting information and you dont want to save it. Please take a look on my DAC bellow. And now I would like to get the value of Default Price to display after I choose the Inventory Item. I will create code in the in the FieldUpdatedEvent like bellow In the conclusion, depends on your scenario you can use PXSelectorAttribute to get data from the cache. It would be… Read more

Custom field on CR Quote screen

Hi Everyone, If you try to add a custom field on CR Quotes in Acumatica 2018 R2 you may face very weird behavior – field is added, can be saved to database but as soon as you refresh screen or record valued disappears. The reason of this issues is PXProjection that is described in my separate article: PXProjection – SQL Views using BQL  This image show you how projection is defined in Acumatica CRM PXProjection uses 2 Data Access Classes for quotes: One class represents the table – PX.Objects.CR.Standalone.CRQuote Another represents view as combination of DACs in select – PX.Objects.CR.CRQuote And to correctly work, custom field needs to be added in… Read more