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

Depersonalize Acumatica Database

Hi All, If you need to give an Acumatica Database to someone but if you care about data privasy, you may a way to crear some sensetive data from the database. Here I want to share with you a script example that creares and depersonalise some of private information from database: View the code on Gist. Basicall this script resets all passwords, clears all contact and address details, remove files attached. Feel free to improve and extend it for other objects. Hope it helps!

Get Current Company Name

Hi All, Want to give you a short trick – how to extract company name from the currently logged in user: Company Name PX.Data.PXLogin.ExtractCompany(PX.Common.PXContext.PXIdentity.IdentityName) Here we have 2 things: PXSessionContext (PXContext.PXIdentity) – System class that stores environment variables in session like User, TimeZone, Branch, Locale. Actually this is used for user authentication authorization. However user here is stored with a full notation – like “user@company:branch”. But we can cut a part of it using special rules. PXLogin – set of tools that can help to login user and use username. In our case it can extract company name right from full identity name. Company ID PX.Data.Update.PXInstanceHelper.CurrentCompany Here we have an… Read more

Generic Inquiry with Filtering by Current Branch

Hi All, Want to show you an option how can you filter documents in Generic Inquiry by currently selected branch. In reports you have an option to use AccessInfo.BranchID, but in generic inquiries unfortunately such option is not available. You also can’t join this table as AccessInfor is virtual table that does not exist in database. However there is a workaround – we create a parameter in GI, that will get a default value from any branch field in Acumatica that has a default value from current branch and than use this filter for filtering. Let me guide you: We need to create a parameter that will store a current… Read more

Reporting Currency Conversion on the Fly

Hi All, In Acumatica you can use standard currency translation tool to translate base currency to any other reporting currency. However this process is available only for GL Balances. You can really translate AP/AP SO/PO balances and total using the same approach. Here I want to give you the idea of how can you do on the fly currency translation from any currency to any currency on any document in Acumatica for reporting purposes. Problem The biggest problem of this task are Rates. In Acumatica we store rates assigned to effective date. But if you have other dates where are no rates defined, we need to user the closest previous… Read more