You need to sign in to do that
Don't have an account?
DBAgent Gatan
LWC Quick Action Display a Message
When running the below code I am receiving this error and I am not sure why?
[LWC component's @wire target property or method threw an error during value provisioning. Original error:
[{(intermediate value)}.then is not a function]]
import { LightningElement, api, wire } from 'lwc';
import SubmitQuoteForApproval from '@salesforce/apex/lwcSubmitQuoteForApproval.SubmitForApproval';
const FIELDS = ['SBQQ__Quote__c.SBQQ__LineItemCount__c','SBQQ__Quote__c.Special_Lines_Roll_UP__c'];
import { getRecord } from 'lightning/uiRecordApi';
import { ShowToastEvent } from 'lightning/platformShowToastEvent';
import { CloseActionScreenEvent } from 'lightning/actions';
export default class lwcSubmitQuoteForApproval extends LightningElement {
quote;
@api recordId;
@wire(getRecord, { recordId: '$recordId', fields: FIELDS })
wiredRecord({error,data }) {
if(data) {
this.quote = data;
if(this.quote.fields.SBQQ__LineItemCount__c == 0){
this.dispatchEvent(
new ShowToastEvent({
title: 'Get Help',
message: 'Salesforce documentation is available in the app.',
variant: 'warning',
mode: 'pester'
})
);
}
SubmitQuoteForApproval, ({idQuote:'$recordId' })
.then(result => {
//process success toast
showErrorToast()
})
}
}
closeAction(){
this.dispatchEvent(new CloseActionScreenEvent());
}
}
[LWC component's @wire target property or method threw an error during value provisioning. Original error:
[{(intermediate value)}.then is not a function]]
import { LightningElement, api, wire } from 'lwc';
import SubmitQuoteForApproval from '@salesforce/apex/lwcSubmitQuoteForApproval.SubmitForApproval';
const FIELDS = ['SBQQ__Quote__c.SBQQ__LineItemCount__c','SBQQ__Quote__c.Special_Lines_Roll_UP__c'];
import { getRecord } from 'lightning/uiRecordApi';
import { ShowToastEvent } from 'lightning/platformShowToastEvent';
import { CloseActionScreenEvent } from 'lightning/actions';
export default class lwcSubmitQuoteForApproval extends LightningElement {
quote;
@api recordId;
@wire(getRecord, { recordId: '$recordId', fields: FIELDS })
wiredRecord({error,data }) {
if(data) {
this.quote = data;
if(this.quote.fields.SBQQ__LineItemCount__c == 0){
this.dispatchEvent(
new ShowToastEvent({
title: 'Get Help',
message: 'Salesforce documentation is available in the app.',
variant: 'warning',
mode: 'pester'
})
);
}
SubmitQuoteForApproval, ({idQuote:'$recordId' })
.then(result => {
//process success toast
showErrorToast()
})
}
}
closeAction(){
this.dispatchEvent(new CloseActionScreenEvent());
}
}
You have to use '.' instead of ',' in the below code:-
SubmitQuoteForApproval.({idQuote:'$recordId' })
.then(result => {
//process success toast
showErrorToast()
})
Please mark it as Best Answer if it helps you.
Thanks & Regards
Suraj Tripathi