This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
Hi, We have some tables, where newt to primary key we have also another, unique index/constraint. We have table with foreign key pointing not into primary key, but to this other unique index. So let's imagine table Products with column Id (guid, PK) and another column ProductID (unique, string) And foreign key table SoldProducts with column ProductID. Such relation can be defined on SQL Server. When we set-up such relation inside LightSpeed, retrieving data from SoldProducts works fine, but when we are inserting value into ProductID column inside SoldProducts table we are getting errror from internal part of mindscape "Cannot convert string value into Guid". Please advice me what should be configured/changed to make such scenario working. |
|
|
Can you elaborate on how you have configured your model? Is ProductId defined as a guid or string in the database and model for SoldProducts? The FK value will be a Guid.
|
|
|
No, and this exactly is the problem. Foreign key is string and this is value of ProductID. MS SQL Server allows you to define relation between any field with UNIQUE constraint. My question is, if this scenario is supported. |
|
|
No this is not supported, the data type of the property holder for an association (ProductId on SoldProduct) needs to match the identity type of its parent (Id on Product).
|
|