We are trying to build an external application in ASP.NET (C#) for Service Manager. The application would get debtor and invoice details and user can select the item to return.
The issue we are facing is when writing the information to Jiwa.
We set the value we want to change (for eg. JobNo) and then Save(), it does not save the information in the database and hence is not reflected when the data is read again. The code used is as follows:
- Code: Select all
JiwaFinancials.Jiwa.JiwaServiceManager.Job smjob = Manager.Instance.BusinessLogicFactory.CreateBusinessLogic<JiwaFinancials.Jiwa.JiwaServiceManager.Job>(null);
smjob.Find(JiwaFinancials.Jiwa.JiwaApplication.IJiwaNavigable.ReadModes.Actual, "SM_Jobs.JobNo", "123456", "");//Searching for the entry with the specified Job Number
smjob.JobNo = "654321"; //Set new job number
DisplayLabel.Text = smjob.JobNo; // Displaying the new Job number (it shows the changed job number).
smjob.Save();
If we restart the application or check in database, the value does not change.
Tried another method for reading the values and it gives same result (i.e. does not save the information):
- Code: Select all
smjob.Read("RecIDoftheJob");
smjob.JobNo = "654321"; // Set the new job number.
smjob.Save();
There is another function, Setup() which gives an error saying unable to Add, which caught our attention as the error said:
Add failed. Duplicate key value supplied.
I am hoping that the Setup() will add a new row to the table. If not can you please let us know how to add a new row or create a new job.
Thanks