• Hara Sahoo
  • NEWBIE
  • 65 Points
  • Member since 2016

  • Chatter
    Feed
  • 2
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 20
    Replies
Hi folks,
I have created a lightning record edit form in LWC. The form should open on pop up. After modal opens the background is visible. It should not visible. Any suggestions. Please refer my html and js code. If any CSS should to be create, please let me know.
User-added image------html----------
<template>
    <div class="slds-m-bottom_large">
        <div class="slds-grid slds-gutters">
            <div class="slds-col slds-size_4-of-5" style='font-weight: 500;font-size: 18px'>
                <span>RMA Case Line Item History</span>
            </div>
            <div class="slds-clearfix">
                <lightning-button label="New" variant="Neutral" onclick={newRmaForm} class="slds-float_right"></lightning-button>
            </div>
        </div>
    </div>
    <div class="landingpagebody">      
        <lightning-card title="">          
        <div class="slds-m-top_large">           
            <lightning-datatable key-field="id" data={rmarecord} columns={columns}></lightning-datatable>            
        </div>
    </lightning-card>
   
    <div if:true={showModal}>
        <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">
                    <lightning-icon style="cursor: pointer;" class="slds-float_right" icon-name="utility:close" size="small" onclick={handleClose} ></lightning-icon>
                    <h2 id="modal-heading-01" class="slds-modal__title slds-hyphenate">Create Case Line Item</h2>
                </header>
                <div class="slds-p-bottom_large slds-p-left_large" style="width:500px">
    <lightning-record-edit-form object-api-name="R4C_Case_Line_Item__c" columns = "2" layout-type = "compact">
        <lightning-messages></lightning-messages>
    <lightning-input-field field-name="Name"></lightning-input-field>
    <lightning-input-field field-name="Case__c"></lightning-input-field>
        <lightning-input-field field-name="EPM_Name__c"></lightning-input-field>
            <lightning-input-field field-name="MMID_BU_Hierarchy__c"></lightning-input-field>
                <lightning-input-field field-name="Remedy__c"></lightning-input-field>
                    <lightning-input-field field-name="Return_Reason__c"></lightning-input-field>
                    <lightning-input-field field-name="Return_Type__c"></lightning-input-field>
                    <lightning-input-field field-name="Stocking__c"></lightning-input-field>
            
            
        <lightning-button type="submit"
                          name="submit"
                          label="Create Case Line Item">
            </lightning-button>
    </lightning-record-edit-form>
    </div>
                <footer class="slds-modal__footer">
                    <button class="slds-button slds-button_neutral" onclick={handleCancel}>Cancel</button>
                    <button class="slds-button slds-button_brand" onclick={handleSave}>Save</button>
                </footer>
            </div>
        </section>
        <div class="slds-backdrop slds-backdrop_open"></div>
    </div>
    </div>
</template>
-------------------------js-------------------------
import { LightningElement, wire, track, api} from 'lwc';
import { getRecord, getFieldValue } from "lightning/uiRecordApi";
import { loadStyle } from 'lightning/platformResourceLoader';
// import CUSTOMCSS from '@salesforce/resourceUrl/recordForm'; //this is my static resource file name
import CONTACT_ID from "@salesforce/schema/User.ContactId";
import USER_ID from "@salesforce/user/Id";
import { ShowToastEvent } from 'lightning/platformShowToastEvent';
/* import NAME from '@salesforce/schema/R4C_Case_Line_Item__c.Name';
import Case from '@salesforce/schema/R4C_Case_Line_Item__c.Case__c';
import EPM_Name from '@salesforce/schema/R4C_Case_Line_Item__c.EPM_Name__c';
import MMID_BU_Hierarchy from '@salesforce/schema/R4C_Case_Line_Item__c.MMID_BU_Hierarchy__c';
import Remedy from '@salesforce/schema/R4C_Case_Line_Item__c.Remedy__c';
import Return_Reason from '@salesforce/schema/R4C_Case_Line_Item__c.Return_Reason__c';
import Return_Type from '@salesforce/schema/R4C_Case_Line_Item__c.Return_Type__c';
import Stocking from '@salesforce/schema/R4C_Case_Line_Item__c.Stocking__c'; */

