Create payment proc

Hello everybody,

today I want to write a few words about method CreatePaymentProc in graph SOOrderEntry.

Among different features of this method, want to describe that it have for some reason out parameter! Take a look on it's declaration:

public virtual void CreatePaymentProc(SOOrder orderout PXGraph targetstring paymentType = ARPaymentType.Payment)
{

 

as you see, it accepts as a parameter PXGraph. Inside of open part of Acumatica source code there is only one more file, which has similar staff: ServiceOrderCore. Take a look on it:

public static void CreatePrepayment(FSServiceOrder fsServiceOrderRowFSAppointment fsAppointmentRowout PXGraph targetstring paymentType = ARPaymentType.Payment)
{

But similarities not finished. Take notice how those methods utilize PXGraph target. First goes ServiceOrderCore:

ARPaymentEntry graphARPaymentEntry = PXGraph.CreateInstance<ARPaymentEntry>();
target = graphARPaymentEntry;

And second one goes SOOrderEntry:

public virtual void CreatePaymentProc(SOOrder orderout PXGraph targetstring paymentType = ARPaymentType.Payment)
{
	ARPaymentEntry docgraph = PXGraph.CreateInstance<ARPaymentEntry>();
	target = docgraph;

And now you'd probably ask, and so what? How can I use it? One of the very useful ways would be getting graph of ARPaymentEntry after calling of the method. 

In one of my projects it was needed to call method CreatePaymentProc, and persisting of payment but without showing dialog window of creation of Payment. Below goes code how I've achieved it:

 
PXLongOperation.StartOperation(Base, delegate()
{
    PXGraph target;
    Base.CreatePaymentProc(Base.Document.Current, out target);
    var arPaymentEntry = target as ARPaymentEntry;
    //here some additional manipulations may be added to in memory created payment
    arPaymentEntry.Persist();
});

Summary

If you have a need to call method CreatePaymentProc, and then massage data after execution of that method, jast ignore showing pop up window and with help of type casting and additional changes make it. Afterwards call Persist.

 

Acumatica Application Architecuture

Hello everybody,

today I want to leave a short note about Acumatica Architecture. Take a look on this picture:

As you can see from the schema business logic controllers is kind of single source of truth. Acumatica doesn't have dependencies between UI and Web services. Also it means, if you hide something from UI on the page, it will be also hidden from Mobile app.

But want to say about few exceptions as well.

Suppose following scenario. You make a graph, and you know for sure, that from UI standpoint, it's logicall to load some visualization data, but from API call there is no reason to call some piece of code. How to inform Acumatica about it?

For this purpose you can use IsContractBasedAPI method of class graph. It may look like this:

if (!Base.IsContractBasedAPI)
{
    // Do something for UI
}
else
{
    //Do Something for non UI
}

Among other interesting modes of functionality, it is worthy to mention also IsMobile ( do something only for mobile apps ), IsExport ( do something in scope of export scenario ), IsImport ( do something in scope of Import scenario ), IsCopyPasteContext ( do something in scope of copy/paste functionality )

Summary

Taking into account all of these facts, you can be almost certain that in majority of cases Acumatica will execute pieces of logic like on the UI of Acumatica instance. But it will not be 100% times. So next time, when you API call give you data different of what you see in UI, check base source code, maybe there is the issue.

 

Acumatica summit 2020

Hello everybody,

today I want to write a few words or kind of summary of Acumatica summit 2020. 

First of all want to say that for me it was very interesting to see people which have big or even huge desire to make Acumatica grow. 

And also want to post some photos. 

Hackathon

When I thought about Hackathon, I didn't thought that I'll be part of a winning team. I thought that I will have some fun. Make some customization for Acumatica, congratulate the winner and will go home. But to my surprise, here is what I've got:

well, not only myself, but other teammates with me in team Theta. Harsha, Dhiren, Yuriy and Spencer. Guys, it was a huge pleasure to play with you on the one team!

MVP

Another reward which caught me was MVP Developer. It was an honor to get it, and now it stands on my table reminding me about high standards which I have to continue to follow:

that one was also very interesting, but not surprising to get. 

Developer of the year

But to get reward developer of the year was biggest surprise for me. When Mark Franks on one of MVP meetup anounced that someone will get award developer of the year, 

I thought, it definetely will be not me. It should be someone else. And then Rahul appraoched me in the morning, and said, you definetely should be in such and such place tomorrow. 

I've been, and here is what I've got: