1

I've added a new field to user.etx called LastLoggedIn_Ext. But getting an error when trying to write to it:

Cannot modify a bean of type User that is in a readonly bundle

My code:

user.Ext_LastLoggedIn = Date.Now

Is there a way to bypass read only bundle so that I can save the time the user last logged into PolicyCenter in the user.etx table?

hakamairi
  • 4,464
  • 4
  • 30
  • 53
iceMan33
  • 359
  • 2
  • 16

1 Answers1

3

You have to add it to writable bundle, for example

gw.transaction.Transaction.runWithNewBundle(\bundle -> {
      var writableUser = bundle.add(user)
      writableUser.Ext_LastLoggedIn = Date.Now
    })
hakamairi
  • 4,464
  • 4
  • 30
  • 53