• Anna Sliwa
  • NEWBIE
  • 0 Points
  • Member since 2020

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 4
    Questions
  • 1
    Replies

Hi, 

I have used Lightning-record-edit-form to update values of existing records. The issue is that when clicking on the Update Record button, nothing change. I am not sre what I am doing wrong. I have got this code below: 
Java Script:

handleSubmitUpdate(event){
    const fields = event.detail.fields;
    this.template.querySelector('lightning-record-edit-form').submit(fields);
   
 }
 handleSucessUpdate(event){
    const updatedRecord = event.detail.fields;
    console.log('onsuccess: ', inputField);
 }
 

User-added image


 
HTML:

<template if:true={selectedEvent} >
        <section role="dialog" tabindex="-1" class="slds-modal slds-fade-in-open slds-modal_small"
          aria-labelledby="modal-heading-01" aria-modal="true" aria-describedby="modal-content-id-1">
          <div class="slds-modal__container">
            <header class="slds-modal__header">
              <span class="slds-modal__close">
              </span>
              <h2 class="slds-text-heading_medium slds-hyphenate">{selectedEvent.title}</h2>
            </header>
            <div class="slds-modal__content slds-p-around_medium">
              <lightning-record-edit-form object-api-name="Event_Calendar__c" onsuccess={handleSuccessUpdate}
              >
                  <!-- Include input fields for updating the record -->
                  <lightning-input-field field-name="Title__c" value={selectedEvent.title} data-field="Title" type="text"></lightning-input-field>
                  <lightning-input-field field-name="Type__c" value={selectedEvent.type} data-field="Type" type="picklist" ></lightning-input-field>
     
                    <lightning-button label="Cancel" title="Cancel" onclick={createCancelUpdate} class="slds-m-right_small"></lightning-button>
                    <lightning-button variant="brand" type="submit" label="Update Event" title="Update Event" onclick={handleSubmitUpdate}></lightning-button>
                 
              </lightning-record-edit-form>
      </div>
             
          </div>
        </section>
        <div class="slds-backdrop slds-backdrop_open"></div>
      </template>

I am not sure what I am doing wrong

Hi, 

I am beginner in APEX and I am wondering if there is a way how I can display two different badges based on a checkbox value (false/true)/

If the checkbox is true I want to display badge Member (as below)

User-added image
If the checkbox is false (unchecked) I want to display Non-Member badge. 

 

I know that I can create two custom highlights panel and set component visability using filters in page builder but I'm wondering if there is any way how i can do that based on one custom highligts panel without using page builder and using code. 

I have got all the codes for the custom highlights panel and badges, I am just misisng how to display the proper badge based on the checkbox. 

Hi, 

I am beginner in apex, and I am just wondering if it's possible to write a logic that will check if an account is a member( member = account which has an active contract)and display that as a green box above the name of the account. I think the second part it is possible but I am not sure if the first one.

I also would like to calculate how many members (accounts with active contracts) we have in the system. I created a report but we have some Accounts with more than one active contract and the system treats that as more than one member eg, Company XYZ has three active contracts for the system that are 3 members, I want the system to calculate that as 1 member (unique calculation). 

Do you think I can achieve that with apex?

Hi

I am trying to create a formula on Contact object called Relation which should show me who is a Member(has  activated contract) and who is Not a Member(if haven't got contract at all or contract is lapsed). I have created look up field to Client object and I have written this formula: 

IF(ISPICKVAL(Client__r.Type__c, 'Member'),'Member' , 'Non-Member')

 

Type__c is a picklist field on Client object.

unfortunately on all contacts Relation field showing up Member even there where a contact doesn't have contract (is not a client). What am I doing wrong?  

Hi, 

I am beginner in APEX and I am wondering if there is a way how I can display two different badges based on a checkbox value (false/true)/

If the checkbox is true I want to display badge Member (as below)

User-added image
If the checkbox is false (unchecked) I want to display Non-Member badge. 

 

I know that I can create two custom highlights panel and set component visability using filters in page builder but I'm wondering if there is any way how i can do that based on one custom highligts panel without using page builder and using code. 

I have got all the codes for the custom highlights panel and badges, I am just misisng how to display the proper badge based on the checkbox.