• CharuDutt
  • PRO
  • 3803 Points
  • Member since 2020
  • ACS


  • Chatter
    Feed
  • 126
    Best Answers
  • 0
    Likes Received
  • 5
    Likes Given
  • 1
    Questions
  • 508
    Replies

After Update the Account record Active Status from "No" to "Yes" , Create a contact record. 


 

Hi Everyone, 

I need some help in obtaining 100% code coverage on my apex test class. I simply don't know what I need in order to make it run well so I can eventually deploy it to production. 

Help is much appreciated :) 

Apex Class:

Public class generateQuotePdfDocument{
    
    @InvocableMethod   
    public static void CreateQuote(List<Id> quoteIds)  
    { 
        createQuoteFutureMethod(quoteIds);
    }
    
    @future(callout=true)
    public static void createQuoteFutureMethod (List<Id> quoteIds) {
        //Initialize the quote url
        String quoteUrl = '/quote/quoteTemplateDataViewer.apexp?';
        
        //Get the Quote Template Id from Custom Settings
        String quoteTemplateId = Label.QuoteTemplateID;
        
        //List variable to get all the Quote Documents
        List<QuoteDocument> lstQuoteDoc = new List<QuoteDocument>();
        
        if(!quoteIds.isEmpty() && quoteIds.size() > 0) {
            
            for(Id quoteId :quoteIds) {
                //Construct the quote URL to generate PDF
                quoteUrl += 'id=' + quoteId;
                quoteUrl += '&headerHeight=197&footerHeight=10';
                quoteUrl += '&summlid=' + quoteTemplateId;
                
                //call the quote url
                PageReference pageRef = new PageReference(quoteUrl);
                
                //get the quotePdf
                Blob quoteBlob;
                
                if(Test.isRunningTest()) {
                    quoteBlob = Blob.valueOf('Generate Pdf');
                } else {
                    quoteBlob = pageRef.getContentAsPDF();
                }
                
                //initialze the QuoteDocument to hold the quote pdf for insertion
                QuoteDocument quoteDoc = new QuoteDocument();
                quoteDoc.Document = quoteBlob;
                quoteDoc.QuoteId = quoteId;
                lstQuoteDoc.add(quoteDoc);
            }
        }
        
        if(!lstQuoteDoc.isEmpty() && lstQuoteDoc.size() > 0) {
            Database.insert(lstQuoteDoc);
        }
        
    }
}

 

Apex Test Class

@istest
private class generateQuotePdfDocumentTest {
    
    @testSetup
    static void setup() {
    
        //Adjust the record type based on yoru setting
        RecordType rt = [SELECT Id FROM RecordType WHERE SObjectType = 'Opportunity' AND developerName = 'Opportunity'];
        
        Product2 product = new Product2();
        product.Name = 'LDPE Ecompound Black ';
        product.ProductCode = '6045200';
        product.IsActive = true;
        insert product;
        
        PricebookEntry pbe = new PricebookEntry();
        pbe.Pricebook2Id = Test.getStandardPricebookId();
        pbe.Product2Id = product.Id;
        pbe.IsActive = true;
        pbe.UnitPrice = 10;
        insert pbe;
       
        Account ac = new Account();
        ac.Name = 'Test';
        
        Opportunity op = new Opportunity();
        op.Name = 'Test';
        op.RecordTypeId = rt.Id;
        op.Type = 'Nieuw';
        op.Amount= 1200;
        op.CloseDate = Date.today().addDays(2);
        op.StageName = 'Actief';
        op.Probability = 10;
        op.LeadSource='Website';
        op.Name = 'test';
        op.Productgroep__c ='Ecompound' ;
        op.Description ='Test';
        op.Nextstep ='Test';
     
        insert op;
                
        Quote quote = new Quote();
        quote.OpportunityId = op.Id;
        quote.Name = 'TestQuote';
        quote.ExpirationDate = Date.today().addDays(5);
        quote.Status = 'Draft';
        quote.Pricebook2Id = Test.getStandardPricebookId();
        insert quote;
        
        QuoteLineItem qli = new QuoteLineItem();
        qli.QuoteId = quote.Id;
        qli.Quantity = 2;
        qli.PricebookEntryId = pbe.Id;
        qli.UnitPrice = 20;
        insert qli;
    }
    
    @isTest
    static void generateQuotePdfTest() {
        
        Quote quote = [SELECT Id, Status FROM Quote LIMIT 1];
        
        quote.Status = 'Draft';
        update quote;
    }
   
    
}

 

