• visraelfs
  • NEWBIE
  • 0 Points
  • Member since 2022
  • Ing

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 1
    Likes Given
  • 1
    Questions
  • 1
    Replies
Hi everyone,

I have a little issue with behavior of quick action. I have a Quick Action referenced to LWC that extends NavigationMixin and open Email Page with ('/_ui/core/email/author/EmailAuthor?) but when i access in first time at page is like if i was click the button and open the email editor without push the button.  I don't know what happen because there aren't more code than this:  
 
import { LightningElement, api, wire } from "lwc";
import { NavigationMixin } from "lightning/navigation";
import { getRecord } from "lightning/uiRecordApi";
const FIELDS = ["ApprovalProcess__c.AccountName__c"];
export default class EmailRouting extends NavigationMixin(LightningElement) {
    @api recordId;
    record = null;
    @api invoke() {
        console.log("invoke");
        if (this.record) {
            this.navigateToEmailComposer();
        }
    }
    @wire(getRecord, { recordId: "$recordId", fields: FIELDS }) approvalProcessWire({ error, data }) {
        if (data) {
            console.log("data");
            this.record = data;
            this.navigateToEmailComposer();
        } else if (error) {
            console.log("error", error);
        }
    }
    navigateToEmailComposer = () => {
        this[NavigationMixin.Navigate]({
            type: "standard__webPage",
            attributes: { url: "/_ui/core/email/author/EmailAuthor?p2_lkid=" + this.record.fields.AccountName__c + "&rtype=003&p3_lkid=" + this.record.id + "&template_id=xxxxxx&retURL=" + this.record.id },
        });
    };
}

I would really appreciate your help
 
best regards

I am new to apex, I am writing an apex class and I have the salesforce id, how do I update the contact record if I have the salesforce id.

Thanks

I am new to apex, I am writing an apex class and I have the salesforce id, how do I update the contact record if I have the salesforce id.

Thanks