• Eric Morgan 10
  • NEWBIE
  • 5 Points
  • Member since 2023

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 6
    Replies
hi everyone - I am new to SF development and I want to know how often I should be refreshing my sandboxes. Everywhere online says periodically but does that mean weekly? monthly? 3 times a year? 

What's best practice? 
We use the Orders Object to track and report our Sales in SF. I am looking for a report to gather the LAST 365 days of Sales for an account and then sum it up to the Account Owner. From there, I want to compare that to the previous 365 days (so day 366 to day 730). Then see the percent different between those 2 numbers. I have tried using the PREVGROUPVAL function, but that seems to only work on Opportunities, but we are not using Opportunities. Please help me find another solution
Hi there,
I have setup the Salesforce-to-Salesforce connection through which i am trying to send the Case records from Org1 to Org 2.
In Org 1 i have written a PartnerNetworkRecordConnection code to send Case record data.
Here's a probelm In Org 2 I also created a trigger that can target the newly created Case record so that i can catch the record comming from Connections and perform some actions. But I am not able to generate any logs even system.debug().
Trigger Code :
if(Trigger.isAfter && Trigger.isInsert){
        System.debug('Inside trigger InitalCaseLoadFromEmmiTrigger');
        InitalCaseLoadFromEmmiTriggerHandler.initailCaseLoad(Trigger.new);
    }

 
<template>
    <lightning-input 
    label="Sold Production" 
    name="num1" 
    onchange={SoldProduction}
    required>
    </lightning-input>

    <lightning-input
      label="Design Production"
      name="num2"
      onchange={DeisgnProduction}
      required>
    </lightning-input>

    <lightning-button label="Calculate Production Differnce" onclick={calcExpr}></lightning-button>

    <lightning-input
      label="Result"
      name="result"
      read-only="true"
      value={result}>   
    </lightning-input>

  </template>
.js
import { LightningElement, api, track } from 'lwc';
import {FlowAttributeChangeEvent,FlowNavigationNextEvent} from 'lightning/flowSupport';

export default class calculator extends LightningElement {
  @track num1;
  @track num2;
  @track result;
  @api result;
  @api num1;
  @api num2;
  @api required;

  calcExpr() {
    this.result = (Number(this.num1) - Number(this.num2)) / ((Number(this.num1) + Number(this.num2))/ 2);
  }

  SoldProduction(evt) {
    this.num1 = evt.target.value;
  }

  DeisgnProduction(evt) {
    this.num2 = evt.target.value;
  }


}
xml:
<?xml version="1.0" encoding="UTF-8"?>
<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata">
  <apiVersion>47.0</apiVersion>
  <isExposed>true</isExposed>
  <masterLabel>Calculator</masterLabel>
  <description>Calculator to find percentage</description>
  <targets>
      <target>lightning__FlowScreen</target>
  </targets>
<targetConfigs>
       <targetConfig targets="lightning__FlowScreen">
        <property name="result" type="Integer" />
        <property name="num1" type="Integer"/>
        <property name="num2" type="Integer"/>
        <property name="required" type="Boolean" default="true"/>
    </targetConfig>
</targetConfigs>
</LightningComponentBundle>
Values:
  • I have two numbers from a record "num1" and "num2"
Problem:
  • I am not sure how to take these two values and use them as default values when the LWC loads. 
Goal:
  • Once the values change the dafault values should not be used. 


 
Hello Everyone,
I am creating a table to show list of related records of case using LWC.The columns that I am showing is lookup field so was getting IDs of that fields but I am able to convert it to Name . Now challenge is if any record does not have value of that look up field then full table is not rendering. I need to check in JS for that field while converting it to ID to name if it is null or not. If it is null then skip the particular field value. Please find the code below . I have highlighted the part where I need to put null check. 
@wire(getCaseApprovalRE, {caseId: '$recordId'})
    wiredAccounts(result) {
     this.wiredAccountsResult = result;
     if (result.data) {
      this.recordNumber = result.data.length;
        return{...row, Approver1__c: row.Approver1__r.Name,
                       Approver2__c:row.Approver2__r.Name ,
                       Approver_3__c:row.Approver_3__r.Name,
                       Step_2_Approver_1__c:row.Step_2_Approver_1__r.Name,
                      // I need to put if condition here if the below field is null or not 
                       Step_2_Approver_2__c:row.Step_2_Approver_2__r.Name,
            }
    }) 
      }
      else if (result.error) {
       this.error = result.error;
       this.accData = undefined;
     }
    }
Please help me on this .Thanks in advance.