export default class RmaCaseLineItem extends LightningElement {
    isCssLoaded = false;
    @api recordId;
    objectApiName = 'R4C_Case_Line_Item__c';
    showModal = false;
    @track rmarecord = false;
    @track conid;
  
 /* renderedCallback(){
        if(this.isCssLoaded) return
        this.isCssLoaded = true;
        loadStyle(this,CUSTOMCSS).then(()=>{
            console.log('loaded');
        })
        .catch(error=>{
            console.log('error to load');
        });
    } */
  
    newRmaForm(event){
    this.showModal = true;
   // fields = [NAME, Case, EPM_Name, MMID_BU_Hierarchy, Remedy, Return_Reason, Return_Type, Stocking];
}
 handleClick(){
        this.showModal = true;
    }
    handleClose(){
        this.showModal = false;
    }
handleSave(){
        this.template.querySelector('lightning-record-edit-form').submit();
        this.showModal = false;
        const evt = new ShowToastEvent({
            title: "Success!",
            message: "Case Line Item Created",
            variant: "success",
        });
        this.dispatchEvent(evt);
    }
    handleCancel(){
        this.showModal = false;
    }
    handleSubmit(event){
        event.preventDefault();       // stop the form from submitting
        const fields = event.detail.fields;
        fields.LastName = 'My Custom Last Name'; // modify a field
        this.template.querySelector('lightning-record-form').submit(fields);
     }
    @track columns = [
        {label:'R4C configuration name', fieldName:'R4C configuration name', type:'string'},
        {label:'Case', fieldName:'Case__c', type:'text'},
        {label:'EPM Name', fieldName: 'EPM_Name__c', type:'text'},
        {label:'Remedy', fieldName: 'Remedy__c',type:'data'},
        {label:'Return Reason', fieldName: 'Return_Reason__c',type:'data'},
        {label:'Return Type', fieldName:'Return_Type__c',type:'data'},
        {label:'Stocking', fieldName:'Stocking__c', type:'data'},
        {label:'MMID', fieldName:'MMID_BU_Hierarchy__c', type:'text'}
    ]
  @wire (getRecord, {recordId : USER_ID, fields: [CONTACT_ID]})
user;
get contactId() {
        this.conid = getFieldValue(this.user.data, CONTACT_ID);
        return getFieldValue(this.user.data, CONTACT_ID);
    } 
}

I'm trying to integrate my system with salesforce and want to package my components (triggers and classes).

I'm trying to create a package for my app, so that customers can directly install it from the URL i.e unmanaged package. Currently, I have created a Custom Metadata so that cliet can configure the URL, Token and other authentication details. These authentication details will be filled as a custom metadata record and my endpoint from Apex class will then be called to send the necessary information.

My question is 

Is there any better way to make the installation of unmanaged packages more flexible because right now customers will have to set up a new record providing the URL and token details which can change for any other customer?

  • August 23, 2021
  • Like
  • 0
Hello Folks,

Please help me How can we move the below website to the community site. find below screenshot for your reference.

User-added imageUser-added imageUser-added image
Can any one point the mistakes in my code. I'm looking to insert an account record and its related 20 opportunity records and 5 related case records to that account. 

public class AccountHelper {
    
    public static void AccountRecordHelper() {
        
        List<Opportunity> lstopp = New List <opportunity> ();
        List<Case> CaseNew = New List <Case> ();
       
        Account Acc = New Account();
        Acc.Name = 'Gen Construction';
        Acc.Industry= 'Contruction';
        insert acc;
        If (acc.id != Null) {
            
          
            
            for (Integer C = 1; C<=20; C++) {
                Opportunity Opp = New Opportunity ();
                Opp.Name = 'Dean Constructions' + C;
                opp.CloseDate = system.today ();
                opp.StageName = 'Prospecting';
                opp.AccountId = acc.Id;
                lstopp.add(opp);
                insert lstopp;
 
            }
            
            Case Cs = New Case();
            for (integer i = 1; i<=10; i++) {
                
                Cs.Status = 'New';
                Cs.Origin = 'Phone';
                Cs.AccountId = acc.Id;
                casenew.add(cs);
                insert casenew;

            }
            
            
            
            System.debug (lstopp);
            system.debug(casenew);
            system.debug(acc.id);
            
        } 
    }

}
Hi All,
 
