• Eswar Venkat 2
  • NEWBIE
  • 89 Points
  • Member since 2023

  • Chatter
    Feed
  • 3
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 21
    Replies
Hello Experts, my component is fetching query result from class and showing in Aura App console but doesn't work in LWC experience builder. I tried running it on load and through button click also, it doesn't give any result, array shows blank, length 0. I tested in anonymous window this query fetches result. I don't know what I'm missing. Please guide.
import { LightningElement, track,api, wire } from 'lwc';
import getNotes from '@salesforce/apex/TBT_SupervisorNotes.getNotes';


export default class tBT_SessionGuideline extends LightningElement {
    @wire(getNotes) gnotes;
    @track getNotes;
    @track datalist = [];

  connectedCallback(){
        getNotes().then(res => {
            this.datalist = res;
            console.log('hi');
             console.log("result from connected callback", res);
            console.log("datalist result from connected callback", this.datalist);
        }).catch((error)=>{
            console.error("error " ,JSON.stringify(error));
        })
    }
public class TBT_supervisorNotes {

@AuraEnabled(Cacheable=true)
public static List<Input_Form__c> getNotes(){
    
    List<Input_Form__c> LognotesList = [ select id, Session_Summary__c from input_form__c where recordtype.name = 'TBT Supervisor Log Notes' ];

    system.debug(LognotesList);
    return LognotesList;
}
LWCAura

 
Hi Community,

I am looking to figure out how do I get a list of all the email messages for the all oppotunities of particualr record type?
Any thoughts are much appreciated.

Many thanks,
Smita 
1.Do not allow special characters, Allow only characters, digits,spaces.
2.Actual field(Text) length is 40 but we need to write if the field__C value is 'abc' and 'bcd' any one of value matches length should be 32 characters

Handeling validations -
1.validation should trigger only User cpq pilot check box is true 
2.Validtion should trigger only cpq permissions set assigned users. 
 
I am trying to use this formula but getting following error


 Error: Incorrect parameter type for function 'and()'. Expected Boolean, received Number
Description
Help Text
 
What is the soql query to get userid of a active user .
 All the users use the same profile and Create,Read,Edit and Delete Access is given via a permission set to all these users. This enables these users to delete their own records, but not of others

So without modify all how to achive this other resord data deletion.
We would like to know on which date license was modified.

Ex : Ram was assigned license on 1st Jan and revoked on 1st April and again assigned license on 3rd May .How to get the details that license was changed on 3rd May .
Tried with below query but output is record modified date
SELECT Name,Email,CreatedDate,LastModifiedDate,LastModifiedById FROM User where profileid='00e5j000000mjum' and IsActive=true order by LastModifiedDate DESC.

Please help .
Hi, 

I am working on opportunity object, i have created the list view button for new opty creation. The requirement is when we choose the business type custom field which is recordtype field, the record should create with that recordtype and its respective fields. the problem in my lwc code is the record get created but its having only the standard fields and respective fields for recordtype is not there in record. below is my code. 


HTML:
<!--
  @description       :
  @author            : ChangeMeIn@UserSettingsUnder.SFDoc
  @group             :
  @last modified on  : 12-03-2022
  @last modified by  : ChangeMeIn@UserSettingsUnder.SFDoc
-->
<template>
    <template if:true={isOpen}>
      <c-modal onclose={closeHandler}>
            <template if:true={iscreatenewopty}>
            <lightning-record-edit-form object-api-name="Opportunity" onsuccess={handleSuccess} onerror={handleError}>
                    <lightning-card title="New Opportunity ">
                        <lightning-layout>
                            <lightning-layout-item size="6" padding="around-small">
                                <lightning-card title="Create A New Opportunity ">
                                    <lightning-output-field field-name="OwnerId"></lightning-output-field>
                                    <lightning-input-field field-name="Name"></lightning-input-field>
                                    <lightning-input-field field-name="AccountId"></lightning-input-field>
                                    <lightning-input-field field-name="Working_Month__c" required="true"></lightning-input-field>
                                    <lightning-input-field field-name="Total_Contract_Value__c"></lightning-input-field>
                                    <lightning-input-field field-name="Department__c" required="true"></lightning-input-field>
                                    <lightning-input-field field-name="Term__c"></lightning-input-field>
                                 </lightning-card>
                            </lightning-layout-item>
                            <lightning-layout-item size="6" padding="around-small">
                                <lightning-card >
                                    <lightning-input-field field-name="Business_Type__c"></lightning-input-field>
                                    <lightning-input-field field-name="CloseDate"></lightning-input-field>
                                    <lightning-input-field field-name="StageName"></lightning-input-field>
                                    <lightning-input-field field-name="Forecast_Category__c"></lightning-input-field>
                                    <lightning-input-field field-name="Probability"></lightning-input-field>
                                    <lightning-input-field field-name="Amount"></lightning-input-field>
                                    <lightning-input-field field-name="Contract_duration__c"></lightning-input-field>
                                    <lightning-input-field field-name="Forecast_Category__c"></lightning-input-field>
                                </lightning-card>
                            </lightning-layout-item>
                        </lightning-layout>                              
                    </lightning-card>              
            </lightning-record-edit-form>
            <div slot="footer">
                <button class="slds-button slds-button_brand" onclick={handleSubmitButtonClick}>Save and Create Service</button>
             <lightning-button icon-name="utility:delete" class="slds-p-around_large" variant="destructive" padding="around-large" type="submit" label="cancel" onclick={closeHandler}></lightning-button>
            </div>
        </template>
        <template if:false={iscreatenewopty}>
            <c-create-Opty-Service opportunity-id={opportunityId}>
             </c-create-Opty-Service>
          </template>
         </c-modal>
                </template>
            </template>
Js: 

import { LightningElement,track } from 'lwc';
import {ShowToastEvent} from 'lightning/platformShowToastEvent';
export default class CreateNewOpty extends LightningElement {
    @track opportunityId = ''
    isOpen = true  
    iscreatenewopty = true
    openHandler(){
        console.log("Clicked!!")
        this.isOpen = true
    }      
    closeHandler(){
        this.isOpen = false
    }  
    handleClose(event){
        this.rating = '0';
        this.cancel = true;
        this.handleSubmit(event);
    }
    handleSubmitButtonClick(event){  
        event.preventDefault();    
      //  console.log("id of created :"+id)
     
      const fields = this.template.querySelector('lightning-record-edit-form').fields;
      console.log('-----------------------');
      console.log(fields);
        var isVal = true;
        this.template.querySelectorAll('lightning-input-field').forEach(element => {
            isVal = isVal && element.reportValidity();
        });
        if (isVal) {                
            this.template.querySelector('lightning-record-edit-form').submit();    
               
     
        } else {
            this.dispatchEvent(
                new ShowToastEvent({
                    title: 'Error creating record',
                    message: 'Please enter all the required fields',
                    variant: 'error',
                }),
            );
        }
     }
     handleSuccess(event) {
        this.opportunityId = event.detail.id;
        console.log("id of created :"+this.opportunityId)
        this.iscreatenewopty=false;
        this.showSuccessNotification(this.opportunityId);
    }
    handleError(event) {
        console.log(JSON.stringify(event.detail))
        this.dispatchEvent(
            new ShowToastEvent({
                title: event.detail.output.errors[0].errorCode,
                message: event.detail.detail,
                variant: 'error',
            }),
        );
    }
    showSuccessNotification(opportunityId){            
        const event = new ShowToastEvent({
            title: "Success",
            message: "Opportunity Created Successfully - "+opportunityId,
            variant:"Success"
        });
        this.dispatchEvent(event);
    }
}
I'm trying to insert new records via data loader but I keep getting an error message saying 'Index 100 out of bounds for length 100' and the upload stops part way through, after some records have successfully uploaded.  Does anyone know what this error means? 
 
Hello,  Kindly help me to understand how can we achieve the below scenario via flow?
I have a custom object DD which is currently associated with the account object using Master-Detail Relationship where we can have multiple DD's against each account.
Now, when a user creates a new opportunity and associates it to the account (using lookup), DD's data like date and status should be auto-populated on the opportunity custom fields from the latest DD's record created.
TIA
Any one please advise me how to write a trigger that will send an email to alert when that record is created or updated or deleted.
Hello Experts, my component is fetching query result from class and showing in Aura App console but doesn't work in LWC experience builder. I tried running it on load and through button click also, it doesn't give any result, array shows blank, length 0. I tested in anonymous window this query fetches result. I don't know what I'm missing. Please guide.
import { LightningElement, track,api, wire } from 'lwc';
import getNotes from '@salesforce/apex/TBT_SupervisorNotes.getNotes';


export default class tBT_SessionGuideline extends LightningElement {
    @wire(getNotes) gnotes;
    @track getNotes;
    @track datalist = [];

