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

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

Dynamic Drop-Down Control

Hi Everyone, Usually Acumatica Drop-Down controls have fixed lists of values. Of course you can use PXStringListAttribute.SetList<…>(…) method do change list of values dynamically, but how to make it more handy. The way I recommend you is to create an attribute that can encapsulate all the field related logic, so to use it you can just put the attribute on the proper place. So the plan: Create an attribute that will be inherited from PXStringList and provide the values Create IPrefetchable class that can be automatically load all possible list from DB and cache it. In the same time Acumatica will auto-reset when the linked table is changed. This is… Read more

Monitor Online Users

Hi All, Web technologies work the way where server know almost nothing about where is browser and what is user doing there. Is it active? Is it closed? It is online? Is computer sleeping? We don’t know if there browser does not inform us. Just for example – if you lost internet connection, should we treat this as online or inactive? In Acumatica Online/Offline is just a flag in users table. If users logs in, Acumatica rises this flag, if users is not active for some time, Acumatica clears this flag. This flag is automatically managed by Acumatica but in some cases it may be not in the consistency with… Read more

Send Documents to Printers

Hi All, There is an nice function in Acumatica 2018R1 – Device Hub. This service can be installed on any machine where printer is configured/available and automatically pull Acumatica for documents need to be printed. There are a lot of screens who uses this function in the standard Acumatica already, but today I want to give you a quick look on how you can write your custom code and send request to printers. Device Hub First of All device hub should be installed on your computer, connected to Acumatica and configured with Available printers. Printers also should be Configured in Acumatica. Customization Now we can write a bit of code.… Read more

In-Screen Popup Panels with iFrame

Hi Everyone, Most probably you have seen the function in Acumatica where you can open a new screen in a iframe on top of the existing screen without navigation. This approach has some benifits and disadvantages. Have inplace pupup helps to have less redirection and less windows, but in the same time it blocks the previous page and you cant modify/see background untill you close the popup. Choose the way you use wisely based on the requiranments and design you have. How to call inline popup? public PXAction<SOOrder> createPrepayment; [PXUIField(DisplayName = “Create Prepayment”, MapViewRights = PXCacheRights.Select, MapEnableRights = PXCacheRights.Update)] [PXButton(ImageKey = PX.Web.UI.Sprite.Main.AddNew)] protected virtual void CreatePrepayment() { ARPaymentEntry target =… 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