I have a use case for a custom send email action.
I have a custom Record called Business Unit, within Business Unit object I have a record for Department 1, a record for Department 2 and a record for Department 3.
Now, what I would like to do create an email action that pre-populates the RelatedTo field on the Email message with the Department based on the running user. Eg: If the User who's clicking the Email action Role = X, then update the pre-populate the RelatedTo field with Department 1.
Now, I've created a custom email action and added tried to add predefined value on the RelatedTo field by entering in the record ID for the business unit, however it won't accept it due to the error:
Formula result is data type (Text), incompatible with expected data type (Lookup(Account,Asset,Asset Relationship,Business Unit,Campaign,Contract,Opportunity,Order,Product,Quote,Solution)).
Looks like it's not possible to add a text value into a Lookup field. I also created a field on the user object which stores their business unit ID, then reference that field in the pre-defined value for the RelatedTO - however still getting the error.
What other options do I have? Am I able to create a custom Send Email screen via Flow that will auto-populate the RelatedTo field for the running user and also allows the user to draft their own email body and update recipients?
PS: I can't use process builder to upload the RelatedTo field after the email record is saved, as this option is not available and the RelatedTo field is "locked" after the email message is not in draft status - the field is also not available in flow either. Also, I'm using Professional edition so don't have access to APEX / VF. The build is done in Lightning interface.
Thanks
2 件の回答
Hi Izaaz,
You definitely do this using URL hack. Please check the below Link also if you can share the code that you tried will be better.
https://www.salesforceben.com/salesforce-url-hacking-tutorial/