Back to connectors… Back to Sage 200...

Populate custom table primary key with Sage 200 key value (3 replies)

David F
5 years ago
David F 5 years ago

I have a custom table that is written to by Sage 200. I also need to write to the table from IMan. How do i write to the table's primary key in IMan so that it doesn't clash with Sage 200 and cause a duplicate key error?

Support
5 years ago
Support 5 years ago

David, that's going to be difficult as I am not 100% confident how the IDs are maintained and generated.

However, when you run any insert where the insert requires an ID you get the following two statements per the screenshot.

It would appear that you need to somehow mimic Sage by generating a new ID, updating the Counter table (incrementing by 10), then writing into the actual table.

I thought a SQL function may be able to do this, but SQL doesn't allow user functions to update the database state.

Whilst a stored procedure would definitely achieve this, you wouldn't be get this to work with IMan.

The best I can offer is for you to update read and update the Counter table by a large enough amount and then for each record assign a value less than the value which has been updated to the Counter table.

https://www.realisable.co.uk/wp-content/uploads/2019/02/CounterTable.png
David F
5 years ago
David F 5 years ago

Thank you for advising me.

The other idea that I had would be to develop a custom connector to write to the Sage 200 custom table. I already have code generated via the object store builder that is used by Sage 200 to write to the table and wondered if the custom connector can use the code as well.

Support
5 years ago
Support 5 years ago

A connector would seem a lot of work for a simple update.

I think the database approach is easiest.

Contact

Realisable Software Ltd provides code-free, cost-effective applications integration solutions for SMEs. Our core IMan product is designed to integrate almost any application with a number of Sage solutions and online payment processors.

Looking to purchase IMan, please see our resellers here.

Realisable Software
Ph: +44 (0) 208 123 1017

Copyright © Realisable. All rights reserved.
Realisable is a registered trademark

Close

Request Demo

Realisable Software Ltd provides code-free, cost-effective applications integration solutions for SMEs. Our core IMan product is designed to integrate almost any application with a number of Sage solutions and online payment processors.

Looking to purchase IMan, please see our resellers here.

Realisable Software
Ph: +44 (0) 208 123 1017

Copyright © Realisable. All rights reserved.
Realisable is a registered trademark

Close

Access Downloads

Realisable Software Ltd provides code-free, cost-effective applications integration solutions for SMEs. Our core IMan product is designed to integrate almost any application with a number of Sage solutions and online payment processors.

Looking to purchase IMan, please see our resellers here.

Realisable Software
Ph: +44 (0) 208 123 1017

Copyright © Realisable. All rights reserved.
Realisable is a registered trademark

Close