• Santhiya Durai 2
  • NEWBIE
  • 0 Points
  • Member since 2021

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 14
    Questions
  • 6
    Replies
Hi,

I have created a LWC component to create a new Quote. Created a Aura Application and calling a component from Visualforce page. I have created a List button and calling visualforce page.
The issue is when click on list button lightning record edit form is showing but Save & Cancel buttons are not working. If I use lwc alone it is working but within vf page it is not working.
Any idea on what I missed here?
Hi,
I need to create a Quote from Opportunity using Quick Action. Once new quote is created it should navigate to newly created quote record page. Record is getting created but navigation to Quote record is not happening. 
Component:
<aura:component implements="force:lightningQuickActionWithoutHeader,force:hasRecordId">      
<lightning:navigation aura:id="navigation"/>   
 <div class="slds-page-header" role="banner">        
<lightning:recordViewForm recordId="{!v.recordId}"  
                         objectApiName="Opportunity">       
 </lightning:recordViewForm>          
<lightning:messages/>      
<div class="slds-align_absolute-center" style="height:5rem">New Quote</div> 
    </div>    
 <lightning:recordEditForm aura:id="myform" objectApiName="SBQQ__Quote__c"  
                             onsubmit="{!c.handleSubmit}"     
                          onsuccess="{!c.handleSuccess}">        
 <lightning:messages/>         
<lightning:inputField fieldName="Invoice_To__c"/>         
<lightning:inputField fieldName="Ship_To_Location__c"/>        
 <lightning:inputField fieldName="Multi_Site_Quote__c"/>                 
<div class="slds-m-top_medium">             
<lightning:button label="Cancel" onclick="{!c.handleCancel}" />             
<lightning:button type="submit" label="Save" variant="brand"/>         
</div>     
</lightning:recordEditForm>      
</aura:component>

Controller:
({     handleCancel: function(cmp, event, helper)
 {         
$A.get("e.force:closeQuickAction").fire();     
},          
handleSubmit: function(cmp, event, helper)
 {         
event.preventDefault();         
var fields = event.getParam('fields');         
fields.SBQQ__Opportunity2__c = cmp.get("v.recordId");         
cmp.find('myform').submit(fields);     
},          
handleSuccess: function(cmp, event, helper)
 {         
var params = event.getParams();         
var quoteId = params.response.id;         
console.log(params.response.id);      
component.find("navigation")     
.navigate({         
"type" : "standard__recordPage",         
"attributes": {            
 "recordId"      : quoteId,            
 "actionName"    : actionName ? actionName : "view"   //clone, edit, view  
       } 
    }, true);   
  }  
})

Can anyone please correct me what I made wrong?
 
Thanks!

 
Regards
Santhiya
Hi,

I wan't to make a quick action button on an Object, but on click I just need to fire a background record update without opening modal. Is it possible?

Thanks!

Regards
Santhiya 
Hi,
Below is a requirement.
On Quote object need to create a Button called Place Order. On click of that button I want to ask below questions. 
  • Have the quote, products and pricing DOA been approved?
  • Have local shipping guidelines and expectations been communicated to the customer?
  • Has the 'requested ship date' been added (if applicable)?
If then click Yes below the checklist. If a user selects No, an error message should appear not allowing the user to place the order.
The “No” error message should read: “all check list items must be completed prior to placing the order”. 
Below is my code

