Hi Everyone, In Acumatica 2018R1 we have a new cool feature to drag and drops rows of the grid to resort them. As you can see sorting is still based on database column (In my case it is Sort Order) but Acumatica can automatically reorder all rows based position you dropped it. This is just a first version so still have some limitations (like it is still not fully works with extensions for existing DACs), but I really like we can bring new and very friendly user experience to ERP. How to implement it in own code? To have this feature you need to change several things in your Graph,… Read more
Tag: Framework
PXSelector and DirtyRead
Hi Everyone, Want to speak today about Dirty Read property of selector. Base explanation you can find in Acumatica API reference. How ever this one is very basic, so let me try to share with you real case. You may know about Readonly vs Merged data retrial from DataView. Basically if you use PXSelectReadonly data-view it will always return data only stored in database. If you use standard data-view like PXSelect Acumatica will get data from DB and than merge it with unsaved data from cache. This is fully applicable for data-views (PXSelect, PXSelectReadonly) and selectors as well. When you define PXSelectorAttribute than it will be always read-only by default.… Read more
Multi – Line Text Edit control
Hi Everyone, In case you need to store rather big text you may need to use multi-line text edits. Here I would like to share with you example based on Address Line on Customer Form. Multi line just a property of the text edit so if you just change mode of control in Customization browser you will be able to use enter in control already. As soon as you publish customization control will add cut angle what you can use to control its size with mouse: If you also set height property of control for example to “100px” size will be extended in UI by default: Important to note that… Read more
PXProjection – SQL Views using BQL
Hi Everyone, Occasionally I get question from partners related: Can we Join several tables with possibility to update them all? You know that Joined tables in Acumatica are read-only and you cannot update fields there Can we create/use SQL-like views in Acumatica? How can I join grouped (statistical) view to the DAC? The answer to all these questions is yes you can do it. But answer on how to do that is not so simple. Obviously the most strait forward way is to create an SQL view and generate a DAC based on it. But this way does not solve point number 1 – SQL view is read-only and does… Read more
Custom Image on Acumatica Form
Hi All, Want to share with you way how can you add Сustom Image on Acumatica form. To do that you can use PXImage control. In the ImageUrl you can add physical path to image on the file system. <px:PXImage runat=”server” ImageUrl =”~/Icons/login_logo.png” /> This is static image and not linked with any data view or dac, so if you need to change images dynamically you have to write logic in the code behind file however it is not recommended way by Acumatica standards. Have a nice development!
Show and Hide Grids on the Fly
Hi Everyone, Sometimes you need to show user interface differently depend on parameters selected. Here I want to show you an approach where you can show different grids depend on parameters selected in filter. You may need different grids in the following cases: If have different data access classes (tables) to show. If you need to have different grids layout depend on parameters. If you need to to have different columns configurations. So the plan is the following: Have 2 different DACs. We need it to have different caches, as viability settings are linked to cache. public class DetailsTableA : IBqlTable { public abstract class fieldA: IBqlField { } [PXDBString(1)] [PXUIField(DisplayName = “Field A”)] … Read more
Multi-Select Selector
Hi There, Want to share with you hidden way to add a multi-select Selector control to have better filters. There is a special UI Control px:PXMultiSelector that allows you to select multiple values in the same field. Values will be stored in the field with Semicolon Separator. For example in the field like shown above we will have following value: ACTUAL; BUDGET To add such control you need to do following: Define a selector on the DAC field. Please note that you should disable Validate value, as selector will try to search combined value in DB and fails with error. [PXSelector(typeof(Ledger.ledgerCD), ValidateValue = false)] Second step will be UI control definition.… Read more
Generate IN Receipt from the Code
Hi All, In my experience I have quite a lot of questions like – how to create a document on the fly. The answer is rather simple – we need to use the same objects as user interface and emulate user interface behavior. As the main object that contains a business logic and validation is Grpah, we need to create it from the code and use for calling actions and pushing data. INReceiptEntry graph = PXGraph.CreateInstance<INReceiptEntry>() To create a new object we can use PXCache. INRegister header = (INRegister)graph.CurrentDocument.Cache.CreateInstance(); Every container control form UI is linked with Data View that is linked with DACs and tables. As you may know… Read more
SQL In <> Operator in BQL
Hi There, Today want to show you example of amazing and very new BQL Operator – In<>. This operator was added just recently with Acumatica version 2017R2, so now you can pass there an array of values and Acumatica core will convert it to SQL IN ( … ) statement. Here is a code example: Object[] values = new String[] { “AC”, “IN” }; InventoryItem item = PXSelect<InventoryItem, Where<InventoryItem.itemStatus, In<Required<InventoryItem.itemStatus>>>>.Select(Base, values); Console.WriteLine(item.Descr); This will be converted to following SQL Select * from InventoryItem InventoryItem Where InventoryItem.Status In (‘AC’, ‘IN’) Order by InventoryItem.InventoryCD Please note that In<> operator is available only with Required<> parameter and you need to pass array of possible values manually to Select(…) method parameters. Have… Read more
Remove base Attribute with Customization
Hi All In my previous article “Append and Replace of DACs Attributes” I have described how can you replace append attributed in DAC with customization. Today I would like to add one more useful attribute – PXRemoveBaseAttribute. This one can help you to just remove one specific attribute from base field and replace it with new one if needed. [PXDBString(32)] [PXDBDefault(“Test”)] [PXUIField(DisplayName = “Test” )] public String Field { get; set; } Example 1: public Extension : PXCacheExtension<DAC> { [PXRemoveBaseAttribute(typeof(PXDefaulAttribute))] public String Field { get; set; } } Example 2: public Extension : PXCacheExtension<DAC> { [PXRemoveBaseAttribute(typeof(PXDefaulAttribute))] [PXDBDefault(“New String”)] public String Field… Read more
Difference between Acumatica ERP and Framework
Hi All, Previously I had quite a lot of questions about how to integrate development done on Acumatica Framework with Acumatica ERP. Usually them main reason of that question is misunderstanding of what is Acumatica Framework. Acumatica Framework (what you can download as separate installer from portal) is designed to develop product that is completely separated from Acumatica ERP. That is why there are less functions and no code integration with ERP. In case you are see benefits of using functions form Acumatica ERP (like segmented keys, numbering, accounts, subaccounts, customers/vendors, inventory items), it would be much better to start development on Acumatica ERP itself from the beginning, and do… Read more
DACs Inheritance and Caches
Hi All Want to speak today about DACs inheritance in Acumatica and some issues that it cause to development. As you know C#/.NET as OOP-oriented framework support inheritance of objects, but when in comes SQL and Database structure than there is no inheritance between tables. As a bonus I will explain why we need BAccount and BAccount2 DACs and what is the difference. Inheritance In Acumatica we want to leverage benefits of OOP to simplify references between objects, minimize database size required, ease of reporting and so on. As a result of that we have designed system in such way to support it: You can have parent DAC public class BAccount : IBqlTable { …… Read more
Multiple DataViews on the same Form
Hi All, If you didn’t know previously, in Acumatica has introduced new syntax of defining DataViews/Fields. Previously you have to create a new Form, assign DataView to form and than add there fields. But now you can use following construction: “DataMember.DataField” right in the DataField property. <px:PXSelector DataField=”BranchID” /> <px:PXCheckBox DataField=”DefLocation.IsRemitContactSameAsMain” /> <px:PXTextEdit DataField=”RemitAddress.AddressLine1″ /> <px:PXTextEdit DataField=”RemitAddress.AddressLine2″ /> Also, a DataMember can be specified as an attribute of a PXPanel, and it will be inherited by all internal controls. <px:PXPanel RenderStyle=”Simple” DataMember=”RemitContact” > <px:PXMaskEdit ID=”edFax” runat=”server” DataField=”Fax” /> <px:PXMaskEdit ID=”edPhone1″ runat=”server” DataField=”Phone1″ /> </px:PXPanel> Have a nice development!
Database Mapped vs Virtual Fields
Hi All, Today want to share with you how Database vs Virtual fields are working in Acumatica. You may notice that some of the fields are linked to DB, some of them not.The difference is in the Attributes are used on it – PXDB<Type>Attribute is mapped on database field, PX<Type>Attribute is not. So from user standpoint it is just prefix “DB” or “”. In Acumatica there are many fields are mapped to database and most of them have a clone, that is not mapped. Here you can see list of most common attributes. Description Database Mapped Field Virtual Field String Value PXDBStringAttribute PXStringAttribute Byte Value PXDBByteAttribute PXByteAttribute Short Value PXDBShortAttribute… Read more
Redirecting to External Page from Button
Hi There, Want to share with you my experience with working with redirects from Acumatica. You may know that due to security issues and stability of software, redirect to external web site in the iFrame is forbidden in Acumatica. So every time when you use “PXRedirectToUrlException” for url like “http://acumatica.com” system will open url in separate window/tab. That is OK in mane cases, but sometimes you really need that functionality. One way to solve that issue is well described in a separate article – Redirect on Page Load But that one is applicable only if you want to have a menu item in Acumatica SiteMap. If you want to redirect… Read more
Actions and Primary View
Hi There, Today we are going to speak about Actions in Acumatica, as well known as Buttons. When you creating a button you basically just need to write a simple code snippet like here: #region Event Handlers public PXAction<PX.Objects.GL.Batch> MyButton; [PXButton(CommitChanges = true)] [PXUIField(DisplayName = “My Button”)] protected void myButton() { } #endregion As soon as you add this button as extension and publish it, you will see button appeared on the screen. But from platform standpoint there is much more than button handler, let check how does it work: Action Data View – “public PXAction<Batch> MyButton;” PXAction is special version of Data View in Acumatica, that defines action name, as well as button handler name. But you may see… Read more
Sending Notification Template from Custom Code
Hi There, Today want to share with you how to send emails from Acumatica custom code based on Notification Templates. User scenario is very simple – lets assume we want to send an email from Acumatica that informs about contract, quote expiration or something else. But in the same time we want to keep activity linked to our document for the future reference. Basically, if we do that manually we need to create new Email activity, fill all details there, attach to entity and send it than, The obvious way to automate it is usage of Notification Templates. Notification templates are special type of emails, that can be combined dynamically… 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
Useful Web.Config Parameters
Hi All, Acumatica as standard ASP.NET application stores some configurations in web.config file. Some parameters can be really useful for users and developers. In this article i want to share with you parameters that really can help you. AutomationDebug (Default false) – An indicator of whether an information about the current automation step (state of a form of Acumatica ERP) is displayed on the form. If you set the value of the key to true, the text box with the current automation state is displayed on the Info area of a form of Acumatica ERP. Very useful parameter if you changing automation steps CheckCustomizationCompatibility (default True) – If the key… 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