Question

Unlock subject for case

Hello,

currently subject is read-only on the case when you try to send an email from those task buttons.

 

How can I go about unlocking this field? 

I was able to get it unlocked, but when the email actually sends the subject remains unchanged. 

Thanks in advance!

Like 0

Like

1 comments

Dear Tyler,



In order to make the Subject field in email editable please follow the instruction below:

1.  Create a replacing client module for the EmailMessagePublisherPage schema.

2. Override the setListenerEmailData method that sets "enabled" property for the Subject field in the following way:

                    setListenerEmailData: function(data) {

                        this.callParent(arguments);

                        this.set("IsTitleEnabled", true);

                    }

3. Override the getPublishData method  in the following way:

    getPublishData: function() {

                        var publishData = [];

                        var config = this.getListenerRecordData();

                        var relationSchemaRecordId = config.relationSchemaRecordId;

                        publishData.push({"Key": config.relationColumnName + "Id", "Value": relationSchemaRecordId});

                        var body = this.get("Body");

                        var title = this.get("Title");

                        var sender = this.get("Sender");

                        var recepient = this.get("Recepient");

                        var copyRecepient = this.get("CopyRecepient");

                        var blindCopyRecepient = this.get("BlindCopyRecepient");

                        publishData.push(

                                {"Key": "Body", "Value": body},

                                {"Key": "Title", "Value": title},

                                {"Key": "Sender", "Value": sender},

                                {"Key": "Recepient", "Value": recepient},

                                {"Key": "CopyRecepient", "Value": copyRecepient},

                                {"Key": "BlindCopyRecepient", "Value": blindCopyRecepient},

                                {"Key": "Id", "Value": this.get("PrimaryColumnValue")}

                        );

                        return publishData;

                    }

Here we have overridden the method by deleting from the parent method the code that set the generated subject for email in the Case section  - https://prnt.sc/qkvgk1.



The method that generates the default email subject in the Case section is located in the SectionActionsDashboard schema (EmailMessagePublisher package). It's name  "getEmailTitle".

You can check this method in order to change the subject template.



Kind regards,

Roman

Show all comments