HTML:
<template>
    <lightning-quick-action-panel header="Place Order">
                     
                <p>{label.doaApprovalsmsg}</p>
                <p>{label.requestedshipdatemsg}</p>
                <p> {label.shippingGuildesmsg}</p>
                <lightning-radio-group
                name="selectionRadioGroup"
                options={toggleOptions}
                value={selectedValue}
                onchange={handleToggleChange}
                type="button"
            ></lightning-radio-group>
             
            <lightning-record-edit-form
   
            onsubmit={handleSubmit}
            object-api-name="QUOTE_OBJECT"
            record-id={recordId} >
            <!--Order Placed Field-->
            <template if:true={showOrderPlaced}>
                <lightning-combobox name="progress"
                label="Place Order"
                value={value}
                placeholder="-Select-"
                options={PlaceOrderPicklistValues.data.values}
                onchange={handleChange} >
              </lightning-combobox>
                               
            </template>
               
                    <footer class="slds-modal__footer">
                        <!-- <div class="custom-footer"> -->
                        <lightning-button class="slds-var-m-around_medium" variant="brand" type="submit" name="save" label="Save" onclick= {handleSuccess} ></lightning-button>
                        <!-- </div> -->
                    </footer>
                </lightning-record-edit-form>
    </lightning-quick-action-panel>
</template>

JS:

import { LightningElement, api, track, wire} from "lwc";
import { getPicklistValues } from 'lightning/uiObjectInfoApi';
import { ShowToastEvent } from "lightning/platformShowToastEvent";
import { CloseActionScreenEvent } from "lightning/actions";
import QUOTE_OBJECT from "@salesforce/schema/SBQQ__Quote__c";
import QUOTE_ORDERPLACED_FIELD from "@salesforce/schema/SBQQ__Quote__c.Place_an_Order__c";
import doaApprovalsmsg from '@salesforce/label/c.approval_completed';
import requestedshipdatemsg from '@salesforce/label/c.requested_ship_date';
import shippingGuildesmsg from '@salesforce/label/c.shipping_guidelines';
import cannotPlaceOrder from '@salesforce/label/c.Cannot_Place_Order';
import noOrderPlacedMsg from "@salesforce/label/c.No_Place_Order_Message";
import yesOrderPlacedMsg from "@salesforce/label/c.Yes_Place_Order_Message";
import { getObjectInfo } from 'lightning/uiObjectInfoApi';
export default class PlaceOrder extends LightningElement {
    @api recordId;
    @track selectedValue;
    @track ShowOrderPlaced = false;
    @track runOnce = false;
    @track value;
    quoteObject = QUOTE_OBJECT;
    orderPlaced = QUOTE_ORDERPLACED_FIELD;
    oppRecordTypeName;
   
    label = {
        doaApprovalsmsg,
        requestedshipdatemsg,
        shippingGuildesmsg,
        cannotPlaceOrder,
        noOrderPlacedMsg,
        yesOrderPlacedMsg
    };
   
    @wire(getObjectInfo, { objectApiName: QUOTE_OBJECT })
    objectInfo;
    @wire(getPicklistValues, { recordTypeId: '$objectInfo.data.defaultRecordTypeId', fieldApiName: QUOTE_ORDERPLACED_FIELD})
    PlaceOrderPicklistValues;
   
    get toggleOptions() {
        return [
            { label: "Yes", value: "Yes" },
            { label: "No", value: "No" }
        ];
    }
   
    handleToggleChange(evt) {
        this.selectedValue = evt.target.value;
        if (this.selectedValue === "Yes") {
            this.showOrderPlaced = true;
         
        } else {
           
            this.showOrderPlaced = false;  
        }
    }

    handleSubmit(event) {
        event.preventDefault(); // stop the form from submitting
        if (this.selectedValue === "No") {
            //Show error
            this.showNotification(this.stageLabels.cannotPlaceOrder, "Error", "error");
        } else {
            const fields = event.detail.fields;
         
            this.template.querySelector("lightning-record-edit-form").submit(fields);
        }
    }
   
    handleSuccess() {
        this.dispatchEvent(new CloseActionScreenEvent({
            title: 'Success',
            message: 'Record Saved Successfully!.',
            variant: 'success',
          }));
      
    }
   
     handleChange(event) {
             this.value = event.detail.value;
               
            }
       
     showNotification(error, title, variant) {
                const evt = new ShowToastEvent({
                    title: title,
                    message: error,
                    variant: variant
                });
                this.dispatchEvent(evt);
            }
}

In this code I am trying to show checklist uisng Labels and Updating Place Order field. when I click on Save, Quick action is closed but Place Order field is not updated.
And also when I select a No as radio group button value and click save it should throw error. This is also not happening.

Can anyone please help me here?

Thanks!
Hi,
Below is my requirement.
On Quote I have a field called "Apply Requested Ship Date" ( Date field) and on Quote Line I have "Requested Ship Date" ( Date field). on Quote Line Editor When a user adds a date to Apply Requested Ship Date field and clicks either Save or Quick Save – this will apply the entered date into each of Requested Ship Date fields in the columns for all line items added to the quote – at which point, if necessary, the user can go an change any dates for a particular line item individually that will be different from the date that is mass applied.
 
I have tried with Process builder with PRIORVALUE() but no luck.
below is a formula I used,
 
IF(PRIORVALUE([SBQQ__QuoteLine__c].Requested_Ship_Date__c ) <> [SBQQ__QuoteLine__c].Requested_Ship_Date__c , [SBQQ__QuoteLine__c].SBQQ__Quote__r.Apply_Requested_Ship_Date__c  , [SBQQ__QuoteLine__c].Requested_Ship_Date__c)
 
Please anyone guide me if I missed something or other possible ways.
 
Thanks!
Hi,
I need to hide/remove a standalone product based on Quote' Country. Camera is product which will be available only When Country is US/ Canada otherwise I need to hide/disable a product .
 
I have created a Product Rule with 
Product Scope, 
Condition as Quote Country (Formula field on Quote) not equals US or Canada, 
Action- Hide/ Remove.
 
I have tried with Action as Disable also still I could select a product
 
Any suggestions please. Thanks!
Hi,
Multi currency is enabled in my Org.
I am using Approvals for Quote Object. 
If Net Amount is less than 10,000 it requires Manager Approval.
If Net Amount is greater than 10,000 it requires Finance Team Approval.

When currency value is EUR and Net Amount is EUR 10,000 (USD 12,048.19), it required Finance Team Approval as it is greater than 10,000 USD. But in my case its taking EUR 10,000 and Manager Approval is triggering.

How can we achieve this?

Thanks
 
Hi,
I am trying to create Order Delivery Method and Order Delivery group for each Order Item when Order Item record is created. After that I need to update Order item with Order Delivery Group. But when I create an Order Item record am getting this error “AfterInsert caused by: System.FinalException: Record is read-only ()”.
Below is my code:

trigger CreateOrderSummary on OrderItem (after insert,after update)
{
    List<OrderDeliveryMethod> odmList=new List<OrderDeliveryMethod>();
    List<OrderDeliveryGroup> odgList=new List<OrderDeliveryGroup>();
    list<OrderItem> otList=new List<OrderItem>();
    List<Id> otId=new List<Id>();
     for(OrderItem ot: trigger.new){
        if(ot.SBQQ__Status__c=='Draft'){
           OrderDeliveryMethod odm=new OrderDeliveryMethod();
            odm.Name=ot.OrderItemNumber;
            odm.IsActive=True;
            odm.ProductId=ot.Product2Id;
            odmList.add(odm);
      
           OrderDeliveryGroup odg=new OrderDeliveryGroup();
            odg.DeliverToName='Shipping Address';
            odg.OrderId=ot.OrderId;
            odg.Product__c=ot.Product2Id;
            odg.Order_Product__c=ot.Id;
            odgList.add(odg); 
            otList.add(ot);
            otId.add(ot.Id);
        }
    }
       insert odmList;
       insert odglist;
        for(OrderDeliveryMethod od:odmList) {
           for(OrderDeliveryGroup og: odgList){
                 if(od.ProductId==og.Product__c){
               og.OrderDeliveryMethodId=od.Id; 
            }
         }
     }
    update odgList;
    for(OrderDeliveryGroup og: odgList){
               for(OrderItem ot:otList) {
            if(ot.Id==og.Order_Product__c){
               ot.OrderDeliveryGroupId=og.Id; 
            }
         }
     }
    update otList; 
}

It works fine if I remove below code. But I want to update Order Item with OrderDeliveryGroup after created.
for(OrderDeliveryGroup og: odgList){
               for(OrderItem ot:otList) {
            if(ot.Id==og.Order_Product__c){
               ot.OrderDeliveryGroupId=og.Id; 
            }
         }
     }
    update otList; 
I tried with trigger.isBefore, when I used that I am not getting an error but OrderDeliveryGroup is not updated on Order Item
Kindly let me know if missed something

Thanks!
Hi,

I have a requirement on Salesforce CPQ.
I have a bundle Product ( Product A) and it has 3 options 
Product B
Product C
Product D.
Quantity of Product D should be 1 when total quantity of all the Options is greater than 5.
Quantity of Product C should be updated based on Bundle ( Need 1 per every 4 bundles)

I do not have any idea on this. Can anyone suggest me on this?

Thanks!
Hi,

Below is my requirement:

I have a product. I can sell a product on both monthly and yearly basis. If montly means price should 500 ( List Price) if buyers select yearly then I should apply 20% on list price. This discount applies automatically. How can we do this?

Thanks
Hi,
Here is my issue
I have a custom field Account Location( Lookup to Account) on Quote Line and added it to field set. On Quote Line Editor I have Added a Product and selected a Account Location and saved. But in Quote Line record Account location field is not updated. I am not sure why it is not updating.

Can anyone please help me on this?


Thanks
Hi,
I have a Opportunity and Quote Object. I should create a Quote from Opportunity. I have created a custom button called New Quote on Opportunity. When I click on New Quote in the new Quote form Opportunity(Lookup field) it should auto populate a value from Opportunity. Below is my URL but it is not working .

/a0q/e?CF00N5g000004u4Yj={! Opportunity.Name}&CF00N5g000004u4Yj_lkid={!Opportunity.Id}

a0q- object id
CF00N5g000004u4Yj- Opportunity lookup field id on Opportunity

Can anyone help me if missed something?


Thanks
 
Hi,

Below is my requirement.
On Opportunity I have a button called New Quote using that I am creating a new Quote Record. When I create a Quote from Opportunity, Version number should be as v1. If I create a 2nd Quote from Opportunity then Version number should be updated as v2 on the new record and so on. Can anyone please guide me on this? 

Thanks in advance!
 
Hi,

I have Account( Lookup) Field on Quote . One Account will have Multiple Child Accounts( Account Hierarchy). On Quote Line Object I have Quote Field( Lookup to Quote) and I have created a Account Field( Lookup to Account). My requirement is I want to display only the Account values on Quote Line based on Account Field on Quote. For Example AccountA is primary Account and it has AccountB and AccountC as Child Accounts. On Quote if I select AccountC as Account, On Quote Lines I should see only AccountA, AccountB, AccountC. I dont see any other Account values while searching.

I don't have any idea on this. Can anyone please guide me on the above requirement.
Hi,
Below is a requirement.
On Quote object need to create a Button called Place Order. On click of that button I want to ask below questions. 
  • Have the quote, products and pricing DOA been approved?
  • Have local shipping guidelines and expectations been communicated to the customer?
  • Has the 'requested ship date' been added (if applicable)?
If then click Yes below the checklist. If a user selects No, an error message should appear not allowing the user to place the order.
The “No” error message should read: “all check list items must be completed prior to placing the order”. 
Below is my code