I am trying to pass a list of records into a batch class using constructor. And adding that to the query. But I am getting the following error :
First error: Only variable references are allowed in dynamic SOQL/SOSL. Can someone help.
 
Code :- 
String query = 'SELECT Id, Name, ProductCode FROM Product2 WHERE IsActive =true';
public ConstructorName(List<Product2> productlst){
        if (!productlst.isEmpty() && productlst!=null) {
            query += ' AND APTS_EXT_ID__c IN : '+productlst; 
        }
    }
global Database.QueryLocator start(Database.BatchableContext bc) {
        return Database.getQueryLocator(query);
    }
Hi All 
 I want to console log an object which I creating in javascript. but while running it is showing Undefined in Rsult.
here is the code
  @api Value='hello';
 let   mutiQuery={warn:this.value};
     handleClick(){
      console.log(JSON.stringify(this.multiQuery));
      
   }
if I write mutiQuery={warn:'hello'};
then its working fine but on writing this.value it is showing undefined
how can I solve this.

I need to add a validation error message for an input in Flow.

I have a Phone field where I have maintaned a validation, where the phone number should be of length 10, it should not start with 1. I'm using the below formula.
 AND( LEN({!School_Phone_Key})=10,
NOT(REGEX({!School_Phone_Key} ,"^[a-z A-Z]*$")) ,
NOT(LEFT({!School_Phone_Key}, 1) = "1")
)

Now I also need to check if any symbol is presnt in the field, it should be restricted if the 10 digit number has any symbol. Can someone please guide me with the formula.

I have a flow that is trying to update records, but users are getting the following error message

This error occurred when the flow tried to update records: Too many SOQL queries: 101

Is there any criteria I can add to the update element to stop this from happening? 
  • August 25, 2021
  • Like
  • 0
I am trying to connect with the Salesforce via API call. I got the access token first by providing username, password, consumer key, consumer secret, grant_type. Then I used the access token and made the second call which is the actual API call for salesforce.

My question is, Is it possible to connect the Salesforce just using access token,username and password without really providing the consumer key and consumer secret or we definitely need the consumer key and consumer secret to connect with Salesforce.

We are using REST API and I don't want to use consumer key and consumer secret. Please suggested how to achieve this.
Hi all,

I have a requirement in VF email templae, I need to display subject based on condition as below.
<messaging:emailTemplate subject="{!IF((relatedTo.AppointmentType == 'care' || relatedTo.AppointmentType == 'service' ),'Appointment Confirmation # '+relatedTo.AppointmentNumber +' at '+relatedTo.ServiceTerritory.Name,'Appointment Confirmation # '+relatedTo.AppointmentNumber)}" recipientType="User" relatedToType="ServiceAppointment" renderUsingSystemContextWithoutSharing="True">
<messaging:htmlEmailBody >

for true condition also , when appointmenttype=service/care ,
Subject :Appointment Confirmation # SA-0586 ->false value is displaying everytime for both true and false scenarios

Can anyone help me in resolving the issue.

Thanks in advance
What if i have two json files i have to use aura if and match two values and show YES if two values were matching if not matching have to show else NO how it is possible can any one explain if possible 
 
Because i've tried the below code but it is not working and always displaying only else part 


