Hi I have a program where there are two domain classes. One that has different properties of my data objects (e.g. People) and another which is a User domain class which checks the login id and password to see if the user is authorized to make changes to the database. In my "People" domain class I have a property field called "createdID". I want to set the login id of person who created a new entry in the database to this field. I have been able to get the login id of the person from my user controller class to my people controller class but how do I set the createdID field of my people domain class to this value?
Asked
Active
Viewed 718 times
1 Answers
0
def peopleInstance = new People()
peopleInstance.createdId = <whatever value you want to set>
peopleInstance.save()

John Moses
- 1,283
- 1
- 12
- 18
-
That almost worked for me but I had to add one more tag in that. It worked for me when i did peopleInstance.properties.createdID=... – Ameya Jul 06 '12 at 18:19