• Victoria Ukatu
  • NEWBIE
  • 10 Points
  • Member since 2020

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 1
    Likes Given
  • 4
    Questions
  • 6
    Replies
Hi, sorry this is kind of a basic question, but I can't find the answer to it: How do you edit a button that has already been created? For example, if there's a custom button on an Accounts record page or Opportunities record page that a previous developer on my team created, how do I open that up to edit it? And what is the quick way to know what Visualforce page is connected to that button? (By edit, I mean the actual logic of the button, not change the layout of where it's located on the page.)
Thanks
Hi! I am trying to write a trigger to update a field on a custom object when an attachment is uploaded. My object is called Customer_Attachments__c and it has the field Attachment_IDs__c which is a list of attachment IDs: each time an attachment is uploaded, the attachment ID should be added to that list. But it's not working: it only adds the attachment ID after I click the Edit button on the record and click Save, but I want the ID to be added right away when the attachment is uploaded. I've tried copying the exact code from these similar posts https://developer.salesforce.com/forums/?id=906F00000008yrFIAQ and https://salesforce.stackexchange.com/questions/51532/trigger-updating-hyperlink-field-on-attachment-parent-record but it hasn't worked. 

My trigger looks like this:
trigger attachmentTrigger on Attachment (after insert) { 

        List<Customer_Attachments__c> ca = [SELECT Id, Attachment_IDs__c FROM Customer_Attachments__c WHERE Id=:trigger.new[0].parentId];
        if(ca.size() > 0){
            ca[0].Attachment_IDs__c = trigger.new[0].Id;
            update ca;
        }
}
It would be an added bonus if there was a way to add commas between the IDs, since right now it's just one long string.

Thanks!
Hi all,

I'm wondering how to conditionally render my Visualforce page based on the user's picklist selection. My picklist looks like this
<div class="slds-combobox-container" style="padding: 15px;">
         <apex:form >
             <apex:selectList value="{!selectedList}" size="1" styleClass="slds-select">
                 <apex:selectOptions value="{!listOptions}"></apex:selectOptions>
             </apex:selectList>
         </apex:form>
     </div>
where the user can choose Option A, Option B, or Option C. If they select Option A, I only want the records related to Option A to display, and the same idea with the other options. Right now all of the records are being displayed on the VF page regardless of which option I select. I know that there are answers out there related to picklists, but none that quite addressed this issue. 

Thanks!
 
I am relatively new to LWCs, so any help would be appreciated! :)
The project that I'm working on is a dictionary that pulls together terms and their definitions from my company's Salesforce org. Here's an example of a similar concept: https://docs.kumu.io/overview/collaboration.html  On the left, I have a sidebar table of contents which helps users navigate to the particular defintion they're looking for, which is displayed. 

I've created three Custom Objects Dictionary_Header__c, Dictionary_Section__c, and Dictionary_Term__c. Terms belong to a corresponding section, and each section belongs to a corresponding header (an example to illustrate: the structure of the dictionary is that Fruit would be a header, Citrus Fruit would be a section, and Lemon, Grapefruit, and Orange would all be terms underneath that section). 

Currently I am using Visual Studio Code to create the LWC. My JavaScript file looks like this: 
import { LightningElement, wire } from 'lwc';
 import getHeaderData from '@salesforce/apex/RetrieveDictionaryData.getHeaderData';
 import getSectionData from '@salesforce/apex/RetrieveDictionaryData.getSectionData';
 import getTermsData from '@salesforce/apex/RetrieveDictionaryData.getTermsData';


export default class Dictionary extends LightningElement {
 
  @wire(getHeaderData) header;
  @wire(getSectionData) section;
  @wire(getTermsData) term;

 }
My HTML file looks like this:
<template>
    <div id="top" class="slds-grid slds-wrap" style="padding: 10px;">
        <template if:true={header.data}>
            <div class="site-sticky-navbar site-sticky-navbar_docblock slds-col slds-large-size--2-of-12"
                style="padding: 10px;">
                <nav class="slds-nav-vertical" aria-label="Sub page">
                    <div class="slds-form-element slds-p-horizontal_large">
                        <label class="slds-form-element__label slds-assistive-text" for="input-id-01">Filter
                            navigation
                            items</label>
                        <div class="slds-form-element__control slds-input-has-icon slds-input-has-icon_left">
                            <span class="slds-icon_container slds-icon-utility-search">
                                <svg class="slds-icon slds-input__icon slds-input__icon_right slds-icon-text-default"
                                    aria-hidden="true">
                                    <use xlink:href="/assets/icons/utility-sprite/svg/symbols.svg#search"></use>
                                </svg>
                            </span>
                            <input type="search" id="input-id-01" placeholder="Type to search" class="slds-input" />
                        </div>
                    </div>

                    <div class="slds-nav-vertical__section">
                        <template for:each={header.data} for:item="h">