Hi, I've fetched some values in the form of a list from the js of my LWC. I'd like to put them inside a html table inside my LWC. Does anyone know how I can achieve that? 
Hello,

My case is an Account object that has 2 children. Let's name it object 1 and object 2. Object 1 and 2 has a lookup to account field. So may I know how to retrieve data from object 1 to object 2 where payment status is 'unbill'? 

Account: has field name, ect..
Object 1: has field Name(lookup to account object), item, quantity, total item, payment status, ect...
object 2: has a field Name(lookup to account object), etc...

So every time we create a new form for object 2, it will retrieve data from object 1 that payment status is unbill automatically. Maybe we can retrieve the data in a rich text field?

Is there any trigger code that I can refer to?
 

Hi, 

Does anyone knows how to remove the first letter of a text value using a Formula? 

For example, lets say we have the text : "B0000000321"

I want to trim it down to just : "0000000321"

A function that removes only the letters from a text  (and leave the numbers) would also be helpfull.

Thank you

TriggerHAndlerClass code-

public class BasicAssignemtTriggerHandler {
    
    public void beforeInsert (List<Trigger_Basic_Assignment__c> listOfTrigger){
        
     for(Trigger_Basic_Assignment__c cob : listOfTrigger)
         {
             if (cob.Operator__c == 'Addition'){
                 cob.Field_C__c = cob.Field_A__c+cob.Field_B__c; 
             }
             else if(cob.Operator__c == 'Subtract')
            {
                cob.Field_C__c = cob.Field_A__c - cob.Field_B__c; 
            }
              else if(cob.Operator__c == 'Divide')
            {
                cob.Field_C__c = cob.Field_A__c / cob.Field_B__c; 
            }
             else if (cob.Operator__c == 'Multiply')
            {
                cob.Field_C__c = cob.Field_A__c * cob.Field_B__c; 
            }
             
             
         }
    }
      public void beforeUpdate (List<Trigger_Basic_Assignment__c> listOfTrigger){
        
        for(Trigger_Basic_Assignment__c cob : listOfTrigger)
         {
             if (cob.Operator__c == 'Addition'){
                 cob.Field_C__c = cob.Field_A__c+cob.Field_B__c; 
             }
             else if(cob.Operator__c == 'Subtract')
            {
                cob.Field_C__c = cob.Field_A__c - cob.Field_B__c; 
            }
              else if(cob.Operator__c == 'Divide')
            {
                cob.Field_C__c = cob.Field_A__c / cob.Field_B__c; 
            }
             else if (cob.Operator__c == 'Multiply')
            {
                cob.Field_C__c = cob.Field_A__c * cob.Field_B__c; 
            }
   
         }
                    
    }
  
}


Trigger Code-
trigger BasicAssignmentTrigger on Trigger_Basic_Assignment__c (before insert, before Update) {
    
    
  BasicAssignemtTriggerHandler AssignmentHandler = new BasicAssignemtTriggerHandler();
    if (Trigger.isInsert && Trigger.isBefore){
      
        AssignmentHandler.BeforeInsert(Trigger.new);
    }
    
      if (Trigger.isUpdate && Trigger.isBefore){
      
        AssignmentHandler.BeforeUpdate(Trigger.new);
    }
}
Hi I need help in writing test class for a custom lightning controller.  Posting the code here:

public with sharing class AccountRecordFormClass {
    
    @AuraEnabled 
    public static user fetchUser(){      
      User oUser = [select id,Name, Email FROM User Where id =: userInfo.getUserId()];
        system.debug(oUser);        
        
        return oUser;
    }
    
    
    @AuraEnabled 
    public static account fetchaddress(String accid){
    
      Account acc = [select id, BillingStateCode, BillingCountryCode,BillingStreet,BillingCity,BillingPostalCode,Phone, FROM Account Where id =: accid];
              
        
        return acc;
    }
    
}
  
when a contact is inserted or updated then my trigger run on contact and fetch the contact name to that related account..
Like i add two contacts to account 'abc' then in the field of account naemed as 'about_contact__c' details of the contact attached to it.for example my contacts are xyz and kkr then thes two contact details add to my account abc field about_contact__c
I have a picklist field  Z and its value are like A,B,C. I want to create formulae field and mark it true when the picklist field contains values A and B only. Tried multiple and unable to acheive it. please help
one example as below tried as well but not working:
IF(OR(TEXT(Z__c) = 'A',TEXT(Reason_Code_1__c) = 'B'),true,false)
How to format phone number as 123-123-1234 when entered in a lightning input? 
 
