123
chenjingwu
2024-04-11 d29f75b84fccd06917fb8e2c2ee70e9d76f868cd
force-app/main/default/lwc/lexCreateEvent/lexCreateEvent.js
@@ -4,7 +4,7 @@
 * @Author: chen jing wu
 * @Date: 2023-04-13 13:50:23
 * @LastEditors: chen jing wu
 * @LastEditTime: 2023-09-06 14:36:47
 * @LastEditTime: 2023-10-18 21:03:42
 */
import { api, wire,LightningElement } from 'lwc';
import { CurrentPageReference } from "lightning/navigation";
@@ -45,27 +45,29 @@
        })
    }
    createEvent(){
        this[NavigationMixin.Navigate]({
            type: 'standard__objectPage',
            attributes: {
                objectApiName: 'Event',
                actionName: 'new'
            },
            state: {
                // retURL: '/apex/VFClosePage',
                accid: this.accountId,
                oid: this.recordId
            }
        });
        window.open(
            "/apex/SimpleEventRegister?retURL=%2Fapex%2FVFClosePage&accid="
            + this.accountId + "&oid="
            + this.recordId + "&source=AccountPCL&save_new=1&sfdc.override=1");
        this.dispatchEvent(new CloseActionScreenEvent());
    }
    showToast(msg,type) {
        const event = new ShowToastEvent({
            title: '',
            message: msg,
            variant: type
        });
        this.dispatchEvent(event);
        if(type == 'success'){
            const event = new ShowToastEvent({
                message: msg,
                variant: type,
            });
            this.dispatchEvent(event);
            this.dispatchEvent(new CloseActionScreenEvent());
        }else{
            const event = new ShowToastEvent({
                message: msg,
                variant: type,
                mode: 'sticky'
            });
            this.dispatchEvent(event);
            this.dispatchEvent(new CloseActionScreenEvent());
        }
    }
    updateRecordView(recordId) {
        updateRecord({fields: { Id: recordId }});