I am upgrading a client to Version 07.02.01.00 SR17 (from SR13).
A failure has arisen in a REST API Custom Routes plugin implementation. This has been updated with the using (var manager = this.Request.GetManager()) change due to the updated REST API plugin, and testing shows the manager appears to be being created successfully.
The error is:
Object reference not set to an instance of an object.
at JiwaFinancials.Jiwa.JiwaODBC.database.BeginNewTransaction(IsolationLevel IsolationLevel)
at JiwaFinancials.Jiwa.JiwaODBC.database.BeginNewTransaction()
at JiwaFinancials.Jiwa.JiwaJournalSets.JournalSet.iSave()
at JiwaFinancials.Jiwa.JiwaApplication.BusinessLogic.Maintenance.Save()
as a result of executing a
- Code: Select all
journalSet.Save();
journalSet is created with:
- Code: Select all
private JournalSet GetOrCreateJournalSet(Manager manager, string description, DateTime postedDate)
{
var journalSet = manager.BusinessLogicFactory.CreateBusinessLogic<JournalSet>(null);
var results = Db.SqlList<GL_Sets>("SELECT TOP 1 * FROM GL_Sets WHERE Description = @Description AND SetType = 2 AND PostDateTime = @PostDateTime", new { Description = description, PostDateTime = postedDate });
if (results.Any())
journalSet.Read(results.First().GLSetID);
else
{
journalSet.CreateNew();
journalSet.Description = description;
journalSet.PostedDate = postedDate;
journalSet.Source = "Local";
journalSet.SetType = JournalSet.SetTypes.Pending;
}
return journalSet;
}
Then has lines added via:
- Code: Select all
var journalLine = manager.CollectionItemFactory.CreateCollectionItem<Line>();
...
journalSet.Lines.Add(journalLine);
I can't spot anything else significant. This works for SR13 (with the older REST API plugin).
Is this enough detail for you to see how I am incorrectly instantiating journalSet and/or journalLine for SR17, or something else I am missing that is now needed?
Cheers,
Neil.