Hi,
I have total ten fields which are displayed on the page.The page is designed using lwc .

Now the width between two particular fields should be increased and also the ten fields should be displayed. How to achieve

The displayed are displayed by

<th class="slds-size_1-of-10" scope="col">
                          <div class="slds-truncate" style="text-align:center" title="Finish Role">Role</div>
                          <!-- <div class="slds-truncate" style="text-align:center" title="Finish Role">Role</div> -->
                      </th>

<th class="slds-size_1-of-10" scope="col">
                          <div class="slds-truncate" style="text-align:center" title="start Role"> Role</div>
                          <!-- <div class="slds-truncate" style="text-align:center" title="start Role">Role</div> -->
                      </th>


Any Assistance

Thanks in advance


 
Hi,
 
I'm struggling to complete this trigger.If the lead status is ' Open-Not Contacted ' then the record should be added to campaign record (Create one Record Name- abc) and also if the status is changed from ' Open-Not Contacted ' to something else then the record (abc) in campaign should be removed.

I firstly tried to created junction object  by adding 2 master detail that is Lead and campaign but, When creating relationship Lead is not appearing to select. My idea is that we can do this with campaign member object. please help me in solving this trigger which involves
relationship.

Thanks in advance.
 
I want to list the birthday of all users by using LWC but i just want to show their profile pictures which is set horizontally side by side. How can I do that?

public with sharing class HelloFirst {

  
    public static void  demo1 (Integer intNum) {

        List<Account> listOfAccount = new List<Account>();
        for(integer i=1; i<=intNum; i++){
        Account acct = new account();

        acct.name ='sha'+i;

          listOfAccount.add(acct);
        }
        insert listOfAccount;
        system.debug(listOfAccount);
        }


        public static void demo2 (Integer numAccInsert , Map<Integer,Integer> mapOfContact){
   
            list<Account> listOfAcc = new list<Account>();
            list<Contact> listOfCon = new list<Contact>();
    
            for(Integer i = 1; i<=numAccInsert; i++){
               
                Account objAcc = new Account();
                objAcc.name = 'Anjana' +i;
                listOfAcc.add(objAcc);
            }
            insert listOfAcc;
           
            system.debug(listOfAcc);
      
           
            for(Integer j = 1; j< listOfAcc.size(); j++){

                if(mapOfContact.containsKey(j))
          {
             Id accId = listOfAcc[j].id;
             for(Integer k=1; k<=mapOfContact.get(j); k++)
         {
          Contact objCon = new Contact();
          objCon.AccountId = accId ;
          objCon.lastName = 'Sharma'+k;
          listOfCon.add(objCon);    
            }
        }
    }
            insert listOfCon;
            system.debug(listOfCon);
    
           
        }
     public static void demo3(List<Account>listOfAccount , List<Contact>conc){
         
             List<Contact>listOfContact = new List<Contact>();      
            Database.SaveResult[] srList = Database.insert(listOfAccount, false);
                 for (Database.SaveResult sr : srList) {
            if (sr.isSuccess()) {
               
               for(Contact objconc :conc){                   
                   objconc.AccountId = sr.id;    
               }
              // system.debug('conc---'+conc);
                Database.upsert(conc, false);
            } 
               else 
               {
                for(Database.Error err : sr.getErrors()) {
                    System.debug('The following error has occurred.');
                    System.debug(err.getStatusCode() + ': ' + err.getMessage());
                    System.debug('Contact fields that affected this error: ' + err.getFields());                    
                    Error_Log__c a1 = new Error_Log__c(Parent_Record_Name__c = '' , Parent_Record_Id__c = '' ,Error_Details__c = err.getStatusCode() + ': ' + err.getMessage());
                    database.upsert(a1 , false);
             }
               }
                 }
                   system.debug(listOfContact);
     }

}
i have 4 checkbox field on an object and 1 pickilist field 



1>    if all four checkbox is checked picklist isequal to all active
2>    if any three checkbox is checked picklist isequal to review
3>    if any two checkbox is checked picklist isequal to approved
4>     if one or none checkbox is checked picklist isequal to rejected
I'm having issues with this formula.
if WCT_Services_Start_Date__c) is blank and Today =30 is greather than Opportunity close date = 30, use Today = 30

 IF 
   (
    ISBLANK([Opportunity].WCT_Services_Start_Date__c), 
     
      {!TODAY()+30} >  [Opportunity].CloseDate + 30
     
     {!TODAY()+30}
   )