<aura:if isTrue="{!firstjson.firstName== '!secondjson.firstName'}" >
                                                <td role="gridcell" tabindex="-1" data-label="Record Type Name">                            
                                                    <span class="slds-grid slds-grid_align-spread">
                                                        <div class="slds-truncate">                                        
                                                            <span class="slds-truncate">Yes</span>
                                                        </div>
                                                    </span>                            
                                                </td>
                                                <aura:set attribute="else">
                                                    <td role="gridcell" tabindex="-1" data-label="Record Type Name">                            
                                                        <span class="slds-grid slds-grid_align-spread">
                                                            <div class="slds-truncate">                                        
                                                                <span class="slds-truncate">No</span>
                                                            </div>
                                                        </span>                            
                                                    </td>
                                                </aura:set>
                                            </aura:if>
  • August 25, 2021
  • Like
  • 0
Hello everyone,
When I execute the following code from the anonymous window, it gave me the unexpected result. Please have a look,
Code-
datetime targetDate = Datetime.now();
Time tcurrentTime=targetDate.time();                
DateTime currentDateTime = datetime.newInstanceGmt(Date.today(), tcurrentTime);
string dayOfWeek = currentDateTime.format('EEEE');
Boolean isWithinBusinessHour = BusinessHours.isWithin('01m1H000000MbGw', currentDateTime);
System.debug('dayOfWeek '+dayOfWeek);
System.debug('isWithinBusinessHour '+isWithinBusinessHour);

Output-
User-added image

Business Hour-
User-added image
Expected output-
Boolean isWithinBusinessHour = BusinessHours.isWithin('01m1H000000MbGw', currentDateTime);
It must show "true" because current date exists in business hour.
any help would be appriciated
Thanks in advance!
Hi,

From everything I have seen, if I want to do a REST based callout or schedule or abort a scheduled job programatically, there is no good way to bulkify that process. I realize that batch APEX could be used, but from what I have seen, there is no way to run system.schedule or system.abort using a list as an argument or run something like:
 
HttpRequest req = new HttpRequest();
            req.setHeader('Authorization', 'Bearer ' + UserInfo.getSessionID()); 
            req.setHeader('Content-Type', 'application/json');
            req.setEndpoint(endpointUrl);
            req.setMethod('GET');
            Http h = new Http();
            HttpResponse res = new HttpResponse();
            try{
                res = h.send(req);
            }
            catch(System.CalloutException e){
            	calloutError1 = e.getMessage();
            }

using a list. So if I need to do something like this multiple times due to updates on multiple records, the best way I have seen to deal with it is to do the scheduled job or callout in a loop with an iterator that only allows a maximum number of iterations and then does exception handling if it goes over that number. 

Am I missing anything here? Is there any way to bulkify these sorts of things or any best practices about this type of situation?

Thanks,

Chris
 
  • August 25, 2021
  • Like
  • 0
Hi folks,
I have created a lightning record edit form in LWC. The form should open on pop up. After modal opens the background is visible. It should not visible. Any suggestions. Please refer my html and js code. If any CSS should to be create, please let me know.
User-added image------html----------
<template>
    <div class="slds-m-bottom_large">
        <div class="slds-grid slds-gutters">
            <div class="slds-col slds-size_4-of-5" style='font-weight: 500;font-size: 18px'>
                <span>RMA Case Line Item History</span>
            </div>
            <div class="slds-clearfix">
                <lightning-button label="New" variant="Neutral" onclick={newRmaForm} class="slds-float_right"></lightning-button>
            </div>
        </div>
    </div>
    <div class="landingpagebody">      
        <lightning-card title="">          
        <div class="slds-m-top_large">           
            <lightning-datatable key-field="id" data={rmarecord} columns={columns}></lightning-datatable>            
        </div>
    </lightning-card>
   
    <div if:true={showModal}>
        <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">
                    <lightning-icon style="cursor: pointer;" class="slds-float_right" icon-name="utility:close" size="small" onclick={handleClose} ></lightning-icon>
                    <h2 id="modal-heading-01" class="slds-modal__title slds-hyphenate">Create Case Line Item</h2>
                </header>
                <div class="slds-p-bottom_large slds-p-left_large" style="width:500px">
    <lightning-record-edit-form object-api-name="R4C_Case_Line_Item__c" columns = "2" layout-type = "compact">
        <lightning-messages></lightning-messages>
    <lightning-input-field field-name="Name"></lightning-input-field>
    <lightning-input-field field-name="Case__c"></lightning-input-field>
        <lightning-input-field field-name="EPM_Name__c"></lightning-input-field>
            <lightning-input-field field-name="MMID_BU_Hierarchy__c"></lightning-input-field>
                <lightning-input-field field-name="Remedy__c"></lightning-input-field>
                    <lightning-input-field field-name="Return_Reason__c"></lightning-input-field>
                    <lightning-input-field field-name="Return_Type__c"></lightning-input-field>
                    <lightning-input-field field-name="Stocking__c"></lightning-input-field>
            
            
        <lightning-button type="submit"
                          name="submit"
                          label="Create Case Line Item">
            </lightning-button>
    </lightning-record-edit-form>
    </div>
                <footer class="slds-modal__footer">
                    <button class="slds-button slds-button_neutral" onclick={handleCancel}>Cancel</button>
                    <button class="slds-button slds-button_brand" onclick={handleSave}>Save</button>
                </footer>
            </div>
        </section>
        <div class="slds-backdrop slds-backdrop_open"></div>
    </div>
    </div>
