• GreyGorilla Vapor
  • NEWBIE
  • -2 Points
  • Member since 2021

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 9
    Replies
  public with sharing class MessageTemplatesCtrl {
   @TestVisible
   private MessageTemplatesCtrl() { /** controller class, non-constructable */ }

    @AuraEnabled(cacheable=true)
    public static List<QuickText> getQuickTextTemplates(List<String> folderNames, List<String> categories){
        // null checks
        if(folderNames == null || folderNames.size() == 0)
            throw new AuraHandledException('folderNames argument may not be null or an empty array');

        List<QuickText> templates = (List<QuickText>) Database.query(
            'SELECT FIELDS(Standard) FROM QuickText WHERE Folder.DeveloperName IN :folderNames' + 
            ((categories == null || categories.size() == 0) ? '' : ' AND Category IN :categories')
            );
        
        return templates;
    }

}
The formula field needs to function like this.
It looks at one PL field (ChempaxDB), and then look at a 2nd PL field, and based on the vales of the 2 PL fields, populate with a specific value.
An example would be, (1st PL Field) ChempaxDB = CASE, and (2nd PL Field) Division = 01, the Divisoin Name Field (this is the formula field) populates with "01 - Chemical Raw Materials".
This is what I have come up with but can;t get the formula to work:

OR (IF ( ISPICKVAL( Chempax_DB__c , "CASE"),
CASE( Division__c  ,
"01", "01 - CHEMICAL RAW MATERIALS",
"10", "10 - Azelis CASE, LLC - Garland",
"15", "15 - FOOD PRODUCTS",
"19", "19 - Azelis CASE Garland Direct",
"20", "20 - Azelis CASE - Houston",
"21", "21 - Azelis CASE Bulk",
"29", "29 - Azelis CASE Houston - Direct",
"30", "30 - Azelis CASE - Phoenix",
"31", "31 - Azelis CASE Denver",
"39", "39 - Azelis CASE Direct - Phoenix",
"40", "40 - Azelis Americas CASE, LLC",
"45", "45 - INTERCO ORDERS/TRANSFERS CASE",
"50", "50 - Azelis Americas CASE, LLC",
"51", "51 - Azelis Construction Solutions",
"52", "52 - Azelis CASE Fulton",
"54", "54 - CASE HOUSE ACCOUNTS",
"55", "55 - Azelis CASE, LLC - Atlanta",
"56", "56 - Azelis CASE, LLC - Greenville",
"57", "57 - Azelis CASE, LLC - Meredith",
"58", "58 - FINE INGREDIENTS GROUP",
"59", "59 - Ribelin Atlanta - Direct",
"60", "60 - Azelis CASE, LLC- Orlando",
"61", "61 - Azelis CASE, LLC - Whitaker",
"69", "69 - Azelis CASE Orlando - Direct",
"70", "70 - GMZ - SW",
"88", "88 - DL Trading Duty Drawback",
"89", "89 - Azelis CASE, LLC - IC",
"90", "90 - Azelis CASE, LLC - IC",
"91", "91 - ACS - Intercompany",
"92", "92 - Azelis CASE, LLC - IC",
"94", "94 - GMZ SW COMMISSIONS",
"95", "95 - OPERATIONS",
"96", "96 - COMMISSIONS - CHEMICAL",
"97", "97 - COMMISSIONS - CONTAINERS",
"98", "98 - COMMISSIONS",
"99", "99 - Azelis CASE, LLC - Supplier",
                    null),  

IF ( ISPICKVAL( Chempax_DB__c ,"DeWolf" ),
CASE( Division__c ,
"10", "10 - DeWolf - Industrial Line HI&I",
"20", "20 - DeWolf - Personal Care Line",
"23", "23 - Dewolf - Color Cosmetics",
"89", "89 - DeWolf Intercompany Sales",
null),            

IF ( ISPICKVAL( Chempax_DB__c ,"Glenn" ),
CASE( Division__c ,
"03", "03 - Cosmetic",
"04", "04 - Reseller",
"06", "06 - CAS Number"
"10", "10 - Industrial and Institutional",
"20", "20 - Personal Care",
"23", "23 - Color Cosmectics",
"89", "89 - Glenn Intercompany Sales",
"90", "90 - Glenn Sales To DeWolf",
null),
                
IF ( ISPICKVAL( Chempax_DB__c ,"Marcor" ),
CASE( Division__c ,
"30", "30 - KDG CORPORATE",
"80", "80 - MARCOR DEVELOPMENT",
"89", "89 - INTERCOMPANY SALES",
null),
                
IF ( ISPICKVAL( Chempax_DB__c ,"Monson" ),
CASE( Division__c ,
"01", "01 - INDUSTRIAL SPECIALTIES",
"05", "05 - PIGMENTS AND PLASTICIZERS
"10", "10 - GENERAL INDUSTRIAL",
"15", "15 - FINE INGREDIENTS",
"20", "20 - NON-TOXIC",
"24", "24 - FOCUSED INDUSTRIAL",
"51", "51 - MONSON CO CHEMICAL DIV",
"52", "52 - MONSON CO LMW DIVISION",
"61", "61 - COMMISSION PRODUCTS ISG",
"62", "62 - GIG COMMISSION PRODUCTS",
"63", "63 - PWT COMMISSIONS",
"64", "64 - COMMISSIONS - P&P",
"70", "70 - AUTOMOTIVE/FREEZE PROTECT",
"75", "75 - ICE MELTERS",
"88", "88 - FRT CLAIMS FOR CARRIERS",
"89", "89 - INTERCOMPANY",
"95", "95 - OPERATIONS, SERV WHS, MISC",
"98", "98 - MONSON COMPANIES FREIGHT",
"99", "99 - COMMISSIONS RECEIVABLE",
null),
                    
IF ( ISPICKVAL( Chempax_DB__c ,"Ross" ),
CASE( Division__c ,
"10", "10 - Ross Organic",
"20", "20 - Ross - Personal Care Line",
"23", "23 - Color Cosmetics",
"89", "89 - Ross Intercompany Sales",
null),
null))

Thank you,
Shawn
I'm testing filtered subscriptions to pushtopics with a test visualforce page. This is the code:

Controller:
 
public with sharing class PruebaPushTopicFiltradoController {

    public List<mlsales__Etiqueta_Zebra__c> etiquetas{get;set;}

    public PruebaPushTopicFiltradoController() {
        etiquetas = [SELECT Id, Documento_Id__c, Name, Identificacion_Impresora__c FROM Etiqueta_Zebra__c  ORDER BY Name LIMIT 5];
    }
}

Visualforce page:
<apex:page standardStylesheets="false" controller="PruebaPushTopicFiltradoController" showHeader="TRUE" sidebar="false">
    <link rel="stylesheet" type="text/css" href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css" />
    <div class="container">
        <table id="oppTable" class="table table-hover table-bordered table-striped">
            <thead>
                <tr>
                    <th>
                        Documento Id
                    </th>
                    <th>
                        Name
                    </th>
                    <th>
                        Identificacion Impresora
                    </th>  
                </tr>                      
            </thead>
            <tbody>
                <apex:repeat value="{!etiquetas}" var="etiqueta"> 
                    <tr>
                        <td>
                            {!etiqueta.Documento_Id__c}
                        </td>
                        <td>
                            {!etiqueta.Name}
                        </td>
                        <td>
                            {!etiqueta.Identificacion_Impresora__c}
                        </td>  
                    </tr>  
                </apex:repeat>
            </tbody>
        </table>
    </div>
    <script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.0/jquery.min.js"></script>    
    <script src="{!URLFOR($Resource.jsUtilities, '/js/json2.js')}"></script>
    <script src="{!URLFOR($Resource.jsUtilities, '/js/cometd.js')}"></script>
    <script src="{!URLFOR($Resource.jsUtilities, '/js/jquery.cometd.js')}"></script>
    <script>
      // initizlizing Streaming API
      (function($) {
        $(document).ready(function() { 
          //Initializing cometd library to cometd endpoint
          $.cometd.init({
            url: window.location.protocol + '//' + window.location.hostname + '/cometd/33.0/',
            requestHeaders: {
              Authorization: 'OAuth {!$Api.Session_ID}'
            },
            appendMessageTypeToURL : false
          });

          // Subscribing to the push topic. 
          //JSON-encoded data will be returned in the callback each time whenever opportunity is created
          $.cometd.subscribe("/topic/getZebraToPrint?mlsales__Identificacion_Impresora__c='test'", function(message) {
            console.log(message);
            if (message.data.event.type == 'created') {
                console.log('created object ===> ' + message.data.sobject);
                var etiqueta = message.data.sobject; 
              $("#oppTable > tbody").append('<tr class="success"><td>'+etiqueta.mlsales__Documento_Id__c+'</td><td>'+etiqueta.Name+'</td><td>'+etiqueta.mlsales__Identificacion_Impresora__c+'</td></tr>');
            }
          });
          
        });
      })(jQuery)    
    </script>
</apex:page>

The string I'm passing as parameter for the subscribe method contains the filtering I need. the subscription works correctly, but doesn't filter, it gets all objects created despite whats the value of that field. Is the problem in the structure of the string, or doesn't it work this way? I can't find specific documentation for this. Any help is appreciated!
 
Hello. I feel like there is a basic answer to my question that I simply am not using the right terms to search for to find the answer. 

Our CONTRACT object has a contract type picklist (Principal Agreement, Amendment, etc). On the CONTRACT I have a field for Principal Agreement so I am able to track all Amendments and other child contracts tied to the principal contract. 

We have a custom objection LOCATION.

From a non-SF perspective:
A LOCATION may have many CONTRACTS across many ACCOUNTS and a CONTRACT may be related to multiple LOCATIONS. 

I had planned to create a CUSTOMER-LOCATION junction object, but am a bit stuck because a CUSTOMER-LOCATION may have many CONTRACTS associated with it: a principal contract and then be impacted by later amendments. These amendments will change the details of this CUSTOMER-LOCATION profile (think fields like headcount, equipment count) so they all need to be able to be associated with it. 

I can create a CUSTOMER-LOCATION object that captures the info, but can only relate to one CONTRACT or I can create a CONTRACT-LOCATION object but then I have duplicates of these for the same Customer because each CONTRACT iteration will have its own. 

I have tried every way I can think of but am limited by the number of Master-Child relationships per object. I believe I must be missing the obvious here and would appreciate any shared insight. 

At the end of the day I want to view
  • All associated LOCATIONS on each CONTRACT
  • All ACCOUNTS related to a specific LOCATION
  • All CONTRACTS for a LOCATION
  • All LOCATIONS for an ACCOUNT 
  • By default I have all CONTRACTS for each ACCOUNT
Thanks in advance. 
Hello, everyone. 

I am new to Salesforce (I've began studying it about 1 month ago). 

There are some projects that I intend to implement on my Salesforce Professional Edition, but I am stuck due to some limitations. Since I don't have much experience with the platform, I wonder if the community of developpers could help me confirm if, in fact, my edition doesn't allow me to develop them, and if I need to upgrade my edition.

The implementations are described below:

1) Send scheduled email alerts

We want to send e-mail alerts when expiration dates of opportunities' contracts are approaching. In this context, we want to send weekly emails corresponding to each opportunity.

I've tried to do this by using Flow and Process Builder. Nevertheless, I always get the error message shown on this topic https://trailhead.salesforce.com/trailblazer-community/feed/0D54S00000BuOazSAF (bear with me...the french community seamed more active, so I tried to ask for help in french :) - google translator required). 

TL DR.: Error message = "insufficient access rights on cross-reference id"

2) Build a list of e-mails

The objective here is to make the sending of email messages more transparent. For example, if a sales representant sends an email to an opportunity, we want to make this message visible on Salesforce. At each opportunity page, there would be a "e-mails" tab, where we could show these messages.

3) Access data from external sources 

We want to access data contained on Google Cloud Big Query and Google Sheets. Note: We don't have access to Salesforce API on Professional Edition.


Actually, I think that the main question here is: 

What can developpers do on Salesforce Professional Edition? 

As a begginer, I am finding a lot of barriers. The things I was able to do so far are the following:

Change Pages' Layouts
Create New Objects and Fields
Create Email Alerts

Things I identified that I can't do:

Create Apex Classes
Create Customized Metadata
Access external API's
 
Hi All, 
          When i enter any word in the lookup in the component i ma getting this error: Uncaught Action failed: c:CustomLookup$controller$keyPressController [Cannot read properties of undefined (reading 'length')]

My Component and controller is as follow:- 
<aura:component controller="Lookup_Controller">
    <!--declare attributes--> 
    <aura:attribute name="selectedRecord" type="sObject" default="{}" description="Use,for store SELECTED sObject Record"/>
    <aura:attribute name="listOfSearchRecords" type="List" description="Use,for store the list of search records which returns from apex class"/>
    <aura:attribute name="SearchKeyWord" type="string"/>
    <aura:attribute name="objectAPIName" type="string" default=""/>
    <aura:attribute name="IconName" type="string" default=""/>
    <aura:attribute name="label" type="string" default=""/>
    <aura:attribute name="Message" type="String" default=""/>
    
    <!--declare events hendlers-->  
    <aura:handler name="oSelectedRecordEvent" event="c:SelectedSObjectRecordEvent" action="{!c.handleComponentEvent}"/>
    
    <div onmouseleave="{!c.onblur}" aura:id="searchRes" class="slds-form-element slds-lookup slds-is-close" data-select="single">
        <label class="slds-form-element__label" for="lookup-348">{!v.label}</label>
        <div class="slds-form-element__control">
            
            <div class="slds-input-has-icon slds-input-has-icon--right">
                <div aura:id="lookup-pill" class="slds-pill-container slds-hide">
                     <lightning:pill class="pillSize" label="{!v.selectedRecord.Name}" name="{!v.selectedRecord.Name}" onremove="{! c.clear }">
                          <aura:set attribute="media">
                             <lightning:icon iconName="{!v.IconName}" size="x-small" alternativeText="{!v.IconName}"/>
                          </aura:set>
                      </lightning:pill>
                </div>
                <div aura:id="lookupField" class="slds-show" >
                    <lightning:icon class="slds-input__icon slds-show" iconName="utility:search" size="x-small" alternativeText="search"/>
                    <span class="slds-icon_container  slds-combobox__input-entity-icon" title="record">
                        <lightning:icon class="slds-icon slds-icon slds-icon_small slds-icon-text-default" iconName="{!v.IconName}" size="x-small" alternativeText="icon"/>
                        <span class="slds-assistive-text"></span>
                    </span>
                    <div onkeypress="{!c.keyPressController}" > 
                        <lightning:input aria-invalid="true" style="margin:0px !important" onclick="{!c.onfocus}"  class="slds-lookup__search-input slds-input leftPaddingClass" value="{!v.SearchKeyWord}" placeholder="search.."/>
                    </div>
                </div>   
            </div>
        </div>  
        <ul style="min-height:40px;margin-top:0px !important" class="slds-listbox slds-listbox_vertical slds-dropdown slds-dropdown_fluid slds-lookup__menu slds" role="listbox">
            <lightning:spinner class="slds-hide" variant="brand" size="small" aura:id="mySpinner"/>
            <center> {!v.Message}</center>
            <aura:iteration items="{!v.listOfSearchRecords}" var="singleRec">
                <c:CustomLookupResult oRecord="{!singleRec}" IconName="{!v.IconName}"/>
            </aura:iteration>
        </ul>
    </div>
</aura:component>

Controller:-
({
   onfocus : function(component,event,helper){
       $A.util.addClass(component.find("mySpinner"), "slds-show");
        var forOpen = component.find("searchRes");
            $A.util.addClass(forOpen, 'slds-is-open');
            $A.util.removeClass(forOpen, 'slds-is-close');
        // Get Default 5 Records order by createdDate DESC  
         var getInputkeyWord = '';
         helper.searchHelper(component,event,getInputkeyWord);
    },
    onblur : function(component,event,helper){       
        component.set("v.listOfSearchRecords", null );
        var forclose = component.find("searchRes");
        $A.util.addClass(forclose, 'slds-is-close');
        $A.util.removeClass(forclose, 'slds-is-open');
    },
    keyPressController : function(component, event, helper) {
       // get the search Input keyword   
         var getInputkeyWord = component.get("v.SearchKeyWord");
       // check if getInputKeyWord size id more then 0 then open the lookup result List  
       // else close the lookup result List part.   
        if( getInputkeyWord.length > 0 ){

             var forOpen = component.find("searchRes");
               $A.util.addClass(forOpen, 'slds-is-open');
               $A.util.removeClass(forOpen, 'slds-is-close');
            helper.searchHelper(component,event,getInputkeyWord);
        }
        else{  
             component.set("v.listOfSearchRecords", null ); 
             var forclose = component.find("searchRes");
               $A.util.addClass(forclose, 'slds-is-close');
               $A.util.removeClass(forclose, 'slds-is-open');
          }
    },
    
  // function for clear the Record Selaction 
    clear :function(component,event,heplper){
         var pillTarget = component.find("lookup-pill");
         var lookUpTarget = component.find("lookupField"); 
        
         $A.util.addClass(pillTarget, 'slds-hide');
         $A.util.removeClass(pillTarget, 'slds-show');
        
         $A.util.addClass(lookUpTarget, 'slds-show');
         $A.util.removeClass(lookUpTarget, 'slds-hide');
      
         component.set("v.SearchKeyWord",null);
         component.set("v.listOfSearchRecords", null );
         component.set("v.selectedRecord", {} );   
    },
    
  // This function call when the end User Select any record from the result list.   
    handleComponentEvent : function(component, event, helper) {
    // get the selected Account record from the COMPONETN event      
       var selectedAccountGetFromEvent = event.getParam("recordByEvent");
       component.set("v.selectedRecord" , selectedAccountGetFromEvent); 
       
        var forclose = component.find("lookup-pill");
           $A.util.addClass(forclose, 'slds-show');
           $A.util.removeClass(forclose, 'slds-hide');
  
        var forclose = component.find("searchRes");
           $A.util.addClass(forclose, 'slds-is-close');
           $A.util.removeClass(forclose, 'slds-is-open');
        
        var lookUpTarget = component.find("lookupField");
            $A.util.addClass(lookUpTarget, 'slds-hide');
            $A.util.removeClass(lookUpTarget, 'slds-show');  
      
    },
})
Can anyone help me with this error? I am getting this error from Bold lines.

Thanks
Hi everyone,

I recently hid a custom button from Lightning and enabled it back again in the page layouts. But it does not show in Lightning, but works fine in Classic. What should I do it make it visible again?
User-added image
Hi, we are looking for a London based Salefsforce developer/architect who can help us to connect a sign up form on Craft CMS (created by someone else) with Salesforce. Our aim is to create/update contacts and accounts and to create new campaign members.
Thank you