Hi,

Im trying to create user from contact object by using trigger and method. However, Im getting the below error , could you please help

Variable does not exist: CreateNewUserHandler
Missing  at 'public'


trigger NewUser on Contact (after insert) {

    List<User> userList = new List<User>();
    Set<Id> contactIds = new Set<Id>();
    for(Contact c: Trigger.New){
       if(c.Agent_type__c == 'Member'){
            contactIds.add(c.id);
        }
    }

    if(contactIds.size() > 0){
        CreateNewUserHandler.createNewUserFromContact(contactIds);
    }
}
public with sharing class CreateNewUserHandler {


public static void CreateNewUserHandler(Set<Id> contactIds)
{
    List<User> userList = new List<User>();
    List<Profile> profileList = [Select Id from Profile where Name=: 'Customer Community User' limit 1];
    //List<UserRole> roleList = [Select Id from UserRole where Name=: 'CEO' limit 1];
    for(Contact contactObj : [Select Id, Name, Email,Username__c from Contact where Id IN: contactIds limit 50000]){
        User uObj = new User();
        uObj.Username = contactObj.Username__c;
        uObj.Email = contactObj.Email;
        uObj.Alias = contactObj.Name;
        uObj.UserRoleId = roleList[0].Id;
        uObj.ProfileId = profileList[0].Id;
        uObj.IsActive = true; 
        uObj.TimeZoneSidKey = 'GMT';
        uObj.LanguageLocaleKey = 'en_US';
        uObj.EmailEncodingKey = 'UTF-8';
        uObj.LocaleSidKey = 'en_US';
        uObj.ContactId = contactObj.Id;
        userList.add(uObj);
    }
    try{
           insert userList;  // insert the user record
    }catch(Exception e){
          // Catch Exception
     }
}
I have a workflow that updates the status of parent case (pick list) when sub case is updated. I need to update the parent case when sub case got cancelled. Do I have to do it with process builder?
Not able to find way to update existing workflow.
Rule Criteria :(Case: Sub case updatedequalsTrue)
Immediate Workflow Actions : TypeDescription Field Update : Change Status to processing
Apex Trigger code I have to get the sum of "field : total_order_amount" in childs Object which is Status ="Closed". But only who choose from the Parent Object Record type ="Single Order".

1st OBJECT "Child" 
OBJECT NAME: Order
field: Open and Closed
field : total_order_amount.

2nd Object "MASTER DETAIL"
OBJECT NAME:
SureBuyer__c
Record Type: Single Order and Bulk Order.
  • July 25, 2021
  • Like
  • 0
Hi,
I need to add 1 year to date but the new date needs to fall in same day of week.  For example, if my starting date is Saturday 7/24/2021, I want the new date to be Saturday 7/23/2022.  If I do .addYears(1), I am getting 7/24/2022 which is a Sunday.  Any suggestions?

 
  • July 24, 2021
  • Like
  • 0
@AuraEnabled
    public static List<Case> submitSubCases(Id RecordId) {
        List<Case> csUpdateList = new List<Case>();
        List<Case> isAgentUploaded = [Select Id,isAgentReportUploaded__c from Case WHERE 
                                          ParentId=:RecordId AND isAgentReportUploaded__c = false 
                                          ];
        if(isAgentUploaded.size() == 0){
            String subStage =[Select Id, RCU_Sub_Stage__c from Case where Id=:RecordId].RCU_Sub_Stage__c;
            if(subStage == 'Rework'){
            List<Case> subCaselist= [Select Id, RCU_Sub_Stage__c From Case Where ParentId=:RecordId]; 
            if(subCaselist != null && subCaselist.size()>0){
                for(Case c:subCaselist)
                {
                    c.RCU_Sub_Stage__c = 'Agent Rework Submitted'; 
                    csUpdateList.add(c);
                }
            }
        }
        try {
            if (csUpdateList.size() > 0) {
                System.debug('csUpdateList: '+csUpdateList.size());
                update csUpdateList;
            }
        } catch(Exception ex) {
            System.debug(ex.getMessage());
        }
        return csUpdateList;
       } 
        else{
            return isAgentUploaded;
        }
        //System.debug('Successfully Agent Rework Submitted to All the Cases.');
        //return csUpdateList;
    }
  @AuraEnabled
    public static string getProfileCached(Id RecordId){
        Id profileId = UserInfo.getProfileId();
        String profileName =[Select Id, Name from Profile where Id=:profileId].Name;
        system.debug('Profile Name'+profileName);
        if('RCU Agent Community' == profileName){
            List<Case> caselist= [Select Id, RecordTypeId, OwnerId, Agent_Decision__c, Allocated_By__C, RCU_Sampling_Status__c
                                  From Case Where ParentId=:RecordId and RCU_Agency_Action__c <>'Accepted'];
            if(caseList != null && caseList.size()>0){
                return 'show';
            }else{
                return 'hide';
            }
        }
        return 'hide';
    }
Hello Everyone....Here I am sharing some methods from class which are not getting covered. Need help
 
 @AuraEnabled(cacheable = true)
    public static string getProfile(Id RecordId){
        Id profileId = UserInfo.getProfileId();
        String profileName =[Select Id, Name from Profile where Id=:profileId].Name;
        system.debug('Profile Name'+profileName);
        if('RCU Agent Community' == profileName){
            List<Case> caselist= [Select Id, RecordTypeId, OwnerId, Agent_Decision__c, Allocated_By__C, RCU_Sampling_Status__c
                                  From Case Where ParentId=:RecordId and RCU_Agency_Action__c <>'Accepted'];
            if(caseList != null && caseList.size()>0){
                return 'show';
            }else{
                return 'hide';
            }
        }
        return 'hide';
    }

Hi, 

I have tried and I am unable to find a way. I have a list of country phone codes and the country. For example +44 = United Kingdom.

I had written a workflow rule, however due to limitations it ended up being around 10k characters and it is too large for the workflow. Is there a way to do this using an apex trigger and if so would someone be able to help me with the structure? 

It would need to search in a list the country code and populate a country field with the respective country. 

Hi,

I have created below formula but receiving syntax error as
Error: Incorrect number of parameters for function 'IF()'. Expected 3, received 4

Formula:
IF(AND(ISPICKVAL(MA_TA__c , 'Oncology'),INCLUDES( $User.MA_TA_Team__c,'Oncology')),true,false,
IF(AND(ISPICKVAL(MA_TA__c , 'Renal'),INCLUDES( $User.MA_TA_Team__c,'Renal')),true,false,

""
))

Could you please help in sorting out this issue

Thanks,
Regina
Hi,

I have Apex code  output JSON data,

User-added image

I wish to display this json data in my LWC. 
Html:
<template>
    <lightning-card title="Report Data" icon-name="lightning-icon" >
        <div class="slds-m-around_medium">
            <template if:true={lapp}>
                <ul>
               <template for:each={lapp} for:item="app">
                   <li key={app.Id}> {app.Name} </li>
               </template>
            </ul>
           </template>
           <template if:true={error}>
               {error}
           </template>  
        </div>
 </lightning-card>
</template>

Js:
import { LightningElement, wire, track} from 'lwc';
import getURL from '@salesforce/apex/CreateReport.reportgen';
export default class RedirecctedURL extends LightningElement {
       @track lapp;
       @track data;
       @track error;
       wiredActivities;
     @wire(getURL,{
     }
     )
     wiredCases(value){
     this.wiredActivities = value;
     const { data, error } = value;
     
     if(data){
       this.lapp = JSON.stringify(data);
       console.log(JSON.stringify(data));
     
     }else if(error){
       console.log(error);
       this.error = error;
     }
     }
}

Any help??
 

Hi Everyone!

I want a list of account using Lightning-datatable. But it is not displaying the list of accounts.
HTML:

<template>
    <lightning-card title="t">
        <template if:true={accList}>
    <lightning-datatable
    key-field="Id"
    data={data}
    columns={columns}>
    </lightning-datatable>
    </template>
    <template if:true={error}>
        {error}
    </template>
</lightning-card>
</template>

JS:

import { LightningElement ,api, wire, track} from 'lwc';
import getAccountList from '@salesforce/apex/AccountHelper.getAccountList';
export default class Test extends LightningElement {
    @track columns = [{
            label: 'Account name',
            fieldName: 'Name',
            type: 'text',
            sortable: true
        },
        {
            label: 'Type',
            fieldName: 'Type',
            type: 'text',
            sortable: true
        },
      
    ];
 
    @track error;
    @track accList ;
    @wire(getAccountList)
    wiredAccounts({
        error,
        data
    }) {
        if (data) {
            this.accList = data;
            alert(JSON.stringify(accList));
            alert(JSON.stringify(data));
        } else if (error) {
            this.error = error;
        }
    }
}

Apex Class: 

public with sharing class AccountHelper {
    @AuraEnabled(cacheable=true)
    public static List<Account> getAccountList() {
        return [SELECT Id, Name, Type, Rating,
                Phone, Website, AnnualRevenue
            FROM Account LIMIT 10];
    }
}

xml

<?xml version="1.0" encoding="UTF-8"?>
<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata">
    <apiVersion>50.0</apiVersion>
    <isExposed>true</isExposed>
    <targets>
        
            <target>lightning__AppPage</target>
            <target>lightning__RecordPage</target>
            <target>lightning__HomePage</target>
        
    </targets>
</LightningComponentBundle>

Output: 

User-added image

I want the list of accounts.

Thank you in Advance!

Hi,
I have created a drop down menu in lightning web component. But, I want a pop up will appear on click of a menu item. 
I tried this for pop up, But it is not working. On click of a "Rename " Menu item . A pop up will be shown.

button.html

<template>
    <div class="slds-p-around_medium lgc-bg">
        {selectedItemValue}
        {ready}
        <lightning-card title="Drop Down">
            <lightning-button-menu alternative-text="Show menu" variant="border-filled" onselect={handleOnselect}>
                {selectedItemValue}
                <lightning-menu-item value="openinsharepoint" label="Open in SharePoint" prefix-icon-name="utility:new_window"
                    href="#"
                    target="_blank">
                </lightning-menu-item>
                <lightning-menu-item value="rename" label="Rename" prefix-icon-name="utility:edit">
                    <template if:true={ready}>
                        <section role="dialog" tabindex="-1" class="slds-modal slds-fade-in-open slds-modal_small"
                            aria-labelledby="modal-heading-01" aria-modal="true" aria-hidden="true"
                            aria-describedby="modal-content-id-1">
                            <div class="slds-modal__container">
                                <!-- Modal/Popup Box LWC header here -->
                                <header class="slds-modal__header">
                                    <button class="slds-button slds-button_icon slds-modal__close slds-button_icon-inverse" title="Close" onclick={closeModal}>
                                        <lightning-icon icon-name="utility:close"
                                            alternative-text="close"
                                            variant="inverse"
                                            size="small" ></lightning-icon>
                                        <span class="slds-assistive-text">Close</span>
                                    </button>
                                    <h2 id="modal-heading-01" class="slds-text-heading_medium slds-hyphenate">Rename LWC Setup.docx</h2>
                                </header>
                                <!-- Modal/Popup Box LWC body starts here -->
                                <div class="slds-modal__content slds-p-around_medium" id="modal-content-id-1">
                                    <lightning-input type="text" name="folder_name" label="Rename" placeholder="Enter new item name">
                                    </lightning-input>
                                </div>
                                <!-- Modal/Popup Box LWC footer starts here -->
                                <footer class="slds-modal__footer">
                                    <button class="slds-button slds-button_neutral" onclick={closeModal} title="Cancel">Cancel</button>
                                    <button class="slds-button slds-button_brand" onclick={submitDetails} title="Create">Create</button>
                                </footer>
                            </div>
                        </section>
                        <div class="slds-backdrop slds-backdrop_open"></div>
                    </template>
                </lightning-menu-item>
                <lightning-menu-item value="download" label="Download" prefix-icon-name="utility:download">
                </lightning-menu-item>
                <div class="slds-has-divider_top-space" role="separator">
                    <lightning-menu-item value="delete" label="Delet" prefix-icon-name="utility:close"></lightning-menu-item>
                </div>
            </lightning-button-menu>
        </lightning-card>
    </div>
</template>

button.js

import { LightningElement, track } from 'lwc';
export default class ButtonMenuOnselect extends LightningElement {
    @track selectedItemValue;
    @track ready;
    handleOnselect(event) {
        this.selectedItemValue = event.detail.value;
        if(this.selectedItemValue == "rename")
        {
        alert("ready");
        this.ready = true;
        alert("false");
        }
        
    }
}

 

i have 3 fields 
field 1- mr
field 2- bean
in the field 3 i have to show 'mr bean '
basically i have to show the 2 fields value in the 3rd field