19626
2023-10-07 988f9735377909b6310301e582c15804e004783f
force-app/main/default/lwc/lexNewOpportunityAgency/lexNewOpportunityAgency.js
@@ -9,6 +9,9 @@
import queryForRecords2 from '@salesforce/apex/OpportunityLightingButtonController.queryForNewOpportunityAgencyButtonToRecords2';
import { NavigationMixin } from 'lightning/navigation';
import { encodeDefaultFieldValues } from 'lightning/pageReferenceUtils';
import lwcCSS from '@salesforce/resourceUrl/lwcCSS';
import {loadStyle} from 'lightning/platformResourceLoader';
export default class LexNewOpportunityAgency extends NavigationMixin(LightningElement) {
    @api recordId;
    agency1Id;
@@ -41,6 +44,10 @@
        }
    }
    connectedCallback(){
        Promise.all([
            loadStyle(this, lwcCSS)
           ]);
        init({
            recordId: this.recordId
        }).then(result=>{
@@ -206,8 +213,21 @@
                                            // + encodeURIComponent(this.opportunityCategory);
                                            // console.log(url);
                                            // window.open(url);
                                            if(this.closeForecastedDate){
                                                if(!this.closeForecastedDate.includes(' ')){
                                                    this.closeForecastedDate += ' 00:00:00'
                                                }
                                                this.closeForecastedDate = this.closeForecastedDate.replace(' ','T').replaceAll('/','-') + '.000Z';
                                                console.log(this.closeForecastedDate);
                                            }
                                            if(this.bidPlannedDate){
                                                if(!this.bidPlannedDate.includes(' ')){
                                                    this.bidPlannedDate += ' 00:00:00'
                                                }
                                                this.bidPlannedDate = this.bidPlannedDate.replace(' ','T').replaceAll('/','-') + '.000Z';
                                            }
                                            const defaultValues = encodeDefaultFieldValues({
                                                Name: '(OLYMPUS)',
                                                Name: '(OLYMPUS)' + this.name,
                                                Close_Forecasted_Date__c: this.closeForecastedDate,
                                                Bid_Planned_Date__c: this.bidPlannedDate,
                                                OCM_Change_To_Opportunity_Flg__c: '1',