HTML:
<template>
    <lightning-quick-action-panel header="Place Order">
                     
                <p>{label.doaApprovalsmsg}</p>
                <p>{label.requestedshipdatemsg}</p>
                <p> {label.shippingGuildesmsg}</p>
                <lightning-radio-group
                name="selectionRadioGroup"
                options={toggleOptions}
                value={selectedValue}
                onchange={handleToggleChange}
                type="button"
            ></lightning-radio-group>
             
            <lightning-record-edit-form
   
            onsubmit={handleSubmit}
            object-api-name="QUOTE_OBJECT"
            record-id={recordId} >
            <!--Order Placed Field-->
            <template if:true={showOrderPlaced}>
                <lightning-combobox name="progress"
                label="Place Order"
                value={value}
                placeholder="-Select-"
                options={PlaceOrderPicklistValues.data.values}
                onchange={handleChange} >
              </lightning-combobox>
                               
            </template>
               
                    <footer class="slds-modal__footer">
                        <!-- <div class="custom-footer"> -->
                        <lightning-button class="slds-var-m-around_medium" variant="brand" type="submit" name="save" label="Save" onclick= {handleSuccess} ></lightning-button>
                        <!-- </div> -->
                    </footer>
                </lightning-record-edit-form>
    </lightning-quick-action-panel>
</template>

JS:

import { LightningElement, api, track, wire} from "lwc";
import { getPicklistValues } from 'lightning/uiObjectInfoApi';
import { ShowToastEvent } from "lightning/platformShowToastEvent";
import { CloseActionScreenEvent } from "lightning/actions";
import QUOTE_OBJECT from "@salesforce/schema/SBQQ__Quote__c";
import QUOTE_ORDERPLACED_FIELD from "@salesforce/schema/SBQQ__Quote__c.Place_an_Order__c";
import doaApprovalsmsg from '@salesforce/label/c.approval_completed';
import requestedshipdatemsg from '@salesforce/label/c.requested_ship_date';
import shippingGuildesmsg from '@salesforce/label/c.shipping_guidelines';
import cannotPlaceOrder from '@salesforce/label/c.Cannot_Place_Order';
import noOrderPlacedMsg from "@salesforce/label/c.No_Place_Order_Message";
import yesOrderPlacedMsg from "@salesforce/label/c.Yes_Place_Order_Message";
import { getObjectInfo } from 'lightning/uiObjectInfoApi';
export default class PlaceOrder extends LightningElement {
    @api recordId;
    @track selectedValue;
    @track ShowOrderPlaced = false;
    @track runOnce = false;
    @track value;
    quoteObject = QUOTE_OBJECT;
    orderPlaced = QUOTE_ORDERPLACED_FIELD;
    oppRecordTypeName;
   
    label = {
        doaApprovalsmsg,
        requestedshipdatemsg,
        shippingGuildesmsg,
        cannotPlaceOrder,
        noOrderPlacedMsg,
        yesOrderPlacedMsg
    };
   
    @wire(getObjectInfo, { objectApiName: QUOTE_OBJECT })
    objectInfo;
    @wire(getPicklistValues, { recordTypeId: '$objectInfo.data.defaultRecordTypeId', fieldApiName: QUOTE_ORDERPLACED_FIELD})
    PlaceOrderPicklistValues;
   
    get toggleOptions() {
        return [
            { label: "Yes", value: "Yes" },
            { label: "No", value: "No" }
        ];
    }
   
    handleToggleChange(evt) {
        this.selectedValue = evt.target.value;
        if (this.selectedValue === "Yes") {
            this.showOrderPlaced = true;
         
        } else {
           
            this.showOrderPlaced = false;  
        }
    }

    handleSubmit(event) {
        event.preventDefault(); // stop the form from submitting
        if (this.selectedValue === "No") {
            //Show error
            this.showNotification(this.stageLabels.cannotPlaceOrder, "Error", "error");
        } else {
            const fields = event.detail.fields;
         
            this.template.querySelector("lightning-record-edit-form").submit(fields);
        }
    }
   
    handleSuccess() {
        this.dispatchEvent(new CloseActionScreenEvent({
            title: 'Success',
            message: 'Record Saved Successfully!.',
            variant: 'success',
          }));
      
    }
   
     handleChange(event) {
             this.value = event.detail.value;
               
            }
       
     showNotification(error, title, variant) {
                const evt = new ShowToastEvent({
                    title: title,
                    message: error,
                    variant: variant
                });
                this.dispatchEvent(evt);
            }
}

