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
|
Problem: My table ctContacts has no unique identifier. Each contact has a userID that its associated with. I need to make a new ctContact and give it the ID of the user. The ID property is readonly how do I change the model to allow it to be changed? |
|
|
You cannot change the ID. The ID is an identifier and once assigned cannot be changed. The escape clause is that "once assigned." What you *can* do is inject your own logic so that when LightSpeed assigns an ID to a new ctContact, it is given the ID of the user. To do that, override the GeneratedId() method to return the userID. Note that the ID must still be unique in the table. If multiple ctContacts can share the same userID, then you will need to add a new column that can serve as a unique ID. |
|