1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
| import { LightningElement,track,api } from 'lwc';
| import { NavigationMixin } from 'lightning/navigation';
| import { ShowToastEvent } from 'lightning/platformShowToastEvent';
|
| export default class NewOrderLWC extends LightningElement(LightningElement) {
| @track
| show = false
| showModal() {
| this.show = true
| }
| Navigate(event) {
| let recordId = event.detail.id
| this.openOrder = false
| this[NavigationMixin.Navigate]({
| type: 'standard__recordPage',
| attributes: {
| recordId: recordId,
| objectApiName: 'Opportunity',
| actionName: 'view',
| },
| });
| this.showSuccessNotification('Saved','New opportunity saved','success')
| }
|
| // toast util method
| showSuccessNotification(_title, _message, _variant) {
| const evt = new ShowToastEvent({
| title: _title,
| message: _message,
| variant: _variant,
| });
| this.dispatchEvent(evt);
| }
|
| cancel() {
| this.show = false
| }
|
| }
|
|