Skip to main content
Izaaz Gaffar (Deloitte) ๋‹˜์ด * Lightning Now! *์— ๊ธ€์„ ์˜ฌ๋ ธ์Šต๋‹ˆ๋‹ค

Hi @* Lightning Now! * 

Hi Guys,

 

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 is 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 tried adding a 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 referenced that field in the pre-defined value for the RelatedTO - however still getting the same 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 field 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 the Lightning interface.

Thanks

 

cc: @Admin Tricks  @* Salesforce Administrators *  @Salesforce Flow Automation @Salesforce Automation Hour 

๋Œ“๊ธ€ 6๊ฐœ
  1. 2018๋…„ 10์›” 31์ผ ์˜คํ›„ 3:50

    I don't think it's possible to set the relatedTo field as you specified.

    There are two kinds of quick actions: object specific and global.

    1) Object specific quick actions don't allow you to change the RelatedTo field.

    2) Global quick actions allow you to change the RelatedTo field, BUT lookup fields like Related To require a reference to the record e.g. current_record.lookup_to_other_record. However, global quick actions only have a handful to references such as User BUT User doesn't support custom lookup fields. Also - I don't think there's a way to use a formula or specify an ID to get a reference to the object either.

    @Vin Addala - can you confirm?
0/9000