function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
DBAgent GatanDBAgent 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());
          }
    }
   
   
Suraj Tripathi 47Suraj Tripathi 47
Hi,

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
DBAgent GatanDBAgent Gatan
If i do that it gives me a syntax error