  connectedCallback(){
        getNotes().then(res => {
            this.datalist = res;
            console.log('hi');
             console.log("result from connected callback", res);
            console.log("datalist result from connected callback", this.datalist);
        }).catch((error)=>{
            console.error("error " ,JSON.stringify(error));
        })
    }
public class TBT_supervisorNotes {

@AuraEnabled(Cacheable=true)
public static List<Input_Form__c> getNotes(){
    
    List<Input_Form__c> LognotesList = [ select id, Session_Summary__c from input_form__c where recordtype.name = 'TBT Supervisor Log Notes' ];

    system.debug(LognotesList);
    return LognotesList;
}
LWCAura

 
Hello, 

My supervisor wants a field that shows the difference between our Projected Revenue field for the year from our Account page and the sum of our actual Revenue field from the opportunities page. 

1) Is this possible?
2) How do I do this?
Hi Community,

I am looking to figure out how do I get a list of all the email messages for the all oppotunities of particualr record type?
Any thoughts are much appreciated.

Many thanks,
Smita 
Need to create a formula feed that should redirect to "Contact" page on clicking the Hyperlink.

Hi,

I need a validation rule,
I have a an object called abc and a field User(Lookup to User object). Validation rule should be triggered when a record with same user is created. 
Example:
abc already has a record where the user is Thor, when another is record is tried to create with the same user. It should throw error
Please try this asap

Thanks,

 

  • April 27, 2023
  • Like
  • 0
Help me to create a trigger that will prevent cases from being created for expired products.

Hii everyone,

10 digit Phone number format is (xxx) xxx-xxxx but i want less than 10 digit then also format should be work. If suppose my phone field have 9 digit 123456789 then i want this type of format like (123) 456-789
is it possible? it should be work between 7 number.

i have formula given below:
IF( NOT(ISBLANK(Phone)), IF( LEN(Phone) >= 7, "(" & LEFT(Phone,3) & ") " & MID(Phone,4,3) & "-" & RIGHT(Phone, LEN(Phone)-6), Phone ), "" )

this formula i use on flow builder its working good when record is created but not working when record is updated. when i updated record format had not correct.

Thanks in advance!