[ This is where I want the nested looping of headers, section titles, and dictionary terms ]
</nav>
 </div>
        </template>
    </div>
</template>
My Apex class looks like this:
public with sharing class RetrieveDictionaryData {
    @AuraEnabled(cacheable=true)
    public static List<Dictionary_Header__c> getHeaderData(){
         return [SELECT Id, Name FROM Dictionary_Header__c];   
    }
    @AuraEnabled(cacheable=true)
    public static List<Dictionary_Section__c> getSectionData(){
         return [SELECT Id, Name, Related_Dictionary_Header__c FROM Dictionary_Section__c];   
    }
    @AuraEnabled(cacheable=true)
    public static List<Dictionary_Term__c> getTermsData(){
         return [SELECT Id, Name, Related_Dictionary_Section__c, Definition__c FROM Dictionary_Term__c];   
    }
}
And my Visualforce page looks like this:
<apex:page showHeader="false">
    <apex:includeLightning />
    <div id="LightningComponentid" />    
    <script>
        $Lightning.use("c:MainDictionary", function() {
            $Lightning.createComponent("c:dictionary",
          { 
          },
          "LightningComponentid",
          function(cmp) {
             console.log('LWC Componenet added in VF page');
          });
    });
    </script>
</apex:page>
I'm able to succesfully bring the Custom Object records into Visual Studio Code, and I can display the headers so far. But now I want to correctly display all of the header, section, and term records. What I am confused about is how to use <template> in such a way that the correct section titles display under each header, and the correct terms display under each section title. Right now, the template for:each loops through and displays the headers okay, but I don't know how to go from there without having duplicates or having the wrong sections appear under the wrong headers. 

Does anyone know how to accomplish this? Thank you for your help! :)
Hi, sorry this is kind of a basic question, but I can't find the answer to it: How do you edit a button that has already been created? For example, if there's a custom button on an Accounts record page or Opportunities record page that a previous developer on my team created, how do I open that up to edit it? And what is the quick way to know what Visualforce page is connected to that button? (By edit, I mean the actual logic of the button, not change the layout of where it's located on the page.)
Thanks
Hi! I am trying to write a trigger to update a field on a custom object when an attachment is uploaded. My object is called Customer_Attachments__c and it has the field Attachment_IDs__c which is a list of attachment IDs: each time an attachment is uploaded, the attachment ID should be added to that list. But it's not working: it only adds the attachment ID after I click the Edit button on the record and click Save, but I want the ID to be added right away when the attachment is uploaded. I've tried copying the exact code from these similar posts https://developer.salesforce.com/forums/?id=906F00000008yrFIAQ and https://salesforce.stackexchange.com/questions/51532/trigger-updating-hyperlink-field-on-attachment-parent-record but it hasn't worked. 

My trigger looks like this:
trigger attachmentTrigger on Attachment (after insert) { 

        List<Customer_Attachments__c> ca = [SELECT Id, Attachment_IDs__c FROM Customer_Attachments__c WHERE Id=:trigger.new[0].parentId];
        if(ca.size() > 0){
            ca[0].Attachment_IDs__c = trigger.new[0].Id;
            update ca;
        }
}
It would be an added bonus if there was a way to add commas between the IDs, since right now it's just one long string.

Thanks!
Hi all,

I'm wondering how to conditionally render my Visualforce page based on the user's picklist selection. My picklist looks like this
<div class="slds-combobox-container" style="padding: 15px;">
         <apex:form >
             <apex:selectList value="{!selectedList}" size="1" styleClass="slds-select">
                 <apex:selectOptions value="{!listOptions}"></apex:selectOptions>
             </apex:selectList>
         </apex:form>
     </div>
where the user can choose Option A, Option B, or Option C. If they select Option A, I only want the records related to Option A to display, and the same idea with the other options. Right now all of the records are being displayed on the VF page regardless of which option I select. I know that there are answers out there related to picklists, but none that quite addressed this issue. 

Thanks!
 
I am relatively new to LWCs, so any help would be appreciated! :)
The project that I'm working on is a dictionary that pulls together terms and their definitions from my company's Salesforce org. Here's an example of a similar concept: https://docs.kumu.io/overview/collaboration.html  On the left, I have a sidebar table of contents which helps users navigate to the particular defintion they're looking for, which is displayed. 

I've created three Custom Objects Dictionary_Header__c, Dictionary_Section__c, and Dictionary_Term__c. Terms belong to a corresponding section, and each section belongs to a corresponding header (an example to illustrate: the structure of the dictionary is that Fruit would be a header, Citrus Fruit would be a section, and Lemon, Grapefruit, and Orange would all be terms underneath that section). 

