My org has workflow for lead that is triggered based on the created user. I created a visualforce form that my users are filling out to create new leads. Is it possible to change the created user?
Three options I thought of:
- Set createdBy value - this doesn't work, it's a read only field
- Use System.runAs - this works only in testing.
- Use apex to login as that user and then create the lead.
The first two options are out, does anyone know if the third will work? Or alternatively, does anyone have any other ideas?