today I want to leave another post related to getting Acumatica. There is one more way of gettinc current company id. For this purpose you can use class of Acuamtica named SharedFunctions.
It has plenty of interesting staff, as well as getting Current company id. Take a look on it:
var companyId = SharedFunctions.GetCurrentCompanyId();
today I want to tell you about interesting class in Acumatica: CustomizationPlugin. Take a look on how reflector shows it's source code:
public abstract class CustomizationPlugin
public virtual void OnPublished()
public virtual void UpdateDatabase()
public void WriteLog(string msg)
As you can see, this class has three methods:
Each of those events allows you to update Acumatica after some events happening. For example after publish, on stage of updating database, and also you can use it … more
today I want to leave short note on how to override and call CreatePaymentProc method of Acumatica which I discovered today with Naveen from Kensium.
My favorite way of overriding methods in Acuamtica with usage of Action and passing there parameters doesn't work. That is because Acumatica uses in method CreatePaymentProc out modifier. Due to this, delegate declaration is needed.
After some efforts and refactorings we found following code that is working:
public class SOOrderEntryExt : PXGraphExtension<SOOrderEntry>
public delegate void CreatePaymentBase(SOOrder order, out PXGraph target, string paymentType);
public virtual void … more
today I want to describe interesting case. Recently I was asked to increase length of Customer ID at page AR303000.
As usually such tasks can be achieved via creating extension to DAC class with setting new length,
and with SQL statement that increases length of column. But that is not the case with Customer ID. That is because
Customer ID is Segmented Selector. And everything related to segmented selectors should be managed
at page Segmented Keys page ( CS202000 ). All that is needed to be done is increasing the Length field of segmented keys.
Other approaches can lead to corruption of segmented keys. Especially if you decide to do it in database with DB scripts. … more
today I want to leave another portion of SQL Server optimization for Acumatica database. In case if your db become huge, and you want to make it smaller, you can try following SQL code:
DECLARE @Table NVARCHAR(128)
DECLARE @Database NVARCHAR(128)
DECLARE @Command NVARCHAR(500)
PRINT N'Shrinking database files'
PRINT N'Rebuilding all indexes'
SET @Database = DB_NAME()
SET @Command = 'DECLARE TableCursor CURSOR FOR SELECT ''['' + TABLE_CATALOG + ''].['' + TABLE_SCHEMA + ''].['' +
TABLE_NAME + '']'' as TableName FROM [' + @Database + '].INFORMATION_SCHEMA.TABLES
WHERE TABLE_TYPE = ''BASE TABLE'''
OPEN … more
today I want to share with you SQL statement that may help you to find sizes of tables occupied by Acumatica. It goes below:
t.NAME AS TableName,
s.Name AS SchemaName,
p.rows AS RowCounts,
SUM(a.total_pages) * 8 AS TotalSpaceKB,
CAST(ROUND(((SUM(a.total_pages) * 8) / 1024.00), 2) AS NUMERIC(36, 2)) AS TotalSpaceMB,
CAST(ROUND(((SUM(a.total_pages) * 8) / 1024.00 / 1024.00), 2) AS NUMERIC(36, 2)) AS TotalSpaceGB,
SUM(a.used_pages) * 8 AS UsedSpaceKB,
CAST(ROUND(((SUM(a.used_pages) * 8) / 1024.00), 2) AS NUMERIC(36, 2)) AS UsedSpaceMB,
(SUM(a.total_pages) - SUM(a.used_pages)) * 8 AS UnusedSpaceKB,
CAST(ROUND(((SUM( … more