I am passing userid in the url to external public users to fill out a form. On save, I would like to insert the createdby and lastmodifiedby fields as the userid so that the user who sent the link via email will be assigned a task.

Can this be achieved via apex or OOB?

  • Have you done any research? Where are you stuck? This information is out there and pretty easy to search. For instance Enable Create Audit Fields – Adrian Larson Apr 19 '17 at 19:00
  • Yes, I did. the link Enable create audit fields works on dataloading. I'm looking to update the fields to the user who sent the link to public users. But it is setting to Portal External User but not the actual userid(user) who sent the email. – mvr Apr 19 '17 at 19:03

Yes you can just do below step : -

  1. create one new profile and check "Set up Audit trail" check box checked.

  2. then via newly created profile you can update audit fields.

  • I'm trying to update the fields once the record is saved in salesforce(when they click save on the form). Can this be achieved by what you have mentioned? – mvr Apr 19 '17 at 19:06
  • are u using VF page ?? – Avijit Das Apr 19 '17 at 19:09
  • Yes, I'm using a vf public site and passing userid contactid and accountid in the url. A link will be sent to public costumers to fill a form, the records get saved in salesforce when they click save and the auditfields(createdby and lastmodified) should be the actual user who sent the email with link (userid). – mvr Apr 19 '17 at 19:15
  • Can I do this using apex code? – mvr Apr 20 '17 at 18:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.