</template>
-------------------------js-------------------------
import { LightningElement, wire, track, api} from 'lwc';
import { getRecord, getFieldValue } from "lightning/uiRecordApi";
import { loadStyle } from 'lightning/platformResourceLoader';
// import CUSTOMCSS from '@salesforce/resourceUrl/recordForm'; //this is my static resource file name
import CONTACT_ID from "@salesforce/schema/User.ContactId";
import USER_ID from "@salesforce/user/Id";
import { ShowToastEvent } from 'lightning/platformShowToastEvent';
/* import NAME from '@salesforce/schema/R4C_Case_Line_Item__c.Name';
import Case from '@salesforce/schema/R4C_Case_Line_Item__c.Case__c';
import EPM_Name from '@salesforce/schema/R4C_Case_Line_Item__c.EPM_Name__c';
import MMID_BU_Hierarchy from '@salesforce/schema/R4C_Case_Line_Item__c.MMID_BU_Hierarchy__c';
import Remedy from '@salesforce/schema/R4C_Case_Line_Item__c.Remedy__c';
import Return_Reason from '@salesforce/schema/R4C_Case_Line_Item__c.Return_Reason__c';
import Return_Type from '@salesforce/schema/R4C_Case_Line_Item__c.Return_Type__c';
import Stocking from '@salesforce/schema/R4C_Case_Line_Item__c.Stocking__c'; */

export default class RmaCaseLineItem extends LightningElement {
    isCssLoaded = false;
    @api recordId;
    objectApiName = 'R4C_Case_Line_Item__c';
    showModal = false;
    @track rmarecord = false;
    @track conid;
  
 /* renderedCallback(){
        if(this.isCssLoaded) return
        this.isCssLoaded = true;
        loadStyle(this,CUSTOMCSS).then(()=>{
            console.log('loaded');
        })
        .catch(error=>{
            console.log('error to load');
        });
    } */
  
