wdrone wrote:
I can successfully load my certificate which is composed of amoung other things a status object. The problem arrises when i want to change the status of the certificate. How do i do this?
I have tried CertificateObject.StatusObject.Status="C" but this is trying to edit the Status table which cannot be done because the Status column on that table is the primary key. But that is not the problem. I only want to change the status column in the certificate table and have that change proprogated into a new StatusObject.
Any help will be much appreciated
Correct me if I'm wrong, but I think you meant to write
CertificateObject.Status.Status = "C" by what I can read from your mapping.
Any way, as you correctly pointed out, you are trying to change the primary key and that will be impossible. You have to assign a whole Status object to your certificate's status. You can create a new object or you can retrieve a pre-existing one. Creating a new one may leave the old object hanging in your database and I believe that isn't what you want since "status" seems something limited in number by nature. So, try some code like this:
Code:
Dim StatusID as String = "MYID"
Dim St as Status = Session.Load(GetType(Status), StatusID)
CertificateObject.Status = St
I hope that helps...
Luis