Archives

Archives / 2014
  • Fix at least one column in the Selected area and controlling set of selected columns in Acumatica

    Hello everybody,

    today  I want to share tricks related to Acumatica grids:

    1.       How to fix at least one column in the Selected area so users will not be able to move it to the Available? All our custom pages have grids which can be moved.

    ------ You need to utilize PXGridColumn’s  AllowShowHide property set to False for not allowing user to hide for at least key column/s.

    2.       How to control the default set of Selected columns for the grid so only the particular columns will be shown in the grid by default, and the rest of columns can be added by the user if necessary?

    ------- Grid Columns created for DAC fields marked not visible will be shown as Available column

    Practical … more

  • Debug ExecuteSelect in Extentsion graph of Acumatica

    Hello everybody,

    today I want to share how to debug method ExecuteSelect from Base in extension class:

    public delegate IEnumerable exSelectDelegate(string viewName, object[] parameters, object[] searches, string[] sortcolumns, bool[] descendings, PXFilterRow[] filters,

    ref int startRow, int maximumRows, ref int totalRows);

    [PXOverride]

    public IEnumerable ExecuteSelect(string viewName, object[] parameters, object[] searches, string[] sortcolumns, bool[] descendings, PXFilterRow[] filters,

    ref int startRow, int maximumRows, ref int totalRows, exSelectDelegate f )

    {

    IEnumerable result = null;

    try

    { … more

  • How to deal with cases when Decimal is not enough

    Hello everybody,

    today I want to drop a note about cases when you need high precision, and C# type decimal is not enough for your needs.

    I discovered for myself GNU MP library, which has also wrapper in C#. 

    Amongh feautures which this library proposes are the following:

    1. High number precision, which is limited only by available memory.

    2. Rish set of operators more

  • Neural Networks teaching

    Hello everybody,

    today I watched vidoe of Dr. James McCaffrey about traing neural netwoks. 

    So, few interesting details, which was useful for me. 

    1. As usually it is more then enough one hidden layer. 

    2. Imagine, that you need to feed into your neural network some data. Let's say Age, income, sex, religion. For data normalization it is good to use not big numbers.

    For example for Income which is around 51000 it's good to give to network 5.1 and not 51000.

    For sex passing into NN it's good to use gues what? If you have an idea 0 and one, you are wrong. It's good to pass -1 and 1.

    And for classfication like if you have input for example 3 different categories, the best way to pass … more

  • RowDefaulting and copy/paste in Acumatica or copy paste mode in acumatica

    Hello everybody,

    recently I had the following situation. 

    According to business logic, I created RowDefaulting. And it worked great. Then business analyst decided to check copy/paste functionality of Acumatica, and you know what? He discovered that copy/paste is broken. After investigation I discovered that it was due to RowDefaulting event.  For me it meant the following, I need to turn off RowDefaulting after copy/paste. 

    After usage of reflector, I noticed interesting property  IsCopyPasteContext in the graph. 

    So I modified function RowDefaulting.

    private void RowDefaulting(PXGraph graph)

    {

          if( !graph.IsCopyPasteContext )

              {

                        //do some row … more

  • Custom Selector in Acumatica

    Greetings to everybody,

    today I want to document how to make selector in Acumatica. 

    I had the following use case:

    1. Acumatica dropdown, which can have three values ( for example a, b, c) .

    1.1 In case if user select option a, I need to show in PXSelector values from Table A with some filtering condition.

    1.2 In case if user select option b, I need to show in PXSelector values from Table  B with another filtering condition

    1.3 In case if user select option c, I need to show in PXSelector value from Table C with another filtering condition

    Due to the fact, that PXSelector can work only with one DAC, the only way to solve it was implementing custom selector which inherits from  … more

  • Acumatica Cache inserted updated objects

    Hello everybody,

    today I want to share one simple technic of how to filter inserted items in cache from other objects. I discovered it with reflector, while diffing in code of APInvoiceEntry. 

    Here it is: 

    Adjustments.Cache.Inserted - this item will give you which items were inserted in view Adjustments. 

    Another interesting details was updated:

    Adjustments.Cache.Updated

    will give you updated items in cache.

    And of course deleted: 

    Adjustments.Cache.Deleted more

  • SetValueExt and SetDefaultExt in Acumatica

    Hello everybody,

    today I want to share with you information about two functions:

    SetValueExt and SetDefaultExt. 

    Names of them are pretty self-explanatory, which means SetValueExt assigns specific value to field and SeDefaultExt assings default value to a field. But SetValueExt  method raises the field-level events for the data field as when a data record is updated. The SetDefaultExt<>()method of the cache to assign the default value a field. The method raises the field-level events for the data field as when a data record is inserted. more

  • PXDataBase.Update in Acumatica

    Hello everybody,

    today I want to note how to use PXDataBase.Update in Acumatica. 

    Two use-cases.

    1. Imagine, you need to set APSubID = 80 in APRegister with APAccountID = 5:

    you can use the following:

    PXDatabase.Update<APRegister>(new PXDataFieldAssign<APRegister.aPSubID>(80),

    new PXDataFieldRestrict<APRegister.aPAccountID>(5),

    new PXDataFieldRestrict("DeletedDatabaseRecord", PXDbType.Bit, false));

    2. Set DocBal = 80 and DocDesc = “blah blah blah”  in table APRegister with APAccountID = 5 and APSubID = 80:

    PXDatabase.Update<APRegister>(new PXDataFieldAssign<APRegister.docBal>(80),

    new PXDataFieldAssign<APRegister.docDesc>("blah blah blah"),

    new PXDataFieldRestrict<APRegister. … more

  • web.config Timeout Connection timeout

    Hello everybody,

    Today I want to note web.config properties, which took for me some time to discover. It is possible to add two options in connection string of web.config.

    1. Timeout=60

    2. Connect Timeout=300

    What is difference between those two parameters?

    The first one set for how long your code at db will be executed. The second one sets for how long your code will wait for result. more

  • How to block column in Acumatica grid or one value in column

    Hello,

    I want to share with you how to block some columns in Acumatica.

    You can do it with the PXUIFieldAttribute.SetEnabled method.

    Let's say you have DAC PRTran with column earningType and values of PRTran you get from PaySlipDetails view. Then you can block whole column with the following call:

    PXUIFieldAttribute.SetEnabled<PRTran.earningType>(PaySlipDetails.Cache, null, isEnabled);

    Another question which sometime appears is how to block single record value in column.

    The solution is the following:

    row = .... here goes your logic which will get PRTran for which you need to make blocking

    PXUIFieldAttribute.SetEnabled<PRTran.earningType>(PaySlipDetails.Cache,  row, false); more

  • Current items in View

    Hello everybody,

    today I want to share with everybody how to find all items in view in Acumatica.

    Suppose you have View declared in the following way:

    public PXSelectJoin<PRPayrollDetails,

    InnerJoin<EPEmployee, On<EPEmployee.bAccountID, Equal<PRPayrollDetails.employeeID>>,

    InnerJoin<PRPayroll, On<PRPayroll.refNbr, Equal<Current<PRPayrollDetails.payrollRefNbr>>>,

    LeftJoin<APInvoice, On<APInvoice.refNbr, Equal<PRPayrollDetails.aPRefNbr>, And<APInvoice.docType, Equal<PRPayrollDetails.aPDocType>>>>>>,

    Where<PRPayrollDetails.payrollRefNbr, Equal<Current<PRPayroll.refNbr>>>, OrderBy<Asc<PRPayrollDetails.description>>> PayRollsDetails;

    and now you made some changes to that view in … more

  • An object reference is required for the non-static field, method, or property PX.Data.PXSelectBase Acumatica DAC Select in Acumatica

    Hello everybody,

    today I want to share how to fight with error like 

    Error 22 An object reference is required for the non-static field, method, or property 'PX.Data.PXSelectBase<Acumatica DAC>.Select(params object[])' bla bla bla

    As usually it means that you try to use this in selector of Extension class. Just replace this at Base or Base2 and your problem will go away.

    for example 

    CR.Location customerLoc = PXSelect<CR.Location, Where<CR.Location.bAccountID, Equal<Required<CR.Location.bAccountID>>, 

                                And<CR.Location.locationID, Equal<Required<CR.Location.locationID>>>>>.Select(this, customer.BAccountID, customer.DefLocationID);

    should be 

    CR.Location … more

  • Create new record in Acumatica or which insert works faster

    Hello everybody,

    today I want to share results of my investigations of two similar pieces of functionality in Acumatica.

    Have you ever wondered which Insert in cache works faster this:

    a) var temp = (PRPayrollDetails)PayRollsDetails.Cache.Insert();

    or this:

    b)          var temp = new PRPayrollDetails();

                 temp = (PRPayrollDetails)PayRollsDetails.Cache.Insert(temp);

    If to believe to results of Stopwatch, the second part of code works faster. For my set of data, the first one took 5.5 seconds, while the second option took 4.3 seconds. And this is difference for 300 records. If you have any ideas why it can be, you are welcome to share them.

    And if I had 250 records then the … more

  • How to read from stored procedure in Acumatica

    Hello readers,

    today I want to share hwo it is possible to read from stored procedure in Acumatica. Keep in mind, that reading from sp is against best practices of Acumatica, because if you read from sp, then you'll reading will not be cached and other side effects, but sometime you don't have a choice. So, for such cases you can try following approach:

    create procedure uspWow

    @invnbr nvarchar(6),

    @money decimal(19,4) OUTPUT

    AS

           SELECT @money = ARInvoice.CuryLineTotal

           FROM ARInvoice

           WHERE ARInvoice.RefNbr = @invnbr;

           RETURN

    GO

     

     

    var invNbr = new PXSPInParameter("invnbr", "000595");

    var money = new PXSPOutParameter("money", PXDbType.Decimal, 19, 4,  … more

  • Get extension of basic DAC class in Acumatica

    Helllo,

    today I want to share how to get extension of basic DAC class iin Acumatica. Lets say you have class ARTran, and extenstion for it ARTranExt and you want to get it in the code of ARTran_RowUpdated event

    Then you can get extenstion in the following way:

       protected virtual void ARTran_RowUpdated(PXCache sender, PXRowUpdatedEventArgs e)

            {

                var newRow = (ARTran)e.Row;

                var newRowE = PXCache<ARTran>.GetExtension<ARTranExt>(newRow);

                .

                .

                .

           } more

  • How to get companyid in Acumatica

    Hello everybody,

    today I want to share how to find current company id in Acumatica:

    Here it is:

    int? companyid = PX.Common.PXContext.GetSlot<Int32?>("singleCompanyID")

    for me it was long way to find it more

  • Enumerate Cahed objects

    Hello everybody,

    today I want to share how to enumerate cahed objects according to some type. 

    Imagine you have following declaration:

    public PXSelectJoin<PRTran> PaySlipDetails;

    And that you need to enumerate them as list of PRTran's in some special way.

    In my case I used following instruction:

    var prTrans = PaySlipDetails.Cache.Cached.Cast<PRTran>().ToList().Where(a => a.IsDeleted.HasValue && !a.IsDeleted.Value).ToList();// we have list of all undeleted pr trans

    var sumOtherAdj = prTrans.Where(a => a.EarningType == EarningType.OA.GetEnumDescription() || a.EarningType == EarningType.OD.GetEnumDescription()).Sum(a => a.TotalAmount); more

  • Rename column at screen in Acumatica

    Hello everybody,

    today I want to share answer at simple question how to change the caption at some screen. 

    For example you want to change caption at screen AR202000 for Inventory ID to caption INVENTORY ID.

    For this purpose we need to understand which DAC is responsible for Grid. For this puprose we can open page AR202000.

    There we can see the following line:

    <px:PXDataSource ID="ds" runat="server" Visible="True" Width="100%" PrimaryView="Filter" TypeName="PX.Objects.AR.ARSalesPriceMaint">

    So it means that for Graph or controller we will check ARSalesPriceMaint.

    For field inventory id responsible code 

    <px:PXSegmentMask ID="edInventoryID" runat="server" DataField="InventoryID" … more

  • FieldUpdated behaviour

    Hello everybody,

    today  I want to share one interesting feature of Acumatica. 

    I revelaed that after inserting of new row executes FieldUpdated even if feld wasn't updated. After reading documentation I found that it is gotcha and inteded to be so. more

  • Acumatica and ObjectsEqual lack of parameters

    Hello everybody,

    today I want to share how I deal with ObjectsEqual limitation. In one of my tasks I had requirement to check for equality more then eight parameters and found that ObjectsEqual takes only 8 parameters. But I needed more. 

    In order to fix it I decided to use extension classes of C# which allows inject into existing class new functionality.

    Here is the way how I did it:

    public static class PXCacheExtensions

    {

    public static bool ObjectsEqualExt(this PXCache cache, object a, object b, params IBqlField[] values)

    {

    var result = true;

    foreach (var bqlField in values)

    {

    result = result && object. … more

  • Enums and strings

    Hello everybody,

    I want to share some pieces of code how to work with enums. 

    Some time it is needed to have list of string constants in your code, which can feet to some strings with spaces. 

    enum EarningType

    {

    [Description("Virginina")]

    VL,

    [Description("Salt and Lasso")]

    SL,

    [Description("TO")]

    TO,

    [Description("RG")]

    RG

    }

    One of easy ways to use description is usage of extension methods like this:

    public static class EnumsProcessor

    {

    public static string GetEnumDescription(this Enum value)

    {

    var fi = value.GetType().GetField(value.ToString()); … more

  • Execute stored procedure in Acumatica

    Hello everybody.

    I want to share if you need to execute stored procedure in Acumatica how to achieve it. 

    It's simple.

    1. Create Stored procedure in db.

    2. Use in your code PXDatabase.Execute.

    For example let's say you created stored procedure which has name DeletePrTranByPrPayrollAndPayrollDetailsId and takes as parameters @prPayrollRefNbr and @prPayrollDetailsID which are of type nvarchar.

    Then you can call stored procedure in the following way:

    var pars = new List<PXSPParameter>();

    PXSPParameter p1 = new PXSPInParameter("@prPayrollRefNbr", PXDbType.NChar, details.PayrollRefNbr);

    PXSPParameter p2 = new PXSPInParameter("@prPayrollDetailsID", PXDbType.NChar, details. … more

  • PXSelect vs PXSelectReadonly

    Hello everybody,

    today I want to share with you important difference between PXSelect  and PXSelectReadonly.

    In my project I had the following situation. PXSelect of table name didn't give me what actually was in db. After a long research I found PXSelectReadonly and key difference is that PXSelectReadonly reads directly from db without usage of Acumatica Cache.  more

  • Create new instance of graph in Acumatica

    Hello,

    today I want to note how to create new instance of Graph. Lets say you need to create instance of graph PRPaySlipManager.

    In that case you can get instance of that graph in the following way:

    PRPaySlipManager manager = PXGraph.CreateInstance<PRPaySlipManager>(); more

  • Filegroup reference and partitioning scheme' is not supported in this version of SQL Server

    Hello everybody,

    I want to share how to fight with error:

    Filegroup reference and partitioning scheme' is not supported in this version of SQL Server.

    Today I wanted to move Acumatica to SQL Azure and faced that error message. After research I found that I have to remove the two "ON [PRIMARY]" parts of the create statement and it will work. I mean creating of db more

  • What is tstamp

    Hello everybody,

    I want to share what is purpose of field TStamp in database for tables in Acumatica. In reality you can make projects without it, but. If you add it, you'll help Acumatica with concurency management more

  • RowInserting and RowInserted difference in Acumatica

    Hello everybody,

    now I want to share with you difference between RowInserting and RowInserted events.

    The RowInserting event happens before the new data record is actually inserted into the cache but after all field events happen for this data record. The RowInserted event happens after the actual insertion. If you change the data fields of the data record that you insert in a RowInserting event handler, no field events will be raised for these data fields. You use the RowInserted event to do something after a data record is inserted into the cache. For example, you can use a RowInserted event handler of the master data record to add a default detail data record.

    Sample of RowInserting: … more

  • How to add buttons Refresh Add Row, Delete Row, Fit To Screen in Grid of Acumatica

    Hello everybody,

    Imagine that you crated in your page Grid, and when opened it at page can't notice buttons Refresh Add Row, Delete Row, Fit To Screen in Grid. I believe it can be puzzling how to add those buttons to screen as it was for me at once.  Add to your grid following line:

     SkinID="Details"

    For example it can look like this:

    <px:PXGrid ID="PXGrid1" runat="server" DataSourceID="ds" TabIndex="-8036" AdjustPageSize="Auto" AllowPaging="True" Height="200px" Width="100%" SkinID="Details" KeepPosition="True" MatrixMode="True"  SyncPosition="True">

    If you add those attributes, you'll see those buttons. more

  • The Structure of a Strategy Program in LUA

    Hi all,

    I continue investiaging another area of knowledge of humankind, which is FXCM trading Station.

    So, if you need to write strategy, you'll need following methods to be defined in your strategy: 

    Init()

    Prepare(nameOnly)

    Update()

    ReleaseInstance()

    AsyncOperationFinished(cookie, successful, message, message1, message2)

    CheckParameters(parameters)

    ChangeParameters()

    Now little bit details:

    The Init() function of the strategy is called once, when the host application has just loaded the strategy into the memory. In this function the strategy must create profile. Profile is the information which is required for creation of the strategy: strategy name and description and … more

  • CompanyID may not be empty

    Hello everybody.

    In case if you want to add some table to Acumatica with compnayid field, and suddenly you can't save it, check weather you configured default Value or Binding in db. It should be ((0)) like on the screenshot:

    I noticed it only recently while coping with error message about company id more

  • PXDefault PXParent in Acumatica

    Hello everybody,

    today just quick fact. In master-detail DAC and Graph there are used attributes PXDBDefault and PXParent. For me it was interesting to know, that PXDBDefault is intended for initializing values and PXParent is intended for cascade deleting of rows. more

  • Acumatica epic failed or captions at page not appear

    Hello everybody.

    I want to share with whole world a story. In the begining of this month I created web form. Added there some controls. Today I wanted to add one another control, and after my addition miracously controls at page disappeared. I was surprised, looked for ways to solve problem, and after wasted hours I decided to remove and add control again. Try to imagine my shock, when caption of DAC appeared back on page!!!!. So next time if caption disappears just remove and add control at "Page Layout" and it maybe will appear. I have no comments, just plenty of negative emotions. more

  • How pages in acumatica work

    Hello Everybody.

    Today I will speak about some trivial matters, which I found during usage reflector while analyzed received source code of acumatica.

    So lets go on.

    Each page of acumatica as base class PX.Web.UI.PXPage.

    Base page has the following declaration:

    public PXDataSource DefaultDataSource; 

    This explains why we need to describe graphe for DataSource. 

    Inside of disassembled code I found method IsPageCustomized, which looks in folder CstPublished in order to ched did page was customized.

    Another interesting feature is method OnInit which is overrided. It means that Acumatica adds controls to page by itself which is correct from viewpoint of ASP.Net pages lifecycle.

    But let … more

  • Acumatica modification existing tables with prefix Usr

    Hello everybody,

    today just a short hint. In case if you want to add some column in Acumatica DB, you should start field from usr prefix. For exaple if you want to add field Payrollcat, you should name it UsrPayrollcat. If you'll not use this advice, next update of Acumatica will remove your field, and you'll be very sad.

    For example you can use following template of code:

    IF EXISTS (SELECT * FROM SYS.columns WHERE name = N'UsrPayrollcat' and object_id = OBJECT_ID(N'PRPayrollDetails'))

    BEGIN

    PRINT 'EXISTS'

    END

    ELSE

    BEGIN

    Alter table PRPayrollDetails

    ADD UsrPayrollcat nvarchar(1) NULL

    PRINT 'Column UsrPayrollcat was … more

  • Add button to grid in Acumatica

    Hello everybody,

    today I want briefly share how to add button to Grid in Acumatica. Actually button without any dialogs. Just button with posibility to run C# code.

    Lets say you have grid, and want name for button Calculate. 

    Then in graph you should write something like this:

    public PXAction<PRPayroll> Calculate;

    [PXButton]

    [PXUIField(DisplayName = "Calculate")]

    public virtual IEnumerable calculate(PXAdapter adapter)

    {

    return adapter.Get();

    }

    And in grid something like this:

    <ActionBar ActionsText="True">

    <CustomItems>

    <px:PXToolBarButton>

    <AutoCallBack Command="Calculate" Target="ds" >

    </AutoCallBack>

    </px:PXToolBarButton> … more

  • Master details step by step

    Hello everybody,

    today I want to share how to implement master detail form step by step starting from small. So, recently I was in situation when I created form, generated DAC, created aspx page, and got some errors. When I asked support for help, they informed me that they will help me only one hour for free, and another hours for $$$$. I need to say that I appreciate communication with Acumatica support team, and I even ready to pay to them, but should admit it's not always easy to me. 

    So I decided to make another option. 

    1. Create very simple tables

    2. Create very simple DAC

    3. Add complication logic.

    Few words what means very simple. In my terms very simple is Table with key and … more

  • Saving changes are not permitted. Because the changes you have made require the listed tables to be dropped and re-created

    Small hack.

    If you modify table in Microsoft SQL Server Management Studio, it sometimes says something like 

    Saving changes is not permitted. The changes you have made require the following tables to be dropped and re-created. You have either made changes to a table that can't be recreated or enabled the option Prevent saving changes that require the table to be re-created. 

    Do you know where mentioned option is hidden?

    Tools -> Options -> Designers -> Table and DAtabase Designers. Find there checkbox Prevent saving changes that require table re-creation, remove checkbox and enjoy results. more

  • Lua for FXCM Trade Station

    Hello everybody,

    today I will share with you adventure of learning writing something for Trade Station from FXCM and some other trading companies.

    I got one request from client to write for him expert advisor, and it should be for Trade Station in lua, and not in mql4.

    I can't say that I was happy, but customer is sacred think, so I started.

    Initially I read the manual and realized that lua is simple language with C like syntax. AFAIK C, I decided to look how to develop EA.

    So I created file "matrade.lua" which was empty. 

    Then in trade station I made the following:

    Pressed at button import and pointed to my file:

    and as result got error message

    For me it meant following. In … more

  • Acumatica PXSplitContainer

    Hello,

    I want to share some discoveries about attributes of PXSplitContainer.

    <px:PXSplitContainer runat="server" ID="sp1" SplitterPosition="300" Height="100px">

    SplitterPosition="300" means that first item will have height 300 pixels

    Height="100px" I didn't notice any changes at page, so I have no idea, why on Earth it is. more

  • CreatedByID cannot be null in Acumatica

    Hello everybody,

    today I want to share how to cope with error message CreatedByID cannot be null and CreatedByScreenID cannot be null, and so on. In order to get rid of

    those error messages use attributes [PXDBCreatedByID], [PXDBCreatedByScreenID],

     [PXDBCreatedDateTime], [PXDBLastModifiedByID], [PXDBLastModifiedByScreenID], 

     [PXDBLastModifiedDateTime], [PXDBTimestamp]. 

    If somebody has a question, how I got such error message, the answer is simple. DAC generator generated those fields for me without those attributes, so only with the help of reflector I realized how to fix my issue. more

  • Cannot insert explicit value for identity column in table when identity_insert is set to off in Acumatica

    Hello everybody,

    today I received the following error message in Acumatica:

    Cannot insert explicit value for identity column in table when identity_insert is set to off.

    After executing SQL

    SET IDENTITY_INSERT table off

    problem wasn't solved, so I needed to search deeper. After attaching with SQL Profiler, I noticed that Acumatica generated SQL, which tried to insert null into key field. Then was time to look in manual. 

    And then I noticed that for key fields statement IsKey = true is not used. Instead is used 

    [PXDBIdentity]

    So I replaced [PXDBInt(IsKey = true)] with [PXDBIdentity] and problem disappeared. more

  • GoFirstRecord and Configuration screens in Acumatica

    Hello everybody,

    today I want to share with you one of my mistakes. 

    Few days ago I started to develop Configuration screen, or screen which should end at xx101000. After I completed it and passed for testing I faced a challenge. The page should display only the first record. So I implemented some logic which selected the first record. After that I re-read one of the manuals and found that DataSet have property PageLoadBehavior which can be set to GoFirstRecord!!!!

    After I removed my code which loaded first record, and added beforementioned property my configuration screen behaved as really configuration screeen.  more

  • Saving complex objects in Acumatica

    Hello everybody,

    today I want to share one nesessary step which is needed for graph in order to save graph which has more then one DAC ( data access class ).

    In my case I have DAC PRPayRoll, which is joined with classes PRPayrollDetails, PRPaySlip, PRTran.

    In that case it is needed to mention in graph declaration primary dac.

    So instead of writing 

    public class PayRollManager : PXGraph<PayRollManager>

    I wrote

    public class PayRollManager : PXGraph<PayRollManager, PRPayroll>

    Where PRPayroll is primary DAC. Or if to quote Acumatica manual PRPayroll is primary DAC for business logic container more

  • Failed to subscribe event CacheAttached in graph

    Hello everybody, who follows my blog.

    Today I want to share with you some surpsise of Acumatica which taken me some time. 

    In one of my graphs I added CacheAttached event in order to modify way of displaying title. As outcome I got something like this:

    Failed to subscribe event Graph::Table_Row_CacheAttached in graph Graph. Method signature looks like event handler, but cache Table has not been found in the list of auto initialized caches.Remove unused event handlers from code.

    Let's assume that Table name is BAccount. 

    It is possible to solve with the following statement:

    [PXHidden]

    public PXSelect<BAccount> HiddenBacount;

    The following statement added BAccount into list of auto … more

  • 11 lessons you will never learn in School

    Hello Everybody,

    I want to share what I found here some ideas:

    RULE 1: Life’s not fair. Get used to it

    You could be the smartest, hardest working most noble person alive and still not get that A. Or promotion. Or the girl, whatever floats your boat. The sooner you stop expecting life to hand you the things you think you “deserve”, the easier it will be to bounce back in those times when life knocks you down and just keeps kicking. You could earn your way to that promotion and still have it snatched from under you – get over it. That doesn’t mean sit back and take it. It means that you need to learn from those ugly situations and better position yourself to reap the benefits of your … more

  • Rename created grid column in Acumatica for specific graph only

    Hello everybody,

    today I want to share trick about renaming item in grid. Suppose you want to use developed by Acumatica data access class of acumatica, which has name BAccount, and you have huge desire to rename it in column from "Account name" to "Employee Name".

    You can use for such purpose CacheAttached event. In my case following code helped to achieve renaming:

    [PXDBString(60, IsUnicode = true)]

    [PXDefault()]

    [PXUIField(DisplayName = "Employee Name", Visibility = PXUIVisibility.SelectorVisible)]

    [PXFieldDescription]

    [PXMassMergableField]

    protected virtual void BAccount_AcctName_CacheAttached(PXCache sender)

    {

    } … more

  • MQL4 round numbers Indicator

    Hello everybody,

    Today I want to share with you another area. I had small order for MQL4 indicator for round numbers for Metatrader4 or as it is named MT4. The task was to draw lines at screen with some step at any currency pair. In order to implement it I started first of all Googling. Then I found almost implemented indicator at forexfactory just without option for modification steps. After wondering about code purpose of variables I created the following code:

    //**************************************************

    //* RoundNr.mq4 (No Copyright) *

    //* *

    //* Draws horizontal lines at round price levels *

    //* … more

  • SQL Formatting tool

    Few days ago I faced following challenge. SQL profiler gave me ugly SQL, which was unreadable for my eyes.

    For example like this:

    exec sp_executesql N'SELECT APAddress.AddressID, APAddress.VendorID, APAddress.VendorAddressID, APAddress.IsDefaultAddress, APAddress.RevisionID, APAddress.AddressLine1, APAddress.AddressLine2, APAddress.AddressLine3, APAddress.City, APAddress.CountryID, APAddress.State, APAddress.PostalCode, APAddress.IsValidated, APAddress.tstamp, APAddress.CreatedByID, APAddress.CreatedByScreenID, APAddress.CreatedDateTime, APAddress.LastModifiedByID, APAddress.LastModifiedByScreenID, APAddress.LastModifiedDateTime FROM APAddress APAddress WHERE (APAddress.CompanyID = 2) AND … more

  • Acumatica customization without Acumatica GUI

    Hello.

    Today I want to share some information about Acumatica customization.

    Suppose, you want to change your pages not via Acumatica UI, but via Visual Studio. Reasons why you can have such desire can be the following:

    1. Visual Studio is faster then Acumatica UI

    2. You can put your changes under source control

    3. You can easily exchange changes with your co-workers

    Let's say you have following situation.

    1. You need to make changes to pages ar301000.aspx and  pm301000.aspx and pm304000.aspx.

    2. You need to add new page AP508000.aspx.

    3. You want to include dll, which is named DS.dll.

    In order to do this you'll need the following.

    1. Create in your Acumatica instance folder  … more

  • Screen Numbering in Acumatica

    Hello everybody.

    Today I want in short share screen numering in Acumatica.

    Let's say we have screen number like this: xx.yy.zz.tt

    in that case

    yy is screen sequential number

    zz is screen type: 10 - setup, 20 - Maintenance, 30 - data entry, 40 - inquiry, 50 - processing, 60 - reports.

    tt is sub screen sequential number

    more

  • Acumatica unit test

    Hello readers of mine blog.

    Today I want to share with everybody who wants to make unit test of Acumatica how I achieved it.

    For unit testing I use NUnit. In order to start my work with Acumatica Unit testing I wrote the following class:

    [TestFixture]

    public class CATranEntryExtTest

    {

    [Test]

    public void TestAutonumber()

    {

    var gr = PXGraph.CreateInstance<CATranEntry>();

    }

    }

    Now with help of Resharper let's start debugging:

    And here we go, the first error message:

    PX.Data.PXProviderException : Provider cannot be instantiated.

       at PX.Data.PXDatabase.get_Provider() in c:\Builders\4_10-2013_12_16-23_17_15-Full\ … more

  • Acumatica security

    Hello,

    this post is dedicated to understanding how security in Acumatica works. If to be precisive security of accounts. 

    Let's say you need in some way filter accounts for some user according to configuration at row level security screen ( GL104000 ).

    In my case I had following records in database which correspondent to the following numbers:

    Relation group mask : 16; 0; 0; 0

    User group mask: 159; 96; 0; 0

    Account group mask: 16; 0; 0; 0

    How to join them? They are joined not by separated table, which has relations between groups and accounts or groups and users, but with usage of bit mask. It's very effective way to join and is much faster then holding adta in db. But the most … more

  • Autonumbering in Acumatica second way

    In one of my previous posts I described how to add autonumbering to acumatica. Described method will work pretty well, if you don't have any pop-ups which also need to have autonumbering. In case if you have such pop-ups, then it is different story.

    My next assignment on the job was to add autonumbering to the screen "Fund Transfers" which is marked as "CA301000" to the field Document ref at three places:

    The first two places are "Document ref" at the form. Third place or pop-up window will appear, if you press at button Add Expense. So my task was to make autfill of those text fields with some id. 

    For adding some init options to some fields at form we need to use following convention: … more

  • I want 3D printer

    I want 3D printer

    https://www.youtube.com/watch?feature=player_embedded&v=FGSo_I86_lQ more

  • Copy entry types via web services in Acumatica from one instance into another

    Hello everybody.

    Today I want to share how to copy Entty Types items in acumaticca from one instance into another instance.

    The first step was to create import export settings in both instances of acumatica as described in acumatica manual similar to this screenshot:

    The second step was to create project, which I decided to make as windows forms application with the following input fields:

    For the button click at entry types write the following:

    var context = new ImportEt.Screen

    {

    CookieContainer = new CookieContainer(), AllowAutoRedirect = true, EnableDecompression = true, Timeout = 1000000, Url = txtFrom.Text

    }; … more

  • LiqPay for nopcommerce version 3.2

    Hello everybody who is reader of my post.

    As it was requested, I created also version of liqpay for nopcommerce of version 3.2. In case if you need it you can enjoy. 

    For downloading of new module you can  click here.  

    In case if you want to express your thankfullness, you can do it here:

    http://payment.zaletskyy.com/send-600 just enter some price and choose currency which is convenient for you.

    Also at forum: http://payment.zaletskyy.com/boards/forum/1/liqpay you can express your proposals in any convenient language for you.

    If to compare versions 3.1 and 3.2 they have some small differences, and the biggest difference is in the interface IPaymentMethod and as result in processor  … more

  • Nopcommerce liqpay payment module

    Hello everybody.

    Today I just want to share with everybody liqpay payment module for pryvatbank. Pryvatbank is Ukrainian bank which makes possible to accept credit cards payments on your web site. If you'll install nopcommerce, then you can use my payment module absolutely for free. Later  I will modify this article with description of process of development.

    You can Download  it and use it for your own. 

    For downloading of 3.2 module you can  click here.  

    If you wish to support future extensions of this module, you can do it here.

    Web sites which use this module:

    http://abc-device.com

    http://payment.zaletskyy.com/en/

    If you use this module as well let me know in comments more

  • Autonumbering in Acumatica

    Today I want to share with you how I implemented autonumbering feature in acumatica for page CA304000.

    My task originally was the following: add autonumbering feature to the "Document Ref" field with following rules:

      a. step of incrementing is 1

      b. length of field should be six characters. For example 000001, 000002, ... ,  000223,  001024, ..., and so on

    First of all I want to state that my way of adding much simpler then "canonical" ( according to acumatica manuals ) way of adding autonumbering.  If you wish to use standard way you should accomplish so many steps that I should admit that my brain wasn't able to boil them in one project. 

    Instead of this I used the following steps. … more