How To Provide Data For The Grid In Acumatica Without Persiting It To Db

How to provide data for the grid in Acumatica without persiting it to db.

Hello everybody,

today I discovered for myself new member of Acumcatica. Welcome PXProcessing with it's relatives.

• PXProcessing: allows you to work with data records for processing without filtering. You can use the Where<> and OrderBy<>clauses in this data view type.

• PXProcessingJoin: allows you to work with data records for processing without filtering. You can also use Join<>clauses in this data view type.

• PXFilteredProcessing: allows you to work with data records for processing with filtering. This data type takes two DACs as type parameters, where the second DAC specifies the filter DAC. You can use the Where<>and OrderBy<>clauses in this data view type.

• PXFilteredProcessingJoin: allows you to work with data records for processing with filter. This data type takes two DACs as type parameters, where the second DAC specifies the filter DAC. You can also use Join<>clauses in this data view type.

As you can see the simplest is PXProcessing with which you can work with one DAC.  Other have features as Join, two classes, OrderBy, etc. But if you wish, you can substitute them completely with something that you consider as needed.

No Comments

Add a Comment

Updating Acumatica To Newer Version Of Acumatica

Updating Acumatica to newer version of Acumatica

Hello everybody,

toda I want to share some small notice about what options do you have during updating of Acumatica.

So. Imagine you make update from version 4.2 to version 5.1 and suddenly you have this error message:

Text of error message says, that you have some problems at your db. And you have three options:

1. Abort

2. Retry

3. Ignore.

Initially when I made update I was very scared of that error message and as usually selected Abort, but prior to it copy/pasted error message. It's not very wrong idea, but to execute updater after each error message is little bit slover process. Then I put my attention at another button. Retry. I know it sounds funny, that after some numbers of updates, I noticed that button. But I really liked it. Retry button gives me option during Update to fix troubles in DB, and continue updating process without need of pressing abort, or ignore the problem. Another useful feature is to take into account inner messages, call stack and even script. Those features can help to solve some additional problems, or give more food for mind about which part of db may contain data, which you can't use.

No Comments

Add a Comment

Types Of Redirects In Acumatica

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 = PXGraph.CreateInstance<ProjectTaskEntry>();
graph.Task.Current = Base.Task.Current;
graph.Task.Current.ProjectID = taskRepl.UsrProjectID;

if (graph.Task.Current != null)
 {
    throw new PXRedirectRequiredException(graph, true, "Project Tasks");
}

If to speak more about other kinds of redirects, here it goes full list:

  1. PXRedirectRequiredException. Goes inside of Acumatica to some screen, or opens new one in another window. By default user will stay in the same window.
  2. PXPopupRedirectException. Inside Acumatica will be opened pop-up window.
  3. PXReportRequiredException. Opens report in the same or new window.
  4. PXRedirectWithReportException. This one is really cool because it can open two pages: the specified report in a new window, and the specified application page in the same window.
  5. PXRedirectToUrlException. Specified external page will be opened in a new window. BTW, you can use this exception for opening inquiry page.

No Comments

Add a Comment

Dependongrid In Acumatica Or How To Get Currently Selected Record In Grid

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 hours, I found that I need to add attribute DependOnGrid. After adding that attribute my code started to work well and get posibility to get currently selected record.

But  for getting current record it was nesessary to add DependOnGrid="grdJiraProjects"

<px:PXDSCallbackCommand Name="RemovePMTask" Visible="False" DependOnGrid="grdJiraProjects">
            </px:PXDSCallbackCommand>

No Comments

Add a Comment

Hos To Add List Values To Drop Down In Acumatica

Hos to add list values to drop down in Acumatica

Hello everybody,

today I want to make quick notice of how to make drop down values in Acumatica avalable. 

Let's imagine, that you need following drow down list:

In order to get this kind of list, you can use the following code:

public static class JiraAccountStatusEnum
{
      public const string Open = "O";
      public const string Closed = "C";
      public const string Archived = "A";
}

public class JiraAccountListAttribute : PXStringListAttribute
{
   public JiraAccountListAttribute() : base(
            new string[] {JiraAccountStatusEnum.Open, JiraAccountStatusEnum.Closed, 
JiraAccountStatusEnum.Archived}, new string[] {"Open", "Closed", "Archived"}) { } }

2. In your DAC member class write the following:

#region UsrStatus
public abstract class usrStatus : IBqlField
{
}

protected string _UsrStatus;
[PXUIField(DisplayName = "Status")]
[PXDBString(10)]
[JiraAccountList]
public virtual string UsrStatus
{
   get
      {
        return _UsrStatus;
      }
   set
      {
        _UsrStatus = value;
      }
}
#endregion

3. Finally in your aspx page use the following control:

<px:PXDropDown ID="pxddUsrStatus" runat="server" DataField="UsrStatus"></px:PXDropDown>

That's it what is needed. If you follow steps, mentioned in this notice, you'll get drop down, screenshot of which you've seen.

No Comments

Add a Comment

Machine Learning Certificate From Coursera

Machine learning certificate from coursera

Hello everybody,

I want to boast that I receved certificate from Standfor Univercity about my level of knowledge in Machine Learning.

Here is the link:

https://www.coursera.org/maestro/api/certificate/get_certificate?course_id=973756

and here is screenshot:

No Comments

Add a Comment

How To Get Top 1 Record From Db In Acumatica

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.

No Comments

Add a Comment

What Are Asserts In Nunit

What are Asserts in NUnit

Hello everybody,

just short notice of NUnit function Assert.That

[Test]

public void CheckAddition()
{
  Assert.That(CalculatorClass.Minus (5, 2), Is.EqualTo(3));
}
public void CheckAddition()
{
   //old styel
Assert.AreEqual(3, CalculatorClass.Minus (5, 2));
}

No Comments

Add a Comment

Unit Test Abbreviations

Unit test abbreviations

Hello everybody,

some abbreaviations:

SUT - system under test. AKA as AUT, MUT, CUT.

DUT - device under test

DOC - depend on component

No Comments

Add a Comment

What Makes A Good Unit Test

What makes a good Unit test

Hello everybody,

today some notices of what is considered to be a good unit test.

1. Tests should be independent and isolated.  

For example if you have functions a, b, c tested, then sequence of test shouldn't affect the result. 

2. Each test should test single behaviour or logical staff. 

If to speak about phone example, calling and sending sms shouldn't be in one functoin

3. Clear purpose understood.

4. Don't test the compiler ( like writing/reading to db )

5. Reliable and repetable ( give the same result ).

6. Quality the same as other parts of solution.

7. Valuable for developers

No Comments

Add a Comment