• Amy J
  • NEWBIE
  • 20 Points
  • Member since 2022

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 4
    Questions
  • 6
    Replies
Hi Experts, 
I'm trying to show field values in a table but its not showing. If there is  any other way I can show these values in a table then please assist.
This class has been used for other methods as well.
Below is my code-​​​​​​​
Apex Class-

    @AuraEnabled
    public static List<PI__c> getPIRecords( String contrecid) {
        List<id> IdSets = new List<id>();
        List<PI__c> memList = new list<PI__c>();
        String Query;
        
        if ( contrecid != null && contrecid != '' ) {
            
            List<Parent__c> prList = [Select id, name, contact__c from Parent__c where contact__c =:  contrecid];
            
            for(Parent__c e:prList){
                IdSets.add(e.id) ;
            }
            
            query = 'SELECT Id,Category__c,Segment_Effective_Date__c,Segment_Expiration_Date__c FROM PI__c where Parent__r.id in  :IdSets ORDER BY CreatedDate desc';
            
            memList = database.query(query);
        }
        
        if(memList.size() == 0){
            throw new AuraHandledException('No Record Found..'); 
            //return returnList;
        }
        else{
            
            return Database.query( query );
        }
    }

html-

<table class="slds-table slds-table_cell-buffer slds-table_bordered slds-table_col-bordered">

    <thead style="width:100%;">
      <tr class="slds-line-height_reset" style="color: black;">
        <th class="" scope="col">
          <div class="slds-truncate" title=" Category"> Category</div>
        </th>
        <th class="" scope="col">
          <div class="slds-truncate" title="Segment Effective Date">Segment Effective Date</div>
        </th>
        <th class="" scope="col">
          <div class="slds-truncate" title=" Segment Expiration Date">Segment Expiration Date</div>
        </th>
          </tr>
        </thead>
        <tbody>
          <template for:each={relatedprrec} for:item="rec" for:index="index" >
          <tr key={rec.Id} class="slds-hint-parent">

            <td data-label="Category">
              <div>
             <div class="slds-truncate" title="Category" >{rec.Category__c}</div>
            </div>
          </td>
            <td data-label="Segment Effective Date">
              <div>
             <div class="slds-truncate" title="Segment Effective Date" data-key={index}>{rec.Segment_Effective_Date__c}</div>
            </div>
          </td>
        <td data-label="Segment Expiration Date">
          <div>
            <div class="slds-truncate" title="Segment Expiration Date" data-key={index}>{rec.Segment_Expiration_Date__c}</div>
        </div>
        </td>
    </tr>
      </template>
      </tbody>
        </table>

JS-

getPIRecords({ contrecid: this.contrecid })
          .then(result => { 
              this.relatedprrec= result;
               var rrelatedprrec= [];
              this.relatedprrec= relatedprrec;
          })
          .catch(error => {
              console.log('error', error);
           });

    
}


 
  • August 25, 2022
  • Like
  • 0
Hi,
I have requirement, when I ckick a button text shoud come and when I ckick the same button the text shoud hide. I'm not able to hide on the same button click. Please assist. Below is my code. 
html-
    <lightning-button  label={ShowText}  title="Show text" onclick={handleClick} class="slds-m-left_x-small"></lightning-button>
    <div style=" margin-top: -30%; left: 550%; margin-left: -30px; background: linear-gradient(#fff, #dbe4eb); border-color:#555 transparent transparent transparent;color: #111; border: 1px solid black;" if:true={showText1}>{textValue}</div>

JS-

  @track ShowText='Show text'
  @track showText1 = false;
   textValue = 'Some text value';
   handleClick(event){
    const label=event.target.label;
  if(label==='Show text'){
    this.Showtext='Hide text';
    this.showText1 = true;

  }else if(label==='Hide text'){
    this.Showtext='Show text';
    this.showText1 = false;
  }
     
      
   }

 
  • August 22, 2022
  • Like
  • 0
Hi All,
While converting my existing process builder I'm getting the following error-
"The flow failed to start because the provided values were not valid: You can't launch a record-triggered flow from within Flow Builder. To launch this flow, activate it and then create, delete, or update a record, depending on the trigger configuration."

Please assist what I'm doing wrong. User-added imageUser-added imageCurrent Process Builder
  • June 20, 2022
  • Like
  • 0
Hi,
I needed custom content type so I downloaded Content type manager app from the app exchange in my sandbox. I gave all the required permissions and settings. But while creating a new content type its shoqing an error- "Invalid or Expired Session" and not letting me to create it. Am I missing something?  Please assist.

