Contents tagged with Acumatica

  • Customization internals Part 2

    Hello everybody,

    today I want to continue few more details about customization internals. In one of my long time ago posts I've described how to create customization file by yourself without Acumatica engine. 

    Today I want a bit extend my comment with few more details.

    Quite often it is needed to add sql code to your customization. How to do it? Acumatica customizations allows it with usage of projext.xml file. 

    Take a loot at following example:

    <Customization level="0" description=""> <File AppRelativePath="Bin\Blablabla.Acumatica.dll" FileID="d701b330-7c72-4f51-b1ae-75c4e2c02194" /> <File AppRelativePath="Pages\AP\AP306010.aspx" FileID="b9e88968-7f36-4cfc-9383-caed8363c269" /> < … more

  • How to show smart tag in visual studio 2015 for data source in Acumatica

    Hello everybody,

    today I want to share simple trick of how to show smart tag at DataSource control in Acumatica. Recently I had to generate class, and for my disappointment I wasn't able to get window that can generate class for me. So, in order to get that window, following steps are needed:

    1. Go to design mode

    2. In properties window select ds

    3. Press Show Smart Tag keyboard combination - [Shift]+[Alt]+[F10]

    4. Choose anything what you need.

    more

  • PXFilter set up fields only once

    Hello everybody,

    today I want to document in my blog interesting behavior of PXFilter in Acumatica. 

    First of all, few words about it's behavior. If Acumatica sees PXFilter, it will create single record, which will remain only in cache and never will travel to the db. Recently I faced interesting issue, fields from PXFilter DAC object was updated only once. After deep investigation I've found that it is because anything that works with PXFilter shouldn't have any field marked as IsKey. If field is marked as IsKey, it will not be updated after each modification of UI. more

  • New web services features in Acumatica

    Hello everybody,

    today I want to share with you one way of importing data from Acumatica. 

    After many versions of binding to strings Acumatica made really big change in their web service decisions. They made their services more compile time oriented. 

    Adding new web service reference should be done only in the following way:

    1. In  the menu select Project -> Add Service reference

    2. In the Pop up type something like "https://localhost/WebServiceAPITest/entity/Default/5.30.001?wsdl" without quotes.   

    3. Click Go

    4. Here you can feel some freedom, and give namespace which you prefer for your web services.

    5. Click Ok.

     

    Here I want to post way how to get all Stock items with … more

  • Summary of my Acumatica certification

    Hello everybody,

    recently I was asked about my level of knowledge in Acumatica.

    Here I want to make short summary of my Acumatica certificates:

    T100:

    T101  :

    T200:

    T300:

    T900:

    S400:

    Below also goes pdf editions of my certificates ( which I downloaded from acumaticauniversity.com ):

    T900 T101 T100 S400 T300 T200 more

  • How to set current record in Acumatica

    Hello everybody,

    today I want to share one trick which can save you few lines of code.

    Imagine case: you created graph, and want to read something from db, and then set current property of that graph view to some value. How to do it in one line? The anser is simple, with help of Search<>

    For example it can be like this:

    public PXSelectOrderBy<SalesOrder, OrderBy<Asc<SalesOrder.orderNbr>>> Orders;

    ...

    graph.Orders.Current = graph.Orders.Search<SalesOrder.orderNbr>(order.OrderNbr); more

  • How to filter add some info to filter

    Hello everybody.

    Today I want to share notice of how to work with processing screens.

    But of course not in very standard situation. One of my clients requested me the following: he wanted at processing screen to select some items in screen in part 1, then monitor 

    results in part two, and see some totals in part three. 

    As you understand it's not easy to ahcieve this goal only with help of selectors. It is possible with usage of delegates in Acumatica and with usage of it's cache.

    Initial initialization of page was the following:

    [Serializable]

    public class RRCashRequestProcessor : PXGraph<RRCashRequestProcessor>

    {

    public PXCancel<CreatePaymentFilter> Cancel; … more

  • How to work with selector

    Hello everybody,

    today I want to write few words how to work with selectors in Acumatica.

    So, imagine, you have the following selector in Acumatica:

    <px:PXSelector ID="NmbUsrBillPMTask" runat="server" DataField="UsrBillPMTask"/>

    In order to make it work as selector, you need to do the following:

    [PXSelector(typeof(Search<PMTask.taskID>))]

    if you'll do it, you'll receive following selector:

    And if you choose there some value, you'll be able to see id represented as number. In my case it was 727.

    But what if you want to make it more readable?

    Then you can add following part:

    [PXSelector(typeof(Search<PMTask.taskID>), SubstituteKey = typeof(PMTask.taskCD))]

    Then instead of … more

  • Current2 vs Current in Acumatica

    Hello everybody,

    today I want to share note about Current2 and Current in Acumatica.

    Current2 inserts really current value of record, while Current inserts curretly selected value or default. I was surprised, that Current2 inserts exactly the value of record. more

  • Types of redirects in Acumatica

    Hello everybody,

    today I want to note about redirects. In Acumatica you can redirect user to another webpage. Acumatica provides option of redirecting to following scenarios:

    To another page in Acumatica

    To another report

    To any destination url

    Try to gues, how redirections are implemented? As exception. If you consider it as wrong approach, I can partially agree with you. But only partially, because redirecting to antoher page is really some kind of exceptional situation. 

    Below goes code of redirecting to page PM302000 at some TaskID and some projectid selected, which will be opened in new window:

    UsrPMTaskReplace taskRepl = JiraAccountTasks.Current;

    ProjectTaskEntry graph = … more

  • DependOnGrid in Acumatica or how to get currently selected record in grid

    Hello everybody,

    today I want to share one important note, for search of which I've spent for two hours. 

    In grid I've added button in the following way:

    <ActionBar ActionsText="True">

    <CustomItems>

    <px:PXToolBarButton>

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

    </AutoCallBack>

    </px:PXToolBarButton>

    </CustomItems>

    </ActionBar>

    Initially described it in the following way:

    <px:PXDSCallbackCommand Name="RemovePMTask" Visible="False"

    </px:PXDSCallbackCommand>

    Then added code for button in graph, and noticed terrible behaviour. In my action I wasn't able to get currently selected record in grid. After wondering for two … more

  • How to get top 1 record from db in Acumatica

    Hello everybody,

    today I want to share with you one trick that sometime can be useful. Imagine, that you constructed some BQL query and want to get only one record from db with ommiting others or in other words if you need TOP 1. For this purpose you can use SelectSingle method that generates SQL statement with TOP 1 records to return and executes faster. more

  • How to get tstamp in Acumatica

    Hello everybody,

    today I want to shre small note of how to generate timestamp for Acumatica objects ( in case if you use for some reason PXDataBase.Insert or  PXDataBase.Update)

    PXDataBase has public method SelectTimeStamp.

    public static byte[] SelectTimeStamp()

    {

    return Provider.SelectTimeStamp();

    }

    So, in case if you need to put in variable t TimeStamp you can do the following:

    var t = PXDatabase.SelectTimeStamp();

    And variable t will have timestamp more

  • PXAccumulatorAttribute in Acumatica

    Few notes about PXAccumulatorAttribute

    If to inherit from PXAccumulatorAttribute, you'll have access to member _SingleRecord. If to set in constructor to true, you'll configure single record update mode.

    There is PrepareInsert method. This method intended for updating policy for the data fields.

    PrepareInsert is invoked within Persist method, before Acumatica framework generates SQL commands for inserted data records.

    Among paramethers of PrepareInsert method there is PXAccumulatorCollection, which has method Update. In this method it's possible to configure fields which will be updated during PrepareInsert

    Method Update has following policies: PXDataFieldAssign.AssignBehavior. … more

  • How to disable callback from Checkboxes in Acumatica.

    Hello everybody.

    Today I want to share some details about inner kitchen of Checkboxes in grid of Acumatica.

    If to look inside of generated grid of Acumatica with FireFox Dom and style inspector, you can see following structure:

    Item with checkbox is implemented as td, which has div, and has another div. The first level div has data for internal ( Acumatica presentation ),

    and second div, or internal div has data for user display.

    Once I had task to disable callback from checkbox. You may wonder why somebody can have such task. The reason each tick at checkbox made 

    roundtrip to server, called number of delegates, which significantly slowed down perfomance. By the way,  CommitChanges=" … more

  • How to enable disable menu item in Acumatica

    Hello everybody,

    Today I want to share short glimps how to Enable/Disable menu item. Let's some menu. For example it looks like this:

    Suppose, we added menu action Activate in the following way:

    public PXAction<EPEmployee> Activate;

    [PXButton]

    [PXUIField(DisplayName = "Activate")]

    protected virtual IEnumerable activate(PXAdapter adapter)

    {

    }

    // menu action was added like this:

    public override void Initialize()

    {

    Actions.AddMenuAction(Activate);

    }

    Let's say we want to disable menu item Activate. It can be achieved with usage of RowSelected event and SetEnabled function.  In my case I used the following construction:

    protected virtual void EPEmployee_ … more

  • Make PXDefault as not required for input

    Hello everybody,

    Imagine following situation, you added to your DAC field some default value. For example like this:

    [PXDBDate]

    [PXDefault(typeof(AccessInfo.businessDate))]

    public virtual DateTime? FromDate

    And now you have default value as current date. But what, if you don't like to make it required for input. How to achieve this goal? The answer is quite simple, you just need to add PersistingCheck = PXPersistingCheck.Nothing into pxdefault attribute. Like this:

    [PXDBDate]

    [PXDefault(typeof(AccessInfo.businessDate), PersistingCheck = PXPersistingCheck.Nothing)]

    public virtual DateTime? FromDate

    With such changes you can init your values at form, and make it not required … more

  • Select all rows in Acumatica

    Hello everybody,

    today I want to share one simple trick. Sometime in grid you have chekcboxes, and you can have a need to make all of them selected. Here is sample of code which helps with this task:

    <px:PXGridColumn AllowCheckAll="True" AllowNull="False" DataField="Selected" TextAlign="Center" Type="CheckBox" Width="30px" /> more

  • PXFilteredProcessing in Acumatica

    Hello everybody,

    few day ago I was digging in code of CT502000, and found interesting part of code:

    public PXFilteredProcessing<ContractsList, ExpiringContractFilter> Items;

    As usually in my code I use PXFilter, and discovery of PXFilteredProcessing was confusting for me. 

    The first think that I as usually do, if I see something new, it is watching with reflector in declaration of new type. Here it what reflector shows:

    public class PXFilteredProcessing<Table, FilterTable> : PXProcessing<Table> where Table: class, IBqlTable, new() where FilterTable: class, IBqlTable, new()

    This means, that we can pass into PXFilteredProcessing two tables. T200 manual gives an answer why: Provides … more

  • Save DAC class in acumatica to DB

    Hello everybody,

    today I want to note interesting gotcha. Let's say you want to save object to db in Acumatica. You in your code created some DAC item and want to save it to db. And you call Actions.PressSave() method. And you get error. You can get suspection, that maybe you put some wrong data in your DAC class or something like this. 

    But the real reason is different, According to T200 Acumatica manual: " You should not invoke the Persist()method on the current graph instance. You can do it only for a graph instance created in a background operation."  It means that you should create instance of Graph, and in that instance call method Persist. 

    Here is fragment, which I extracted with … more