Code sample: Database V5: Adding
public void ExampleAddNew()
{
using (DatabaseApp dbApp = new DatabaseApp())
{
// NewACObject() creates a new Entity-Object an inializes all Properties with Default-Values,
// defined in iPlus development environment
var newMat = Material.NewACObject(dbApp, null);
newMat.MaterialNo = "123456";
newMat.MaterialName1 = "ExampleAddNew";
dbApp.Material.Add(newMat);
MsgWithDetails msg = dbApp.ACSaveChanges();
if (msg != null)
{
Messages.LogError(GetACUrl(), "ExampleAddNew(10)", msg.DetailsAsText);
dbApp.ACUndoChanges();
}
}
}
Modifier: Mario Žitković / Modified:09.08.2023 08:56