Adding a task via SQL
Working on getting some very custom intigrations working again after an upgrade from 8 to 10.
I originally had some code that added Appointements to projects that worked using the old VBScript toolset.
Now I wanted to switch this over and just add it using straight SQL (Microsoft SQL)
When I do this I create the record in the APPOINTMENT table with an ID of the MAX Current ID +1
Then Create the record for that ID in the TRAVELTRANSACTIONLOG for that ID.
I make a record in the VISIBLEFOR table and again the TRAVELTRANSACTIONLOG table according to the documentation.
Everything is displayed correctly but I can not add a new Appointent in the UI till I delete it.
Assuming because it is trying to add it with the ID I just added.
Is there another table controling the IDs I need to update so the system will grab the next avalaible?
The Table COUNTERVALUE is completly empty. FYI
Thank You,
Jeff
Alle Antworten (2)
Hi,
It is not the recommended way of adding data to SO directly via SQL(will be hard to migrate to SO-online and maybe also maintain), but if one has to, you need to be aware of the sequence table and possibly alos other tables.
sequence table | SuperOffice Docs
next id shoud be fetch from that table and then also ticked up by +1 after saving appointment. (in admin you could correct "next-numbe" to max-id in appointment table + 1)
You could trace a GUI-creation o an appointment in SQL and see what tables it touches, and what code is run.
Without knowing your specific case maybe CRM-script could replace your old VB-script..
//Anders