    newRmaForm(event){
    this.showModal = true;
   // fields = [NAME, Case, EPM_Name, MMID_BU_Hierarchy, Remedy, Return_Reason, Return_Type, Stocking];
}
 handleClick(){
        this.showModal = true;
    }
    handleClose(){
        this.showModal = false;
    }
handleSave(){
        this.template.querySelector('lightning-record-edit-form').submit();
        this.showModal = false;
        const evt = new ShowToastEvent({
            title: "Success!",
            message: "Case Line Item Created",
            variant: "success",
        });
        this.dispatchEvent(evt);
    }
    handleCancel(){
        this.showModal = false;
    }
    handleSubmit(event){
        event.preventDefault();       // stop the form from submitting
        const fields = event.detail.fields;
        fields.LastName = 'My Custom Last Name'; // modify a field
        this.template.querySelector('lightning-record-form').submit(fields);
     }
    @track columns = [
        {label:'R4C configuration name', fieldName:'R4C configuration name', type:'string'},
        {label:'Case', fieldName:'Case__c', type:'text'},
        {label:'EPM Name', fieldName: 'EPM_Name__c', type:'text'},
        {label:'Remedy', fieldName: 'Remedy__c',type:'data'},
        {label:'Return Reason', fieldName: 'Return_Reason__c',type:'data'},
        {label:'Return Type', fieldName:'Return_Type__c',type:'data'},
        {label:'Stocking', fieldName:'Stocking__c', type:'data'},
        {label:'MMID', fieldName:'MMID_BU_Hierarchy__c', type:'text'}
    ]
  @wire (getRecord, {recordId : USER_ID, fields: [CONTACT_ID]})
user;
get contactId() {
        this.conid = getFieldValue(this.user.data, CONTACT_ID);
        return getFieldValue(this.user.data, CONTACT_ID);
    } 
}
Here is my Requirement, 
Create a formula field that classifies an Opportunity as either “Early”, “Middle”, or “Late”. This formula field should use TODAY() to calculate what percentage of the time between an opportunity’s CreatedDate and CloseDate has passed, and label the opportunity accordingly.
This formula should be on the Opportunity object
This formula should be named 'Opportunity Progress' with the resulting API name Opportunity_Progress__c
This formula should return 'Early' if less than or equal to 25% of an opportunity has passed
This formula should return 'Middle' if between 25% and 75% of an opportunity has passed
This formula should return 'Late' if more than 75% of an opportunity has passed
This formula should reference a helper formula field, also on the Opportunity Object, with the type Percent and the name Percent Completed
Percent Completed should return the percentage of the time that has passed between an opportunity’s CreatedDate and CloseDate



here is my code:
IF
(TODAY() -  DATEVALUE(createdDate)) / (CloseDate - Datevalue(createdDate)) <= 0.25,"Early",
 
IF(AND(
(TODAY() -  DATEVALUE(createdDate))/(CloseDate-Datevalue(createdDate))>0.25,
(TODAY() -  DATEVALUE(createdDate))/(CloseDate-Datevalue(createdDate))<=0.75), "Middle",

IF(TODAY() -Datevalue(createdDate))/(CloseDate-Datevalue(createdDate))>0.75, "Late", Null)))
Hi Everyone,

I've created the Apex Classes referenced in the Salesforce article, "Enable an Object for Advanced Approvals."  

https://help.salesforce.com/s/articleView?id=cpq_enable_aa.htm&type=5&language=th

I've also created the Advanced Approvals buttons referenced here:

https://help.salesforce.com/s/articleView?id=sf.cpq_enable_aa_buttons.htm&type=5

I created a change set, and am in the process of validating it, but I've received two Apex Class failures, and I'm not sure what they're trying to tell me.  

QuoteExtControllerTests
testRecall
System.DmlException: Insert failed. First exception on row 0; first error: CANNOT_EXECUTE_FLOW_TRIGGER, We can't save this record because the “PB: CPQ Quote” process failed. Give your Salesforce admin these details. This error occurred when the flow tried to update records: INVALID_TYPE_ON_FIELD_IN_RECORD: Fuel Surcharge: value not of required type: . You can look up ExceptionCode values in the SOAP API Developer Guide.value not of required type: . You can look up ExceptionCode values in the SOAP API Developer Guide.: []
Stack Trace: Class.QuoteExtControllerTests.testRecall: line 19, column 1

QuoteExtControllerTests
testSubmit
System.DmlException: Insert failed. First exception on row 0; first error: CANNOT_EXECUTE_FLOW_TRIGGER, We can't save this record because the “PB: CPQ Quote” process failed. Give your Salesforce admin these details. This error occurred when the flow tried to update records: INVALID_TYPE_ON_FIELD_IN_RECORD: Fuel Surcharge: value not of required type: . You can look up ExceptionCode values in the SOAP API Developer Guide.value not of required type: . You can look up ExceptionCode values in the SOAP API Developer Guide.: []
Stack Trace: Class.QuoteExtControllerTests.testSubmit: line 6, column 1

