Here I document some issues for searching of which I spent more then 15 minutes
today I want to write a few words about interesting behavior of PXLongOperation.StartOperation in Acumatica.
On the glance that looks pretty simple and straightforward. You have something processing of which will take a long time? Use PXLongOperation.StartOperation. So imagine, you extend ARPaymentEntry graph like this:
public PXAction<ARPayment> StartOperation;
[PXUIField(DisplayName = "Some long running operation")]
protected virtual IEnumerable startOperation(PXAdapter adapter)
PXLongOperation.StartOperation(Base, () => SomeLongRunningOperation(Base.Document.Current)); return adapter.Get();
In this case you may notice … more
today I want to share with you a piece of code, with help of which you can get list of all activer order types in Acumatica and also you'll get a chance to select those types with checkbox. Take a look on a screenshot below:
how to achieve this?
Code below without description of DAC class gives you this:
protected virtual void _(Events.FieldSelecting<SetupClass, SetupClass.orderTypes> e)
if (e.Row == null)
var orderTypes = SelectFrom<SOOrderType>.Where<SOOrderType.active.IsEqual<True>>.View.Select(this).Select(a => a.GetItem<SOOrderType>())
var allowedValues = orderTypes.Select(a => a.OrderType). … more
sometime it is needed to insert some binary information in one or another table inside of Acumatica. Quite often developers just modify existing record in table UploadFile or UploadFileRevision.
But I don't like such approach, as it is prone to errors and potentially can harm some of your existing data. That's why I propose to use cast operator of MS SQL. Take a look at following example:
insert into UploadFileRevision(CompanyID, FileID, FileRevisionID, Data, Size, CreatedByID, CreatedDateTime, CompanyMask) values
(2, '35b15ad7-b5c3-4a19-aa77-3a24c046d689', 1,
CAST('wahid' AS VARBINARY(MAX)),
'B5344897-037E-4D58-B5C3 … more
today I want to leave one more note, which you can use for boosting your productivity.
Imagine following scenario. On the meeting with customer you've got some list of to do points. You have them on your email. You've made some research, and found that you need to make changes to 5 C# files. How not to forget about all of those files?
On rescue comes two comments in C#:
Leave those comments in your 5 files -> save all files -> Open Task List, and you'll see something like this:
As you can see from presented screenshot, after you leave TODO or HACK comments in 5 C# files, you'll be in perfect position of usage of code.
What is even more interesting, … more
Today I want to describe how to imiate click on menu item "Confirm shipment" in Acumatica.
Probably your first guess will be just call method ConfirmShiment of graph SOShipmentEntry. But for now Acumatica team has another advice in order to call this action. Instead of calling method ConfirmShipment you'll need to have a bit more steps.
Code sample below demonstrates those necessary steps:
SOShipmentEntry shipmentGraph = PXGraph.CreateInstance<SOShipmentEntry>(); //Create instance of Graph
PXAdapter adapter2 = new PXAdapter(new DummyView(shipmentGraph, shipmentGraph.Document.View.BqlSelect,
new … more
today I want to share with everybody, and with myself code fragment, that allows to achieve pagination in custom inquiry pages.
Take a look on the code below:
public class YourGraphInquiry : PXGraph<YourGraphInquiry>
public PXCancel<YourDACFilter> Cancel;
public PXFilter<YourDACFilter> Filter;
recently I've got interesting situation, when my database for Acumatica developed turned to be in Pending condtion. In order to deal with it, I've executed following SQL:
ALTER DATABASE YourDatabase SET EMERGENCY;GOALTER DATABASE YourDatabase set single_userGODBCC CHECKDB (YourDatabase, REPAIR_ALLOW_DATA_LOSS) WITH ALL_ERRORMSGS;GO ALTER DATABASE YourDatabase set multi_userGO
and my database turned back to normal.
Update on 10/08/2019
declare @dbName nvarchar(50);
set @dbName = 'yourDatabase';
exec( 'ALTER DATABASE' +@dbName + ' SET EMERGENCY;')
exec ('ALTER DATABASE ' + @dbName + ' set single_user')
exec ('DBCC CHECKDB (' + @dbName + ' , REPAIR_ … more
today I want to write a short note on three states of fields existing in Acumatica:
Exists but is empty
Exist and have value
If to speak about string, it can exist like this:
Do you see difference between 1 and 3? Not easy. As usually developers of C#, show this difference like this:
And following screenshot with explanation shows how it works in case of SOAP contracts:
so, while you make integration, keep that in mind more
today I want to say few words about new functions for redirect in Acumatica, and particularly about class PXRedirectHelper.
Classical approach from T200/T300 manual may look like this:
var currentCse = Cases.Current;
if(currentCse == null)
var graph = PXGraph.CreateInstance<CRCaseMaint>();
graph.Case.Current = graph.Case.Search<CRCase.caseCD>(currentCse.CaseCD);
if (graph.Case.Current != null)
throw new PXRedirectRequiredException(graph, true, "Case details");
But with new function all of those lines can be simplified to this:
PXRedirectHelper.TryRedirect(Cases.Cache, Cases.Current, "Edit case", PXRedirectHelper.WindowMode.NewWindow); … more
today I want to give one more explanation of how to use caching and slots for caching purposes. Also there are plenty of articles on the subject, I want to give one more with simplest recipe. So, if you need to cache something, you'll need to follow this procedure:
declare you class as something that inherits IPrefetchable
Create some placeholder in your class for storing items in the cache
Take a look on the code below, how it can be done:
public class ArTranFetcher : IPrefetchable
private List<ARTran> _arTranList = new List<ARTran>();
public void Prefetch()
_configurableList = new List<ARTran>(); … more
- « Older