In this code I am trying to show checklist uisng Labels and Updating Place Order field. when I click on Save, Quick action is closed but Place Order field is not updated.
And also when I select a No as radio group button value and click save it should throw error. This is also not happening.

Can anyone please help me here?

Thanks!
Hi,
Multi currency is enabled in my Org.
I am using Approvals for Quote Object. 
If Net Amount is less than 10,000 it requires Manager Approval.
If Net Amount is greater than 10,000 it requires Finance Team Approval.

When currency value is EUR and Net Amount is EUR 10,000 (USD 12,048.19), it required Finance Team Approval as it is greater than 10,000 USD. But in my case its taking EUR 10,000 and Manager Approval is triggering.

How can we achieve this?

Thanks
 
Hi,
I am trying to create Order Delivery Method and Order Delivery group for each Order Item when Order Item record is created. After that I need to update Order item with Order Delivery Group. But when I create an Order Item record am getting this error “AfterInsert caused by: System.FinalException: Record is read-only ()”.
Below is my code:

trigger CreateOrderSummary on OrderItem (after insert,after update)
{
    List<OrderDeliveryMethod> odmList=new List<OrderDeliveryMethod>();
    List<OrderDeliveryGroup> odgList=new List<OrderDeliveryGroup>();
    list<OrderItem> otList=new List<OrderItem>();
    List<Id> otId=new List<Id>();
     for(OrderItem ot: trigger.new){
        if(ot.SBQQ__Status__c=='Draft'){
           OrderDeliveryMethod odm=new OrderDeliveryMethod();
            odm.Name=ot.OrderItemNumber;
            odm.IsActive=True;
            odm.ProductId=ot.Product2Id;
            odmList.add(odm);
      
           OrderDeliveryGroup odg=new OrderDeliveryGroup();
            odg.DeliverToName='Shipping Address';
            odg.OrderId=ot.OrderId;
            odg.Product__c=ot.Product2Id;
            odg.Order_Product__c=ot.Id;
            odgList.add(odg); 
            otList.add(ot);
            otId.add(ot.Id);
        }
    }
       insert odmList;
       insert odglist;
        for(OrderDeliveryMethod od:odmList) {
           for(OrderDeliveryGroup og: odgList){
                 if(od.ProductId==og.Product__c){
               og.OrderDeliveryMethodId=od.Id; 
            }
         }
     }
    update odgList;
    for(OrderDeliveryGroup og: odgList){
               for(OrderItem ot:otList) {
            if(ot.Id==og.Order_Product__c){
               ot.OrderDeliveryGroupId=og.Id; 
            }
         }
     }
    update otList; 
}

It works fine if I remove below code. But I want to update Order Item with OrderDeliveryGroup after created.
for(OrderDeliveryGroup og: odgList){
               for(OrderItem ot:otList) {
            if(ot.Id==og.Order_Product__c){
               ot.OrderDeliveryGroupId=og.Id; 
            }
         }
     }
    update otList; 
I tried with trigger.isBefore, when I used that I am not getting an error but OrderDeliveryGroup is not updated on Order Item
Kindly let me know if missed something

Thanks!
Hi,
I have a Opportunity and Quote Object. I should create a Quote from Opportunity. I have created a custom button called New Quote on Opportunity. When I click on New Quote in the new Quote form Opportunity(Lookup field) it should auto populate a value from Opportunity. Below is my URL but it is not working .

/a0q/e?CF00N5g000004u4Yj={! Opportunity.Name}&CF00N5g000004u4Yj_lkid={!Opportunity.Id}

a0q- object id
CF00N5g000004u4Yj- Opportunity lookup field id on Opportunity

Can anyone help me if missed something?


Thanks
 
Hi,

Below is my requirement.
On Opportunity I have a button called New Quote using that I am creating a new Quote Record. When I create a Quote from Opportunity, Version number should be as v1. If I create a 2nd Quote from Opportunity then Version number should be updated as v2 on the new record and so on. Can anyone please guide me on this? 

Thanks in advance!