Hi Friends,
Today i will tell you to how to insert values in acumatica ERP.
The Code below is used to insert data in the acumatica erp. Suppose i want to insert data into the EPApproval table. Here firstly i need to create instance of current class(PXGraph).
 
var maint = PXGraph.CreateInstance<NewTimeActivity>();
 
Here PXGraph is The base type that defines the common interface of business logic controllers (graphs), which you should derive from either PX.Data.PXGraph`1 or PX.Data.PXGraph`2.
Use the below syntax to insert the data into the EPApproval table. You need to specify all the parametrs i am just specifying some parameters.
try
{
var detailsCache = maint.ProviderInsert<PX.Objects.EP.EPApproval>(
           new PXDataFieldAssign("AssignmentMapID", AssignmentMapID),
           new PXDataFieldAssign("WorkgroupID", WorkgroupID),
           new PXDataFieldAssign("OwnerID", OwnerID),
           new PXDataFieldAssign("Status", Status),
           new PXDataFieldAssign("BAccountID", BAccountID),
           );
}
catch
{
//Log the exception
throw;
}
Where ProviderInsert is used to performs a database delete operation. The table is specified as the DAC through the type parameter.
We need to provide all the values for a table which are not null otherwise it will give use exception.
There is another way which acumatica ERP uses i will justify you in my other blog.
References :-  http://adn.acumatica.com/ 
Thanks,    
Happy Coding !!
 
                       
                    
0 Comment(s)