User-added image
  • March 14, 2022
  • Like
  • 0
Hi Experts, 
I'm trying to show field values in a table but its not showing. If there is  any other way I can show these values in a table then please assist.
This class has been used for other methods as well.
Below is my code-​​​​​​​
Apex Class-

    @AuraEnabled
    public static List<PI__c> getPIRecords( String contrecid) {
        List<id> IdSets = new List<id>();
        List<PI__c> memList = new list<PI__c>();
        String Query;
        
        if ( contrecid != null && contrecid != '' ) {
            
            List<Parent__c> prList = [Select id, name, contact__c from Parent__c where contact__c =:  contrecid];
            
            for(Parent__c e:prList){
                IdSets.add(e.id) ;
            }
            
            query = 'SELECT Id,Category__c,Segment_Effective_Date__c,Segment_Expiration_Date__c FROM PI__c where Parent__r.id in  :IdSets ORDER BY CreatedDate desc';
            
            memList = database.query(query);
        }
        
        if(memList.size() == 0){
            throw new AuraHandledException('No Record Found..'); 
            //return returnList;
        }
        else{
            
            return Database.query( query );
        }
    }

html-

<table class="slds-table slds-table_cell-buffer slds-table_bordered slds-table_col-bordered">

    <thead style="width:100%;">
      <tr class="slds-line-height_reset" style="color: black;">
        <th class="" scope="col">
          <div class="slds-truncate" title=" Category"> Category</div>
        </th>
        <th class="" scope="col">
          <div class="slds-truncate" title="Segment Effective Date">Segment Effective Date</div>
        </th>
        <th class="" scope="col">
          <div class="slds-truncate" title=" Segment Expiration Date">Segment Expiration Date</div>
        </th>
          </tr>
        </thead>
        <tbody>
          <template for:each={relatedprrec} for:item="rec" for:index="index" >
          <tr key={rec.Id} class="slds-hint-parent">

            <td data-label="Category">
              <div>
             <div class="slds-truncate" title="Category" >{rec.Category__c}</div>
            </div>
          </td>
            <td data-label="Segment Effective Date">
              <div>
             <div class="slds-truncate" title="Segment Effective Date" data-key={index}>{rec.Segment_Effective_Date__c}</div>
            </div>
          </td>
        <td data-label="Segment Expiration Date">
          <div>
            <div class="slds-truncate" title="Segment Expiration Date" data-key={index}>{rec.Segment_Expiration_Date__c}</div>
        </div>
        </td>
    </tr>
      </template>
      </tbody>
        </table>

JS-

getPIRecords({ contrecid: this.contrecid })
          .then(result => { 
              this.relatedprrec= result;
               var rrelatedprrec= [];
              this.relatedprrec= relatedprrec;
          })
          .catch(error => {
              console.log('error', error);
           });

    
}


 
  • August 25, 2022
  • Like
  • 0
Hi,
I have requirement, when I ckick a button text shoud come and when I ckick the same button the text shoud hide. I'm not able to hide on the same button click. Please assist. Below is my code. 
html-
    <lightning-button  label={ShowText}  title="Show text" onclick={handleClick} class="slds-m-left_x-small"></lightning-button>
    <div style=" margin-top: -30%; left: 550%; margin-left: -30px; background: linear-gradient(#fff, #dbe4eb); border-color:#555 transparent transparent transparent;color: #111; border: 1px solid black;" if:true={showText1}>{textValue}</div>

JS-

  @track ShowText='Show text'
  @track showText1 = false;
   textValue = 'Some text value';
   handleClick(event){
    const label=event.target.label;
  if(label==='Show text'){
    this.Showtext='Hide text';
    this.showText1 = true;

  }else if(label==='Hide text'){
    this.Showtext='Show text';
    this.showText1 = false;
  }
     
      
   }

 
  • August 22, 2022
  • Like
  • 0
Hi All,
While converting my existing process builder I'm getting the following error-
"The flow failed to start because the provided values were not valid: You can't launch a record-triggered flow from within Flow Builder. To launch this flow, activate it and then create, delete, or update a record, depending on the trigger configuration."

Please assist what I'm doing wrong. User-added imageUser-added imageCurrent Process Builder
  • June 20, 2022
  • Like
  • 0
Hi,
I needed custom content type so I downloaded Content type manager app from the app exchange in my sandbox. I gave all the required permissions and settings. But while creating a new content type its shoqing an error- "Invalid or Expired Session" and not letting me to create it. Am I missing something?  Please assist.

User-added image
  • March 14, 2022
  • Like
  • 0