Currently I am using Visual Studio Code to create the LWC. My JavaScript file looks like this: 
import { LightningElement, wire } from 'lwc';
 import getHeaderData from '@salesforce/apex/RetrieveDictionaryData.getHeaderData';
 import getSectionData from '@salesforce/apex/RetrieveDictionaryData.getSectionData';
 import getTermsData from '@salesforce/apex/RetrieveDictionaryData.getTermsData';


export default class Dictionary extends LightningElement {
 
  @wire(getHeaderData) header;
  @wire(getSectionData) section;
  @wire(getTermsData) term;

 }
My HTML file looks like this:
<template>
    <div id="top" class="slds-grid slds-wrap" style="padding: 10px;">
        <template if:true={header.data}>
            <div class="site-sticky-navbar site-sticky-navbar_docblock slds-col slds-large-size--2-of-12"
                style="padding: 10px;">
                <nav class="slds-nav-vertical" aria-label="Sub page">
                    <div class="slds-form-element slds-p-horizontal_large">
                        <label class="slds-form-element__label slds-assistive-text" for="input-id-01">Filter
                            navigation
                            items</label>
                        <div class="slds-form-element__control slds-input-has-icon slds-input-has-icon_left">
                            <span class="slds-icon_container slds-icon-utility-search">
                                <svg class="slds-icon slds-input__icon slds-input__icon_right slds-icon-text-default"
                                    aria-hidden="true">
                                    <use xlink:href="/assets/icons/utility-sprite/svg/symbols.svg#search"></use>
                                </svg>
                            </span>
                            <input type="search" id="input-id-01" placeholder="Type to search" class="slds-input" />
                        </div>
                    </div>

                    <div class="slds-nav-vertical__section">
                        <template for:each={header.data} for:item="h">
[ This is where I want the nested looping of headers, section titles, and dictionary terms ]
</nav>
 </div>
        </template>
    </div>
</template>
My Apex class looks like this:
public with sharing class RetrieveDictionaryData {
    @AuraEnabled(cacheable=true)
    public static List<Dictionary_Header__c> getHeaderData(){
         return [SELECT Id, Name FROM Dictionary_Header__c];   
    }
    @AuraEnabled(cacheable=true)
    public static List<Dictionary_Section__c> getSectionData(){
         return [SELECT Id, Name, Related_Dictionary_Header__c FROM Dictionary_Section__c];   
    }
    @AuraEnabled(cacheable=true)
    public static List<Dictionary_Term__c> getTermsData(){
         return [SELECT Id, Name, Related_Dictionary_Section__c, Definition__c FROM Dictionary_Term__c];   
    }
}
And my Visualforce page looks like this:
<apex:page showHeader="false">
    <apex:includeLightning />
    <div id="LightningComponentid" />    
    <script>
        $Lightning.use("c:MainDictionary", function() {
            $Lightning.createComponent("c:dictionary",
          { 
          },
          "LightningComponentid",
          function(cmp) {
             console.log('LWC Componenet added in VF page');
          });
    });
    </script>
</apex:page>
I'm able to succesfully bring the Custom Object records into Visual Studio Code, and I can display the headers so far. But now I want to correctly display all of the header, section, and term records. What I am confused about is how to use <template> in such a way that the correct section titles display under each header, and the correct terms display under each section title. Right now, the template for:each loops through and displays the headers okay, but I don't know how to go from there without having duplicates or having the wrong sections appear under the wrong headers. 

Does anyone know how to accomplish this? Thank you for your help! :)
I am building a list of our preferred vendors and want to show it in a custom lightning web component. I would like all vendors of the same 'Category' to be listed together, with just one header. 
User-added image

As you can see, when there are multiple vendors in one cateogry, the category name/head displays twice. I am sure I could get what I need, through making multiple calls in apex (one for each category), but it seems ideal and more efficient to get all the vendors in one call, and then just adjust their grouping in the lightning web component. 

I query the data in the controller, then display it in the lwc as such: 
<template for:each={vendors.data} for:item="vendor">
                <div key={vendor.Id}>                   
                    <div class="slds-text-heading_small">{vendor.Category_Name__c}</div>
                    <p><lightning-formatted-rich-text value={vendor.Vendor__c} ></lightning-formatted-rich-text></p>
                </div>
            </template>

 
Hi all,

We are working in our sandbox and creating a new custom Button type URL to redirect to a visualforce page I'm getting this error:
User-added image

Here's my button code:
 
window.location = '/apex/FinancialRequest_New'

Even I'm setting the button to use it as  URL '/apex/FinancialRequest_New' , the message is the page no longer exist, so still the same issue.

Thanks in advance.