Hi,
I have searched and searched but not found the exact answer I'm looking for.
My organisation has about 500 staff users (in User Object) of various profiles and licenses, however they have no associated contact record. We now have a need to create a contact record for all these existing users.
Is there any way to create a custom button / trigger on the User Object, that when selected on an existing user record, would create the new Contact record of a specified record type, pulling in the First Name, Last Name and Email Address from the user record into the new Contact record?
Would this then establish a connection between the two objects and records?
After this is hopefully achieved, I'm then hoping I can do the reverse, where any new staff members are added as a contact and the info supplied would create and map to a new user record where their profile and license could be set and then user activated. Is there a known method for doing this?
Any help here would be much appreciated!
Many thanks.
3 Antworten
Elliot,
This is pretty complicated requirement but it can be done with declarative programming. If you are familiar with visual Workflows or Flows then you can create flow, within flow lookup for a user recoord then create a contact based on the user record info. When you are done creating the flow close it and activate , then copy the flow url from flow details page. Create a custom link on the User object and put that URL in the link you will need to hack url in order to pass User id to the flow like below:
/flow//flow/Flow_TestUserToContact?Var_UserID={!User.Id}&retURL=/{!User.Id}
Var_UserID here is just your variable within the flow, and retURL makes sure you come back to the User's page right after the flow is completed. Dont forget to add this link to the User object page layout.
For the second part of the requirement you can either use Process Builder process to automatically create a user record when certain type of contact is created or you can again use Flow the same way as for the 1st requirement but as you said do in reverse :) the one additional option you will have in contact is instead of custom link you can create custom button if you want. Custom buttons are not supported in User object.
i know it is pretty complicated explanation because requirement is complex :) take a minute to look at it if you need any clarification in any part let me know.
Regards,
Elgun