Joins with PXRestrictor

Hi There, There is a chance that you wanted to use PXRestrictor, but there is no needed table to provide a validation. Please note that “BAccountClass” table is not defined in the querry from the PXSelector. Resultantly, the Where condition “rictorAttribute(typeof(Where<BAccountClass.IsInternal, Equal<True>” will not work and will give you an SQL Interpretatino error. Further more, there is not way to add a Join to BAccountClass table from the PXRestrictor attribute, since this is not something supported by Acumatica framework yet. However, there is a relatively easy way to workaround this with subselect query from Where statement using the Exists<> BQL Command. This is not a perfect way from the performance… Read more

Feature Validation in Grid Lines

Hi There! As you may know, Acumatica has a pretty nice and easy way to create and validate if a certain feature is enabled. You can read about it here. However, that way works well only if you have to hide fields, columns, grids, forms. What if you want to hide some records from the grid based on the feature? Normally this is not a trivial task and requires a lot of code in the data view delegates and so on. And even you do all of these things, you won’t be able to use it in the Generic Injuries. I would like to suggest an alternative approach where we… Read more

Switch between Old and New Processing result UI

Hi All, You know that starting from Acumatica 2019r1 there is a new processing result window that shows more information about record processed and pending. However you should know that it is possible to control this behavior via graph code. There is a virtual property at PXGraph -> IsProcessing which identifies if this page should display processing result in the new format. And you can override this property in a processing graph to not display the Processing dialog box on the processing page. If the value is false, the progress and the result of the processing are displayed on the page toolbar. By default, the value is true (the Processing… Read more

Field Event Sequence

Hi All, As you may know from, Acumatica events are triggered in the specific sequence. But there is sequence not only for event types, events for different row and field will be triggered within a specific sequence too. Rows With rows it is a bit easy:Insert/Update happens in the sequence how it was triggered. If you update a value it will trigger an event sequence for specific cache that was updated. In case event updates other caches, that they will be triggered also as soon as cache.Update/Insert/Delete is called.Save/Delete happens for primary cache first as it is associated with the button, than it will call PXParent Attributes in the sequence… Read more

Page Refresh and Redirection

Hi All, As you know Acumatica page submits all data to the server though different callbacks. This is good for network performance, but brings some limitations – like redirection. Unfortunately it is not possible to use Response.Redirect() during the callbacks as browser script does not expect it and can’t properly react. To solve some of these issues Acumatica uses different exceptions (like PXRedirectRequiredException, PXReportRequiredException and so on). These Exceptions will be handled by base code (Callback Manager) and translated to text commands that will be handled in JavaScript. For instance, PXRedirectRequiredException(WindowMode.New, SuppressFramceset = false) will be translated to eRedirect3:+<SomeURL>. You can read more about this mechanism here. This code is… Read more

Flags in PXGraph

Hi All, A short but useful article today – PXGraph is a center of the whole business logic in Acumatica framework and can be triggered from different places: UI, Web Services API, Mobile, Import and so on. As a developer you sometimes need to know what is the context of the request you are processing right now, so you can adjust the business logic. For this purpose PXGraph has a set of flags that are automatically triggered during different operations. Here they are: graph.IsImport – flag will be automatically set when Import/Export engine is working. This will be true for Import/Export scenarios, Web Services, Copy/Paste action, Mobile. So almost all… 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

3rd annual Virtual Developer Conference

Hi all, Today I would share about a news about Acumatica Developer Conference. This is 3rd we organize this event to get everyone together. I will take place on 19-20 June. Here is the agenda For more information you can read it here And dont forget to register here Have a nice weekend everyone.

Remove Action Menu from Actions Drop-down

Hi All, Show example for you today – how to remove action from menu based on example of ChangeID function in CustomerMaint graph. Problem If you take VendorMaint and try to find who ChangeID is declared there you will be able to find following code: So you can see here that ChangeID button is added as a menu to the Action button. This works pretty well accordingly to example with adding sub-menu actions here. Now the question – what if we need to remove or hide this action? We can’t use automation steps as they cannot make button invisible. We cannot use PXUIFieldAttribute on ChangeID as this button is already… Read more

Grids Master-Detail Relationship

Hi Everyone, Sometimes you need to have a screen with 2 grids that depend on each other. When you change line in one grid, it should refresh records in another. In this case you need to establish Grids Master-Detail relationship. In general master-detail relationship for grids is almost the same as for form-grid. You can read more about it in T200 Framework Fundamentials Training Guide, Example 2.2, Setting Up the Master-Detail Relationship Between DataAs a summary from the training, we need to do 3 points Put PXDBDefault attributes in child DAC to auto-initialize dependent keys. Put PXParent attribute in child DAC to allow cascade deletion and few other functions. Use… Read more

Primary & Foreign Keys

Hi Everyone, Acumatica is a advanced ERP system. And when we speak about ERP it is not only about data input, it also about how to store, retrieve and analyze data we have. Because of this we have very connected tables in Acumatica databas where almost every 3rd-4th column is a foreign key to other record. This helps a lot with data analyses.But how to organize keys better for usage, faster for search and smaller for database storage? Primary/Foreign Keys Definition In general we have only 2 ways to define and organize keys: Natural Keys and Surrogate Keys. Each way has own benefits. Natural keys (Code, CD)A natural key is… Read more

Concurrent Update

HI All, With current web applications architecture it is complicated to track what users are doing on browser side: are they still online or on the way to take a cup of coffee? Will they save a record or just checking it?We can’t just lock records in the Web Application every time when someone have opened it for editing.So here we have 2 main problems: You don’t know who and when will save it You don’t know if user still online or not In Acumatica we have designed the platform in the way to not depend on user behavior. But we still have 2 different ways to manage concurrent update… 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

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

Select Multiple Documents into One Grid

Hi Everyone, In some situations you may want to show different unconnected documents inside one grid. Just for example you want to create Customer Overview screen and show all Invoices, Payments and Sales Orders together in one place. Join tables together is not the best approach, as you will have to add different columns with same names for fields from different tables. Better Approach is select them independently in Data View delegate and merge them into one virtual DAC. So plan is the following: Create a new Virtual DAC that will represent any document in the system. Please note that this DAC should have a Key that should unique even… Read more

Context Parameters

Hi Everyone, In this topic I want to cover another architecture pattern we have in Acumatica – Usage of context related parameters. Problem Statement Within the event model it is not easy to pass parameters into the other child or related events. There is a way with local variables how it is shown in T300 Training Guide and Override Release Action Lesson. However it is a really not nice approach if events happens in different objects like here: public class SomeGraph : PXGraph<SomeGraph> { public void CreateBatch() { bool needValidate = true; //Create Batch } } public class JournalEntry : PXGraph<JournalEntry> { public void DAC_RowUpdated(PXCache cache, PXRowUpdatedEventArgs) { if (needValidate) { … } } } Solution In Acumatica we use an approach that we call Scopes. Scope is a class that set… Read more

Generic Events Declaration

Hi Everyone, Starting from Acumatica 2017 R2 you may notice a different events declaration. We call in generic events or new events declaration. Here you can see an example for row and : protected virtual void _(Events.FieldUpdated<DAC, DAC.field> e) {} protected virtual void _(Events.FieldDefaulting<DAC, DAC.field> e) {} protected virtual void _(Events.RowUpdated e) {} protected virtual void _(Events.RowSelected e) {} protected void _(Events.CacheAttached e) {} From the functional side there is not difference between old and new events declarations. However with generic events you have 2 main benifits: No more mistakes in names of DACs or Fields. As you rerefence it by tipe whong name won’t be even compiled. Don’t need to cast DACs anymore from e.Row anymore. It will have a typeinside. PXCache cache = e.Cache; DAC row = e.Row; However there are a couple of… Read more

Acumatica 6-tiers Web Architecture

Hi All, Recently got a question about Acumatica web architecture and tires. To answer it I have prepared slide that I would like to share with you now: Acumatica 6-tiers Web Architecture: Acumatica Cloud xRP Platform (Presentation, Business and Data Access tiers): The basic diagram of Acumatica SaaS hosting Have a nice development!