I have a process builder called PB: CPQ Quote which takes the values from the account, and populates them on the quote level when created for use in Salesforce CPQ through some other processes.  The field referenced, Fuel Surcharge, is a checkbox field on both the account and quote level, and the process builder just references the field.

Anyone have any thoughts as to why the apex tests might be failing?

I greatly appreciate your help here.
  • August 24, 2021
  • Like
  • 0
Hello, I made a search component and I would like to lead to the record when I click on the field "Bezeichnung" which is an URL.

User-added image
Could you tell me how to change the controller so behind the url behind Bezeichnung leads to the record that was found in the suchleiste. For that purpose I add the Component too.


COMPONENT

<aura:component implements="force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId" access="global" controller="MediathekSearchController">
    
    <!-- handlers-->
    <aura:handler name="init" value="{!this}" action="{!c.init}"/>
    
    <!-- attributes -->
    <aura:attribute name="showSearchResults" type="Boolean" default="false"/>
    <aura:attribute name="searchKey" type="String"/>
    <aura:attribute name="mediathekList" type="List" default="Mediathek[]"/>
    <aura:attribute name="mediathekColumns" type="List"/>
    
    <div class= "slds-box">
        <div class="slds-grid slds-wrap" >
            <div class="slds-size_12-of-12">
        <lightning:layout multipleRows="true">
            <lightning:layoutItem  size="9">
                <lightning:input name="searchKey" placeholder="Enter search key" value="{!v.searchKey}"/>
            </lightning:layoutItem>
            <lightning:layoutItem  size="3">
                <lightning:button variant="brand" label="Search" title="Search" onclick="{!c.search}" class="customButton"/>
            </lightning:layoutItem>
        </lightning:layout>
    </div>
    </div>
    <div class="haha">
        <aura:if isTrue="{!v.showSearchResults}">
            <lightning:layout multipleRows="true">
                <lightning:layoutItem padding="around-small" size="8" >
                    <lightning:datatable keyField="id"
                                         data="{!v.mediathekList}"
                                         columns="{!v.mediathekColumns}"
                                         hideCheckboxColumn="true"/>
                </lightning:layoutItem>
            </lightning:layout>
        </aura:if>
    </div>
        </div>
    
    
    
</aura:component>

I'm trying to integrate my system with salesforce and want to package my components (triggers and classes).

I'm trying to create a package for my app, so that customers can directly install it from the URL i.e unmanaged package. Currently, I have created a Custom Metadata so that cliet can configure the URL, Token and other authentication details. These authentication details will be filled as a custom metadata record and my endpoint from Apex class will then be called to send the necessary information.

My question is 

Is there any better way to make the installation of unmanaged packages more flexible because right now customers will have to set up a new record providing the URL and token details which can change for any other customer?

  • August 23, 2021
  • Like
  • 0
What is the allowed syntax for v.attribute notation in controllers?

I found the same solution as @Jeff Hansen, but I'm curious about WHY. Why do we have to do
 
var a = component.get("v.item");
a.Packed__c = true;
component.set("v.item",a)

Instead of just doing
 
component.set("v.item.Packed__c",true)


to get the correct answer here?

I can't find documentation about this.

Thank you.

 

PS: is there a way to include code blocks in these questions and answers?

I am trying to create a simple VF page that renders a PDF from HTML that is passed in by my controller. Using the VF code below, the dynamic HTML renders properly as a regular VF page, but when I add the "renderAs="PDF" to my page tag, only the raw HTML appears in the PDF and not the properly rendered HTML.

 

The following correctly renders the dynamic HTML:

<apex:page controller="trainingLetterPDFController" >
    <apex:outputText value="{!LetterHTMLBody}" escape="false"/>
</apex:page>

 The following renders the page as a PDF showing the raw HTML text:

<apex:page controller="trainingLetterPDFController" renderAs="PDF">
    <apex:outputText value="{!LetterHTMLBody}" escape="false"/>
</apex:page>

 

Any suggestions on how to get this dynamic HTML to render in the PDF?

Thanks!

  • July 09, 2013
  • Like
  • 0