• Rakin Mohammed
  • NEWBIE
  • 10 Points
  • Member since 2021

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 5
    Questions
  • 1
    Replies

Hi guys. I have written a function to retrieve dependent multipicklist metadata that is stored, returning a Map of an Object (picklist label), and a String List. 
The object returned is initialized as follows:
Map<Object,List<String>> dependentPicklistValues
My first function call would return the following: 
{A=(x,y,z)}
My second function all would return the following:
{X=(l,m,n), Y=(o,p), Z=(q,r,s,t)}

I need to figure out a way to merge or iterate through these two maps and create a csv, preferably a csv file, that looks like the following
A | x | l
A | x | m

A | x | n

A | y | o 

A| y | p 
A |z | q  ... etc etc..

Thank you for all your help in advance!

Hi guys. I have a custom case object that prompts users upon creating a new case to select options from a picklist. Depending on which option is picked, the dependent sub-category picklist dependent options are shown. Followed by a third sub-category. I need to be able to retrieve the different options and their succeeding choices in an excel sheet, with the dependent data all on the same row. I use the Python requests library to create a session with the Salesforce server and extract information from the page css. I also have the API names of the three picklists. Could anyone point me in the right direction to pull the picklist and push to csv file.  

TLDR: Need help retrieving multi-picklist metadata and the dependent picklists. 
Hi guys. I have a custom case object that prompts users upon creating a new case to select options from a picklist. Depending on which option is picked, the dependent sub-category picklist is then shown. Followed by a third sub-category. I need to be able to retrieve the different options and their succeeding choices in an excel sheet, with the dependent data all on the same row. I use the Python requests library to create a session with the Salesforce server and extract information from the page css. I also have the API names of the three picklists. Could anyone point me in the right direction to pull the picklist and push to csv file.  
Hey guys, I've been tasked with the responsibility of creating a trigger to detect autoreply emails for cases created in salesforce. To do this, I have created a custom metadata object that multiple records of special words that can indicate an autoreply. Can someone tell me if my code is functioning properly, by adding the metadata records to a string set, then comparing the email string to the set? If not, can anyone point me in the right direction, thanks. 
private static void detectAutoresponse(){
    Autoresponse_Blacklist_mdt[] errorRecords = [SELECT MasterLabel, Body_Text_c from Autoresponse_Blacklist_mdt];
    Set<String> errorWords = new Set<String>;
    for(Autoresponse_Blacklist_mdt record: errorRecords){
        errorWords.add(record.Body_Text_c);
    }

    for(Case thisCase : (List<Case>)Trigger.new){
        for(Sting words: errorWords){
            if(thisCase.Contain == words)
                thisCase.addError('Not saving Automatic Reply');
        }    
    }
}

 
I'm stuck on this project currently. A case in salesforce is created every single time a user fills in a form and this causes an email to be sent to the user. However, an issue occurs with auto-reply emails resulting in email loop.
I've created a custom metadata object in salesforce for autoresponse emails (with a subject field and a body field), and I need to be able to code a trigger in Apex whenever a codeword in a list of our metadata records gets called.
**My question is, how can I code to check if an email contains a word that is in the metadata? Or in other words, query the metadata like a list. **
The current stand-in code snippet is as follows, the goal is to replace the string with a metadata object that can be updated outside of code. Any help is greatly appreciated!!
Current code:
for(Case thisCase : (List<Case>)Trigger.new){
    
        if(thisCase.Origin == 'Email - Access York') {
        
           if(thisCase.Subject.toLowerCase().startsWith('automatic reply:')) {
                thisCase.addError('Not saving Automatic Reply');
            }
             else if (thisCase.Subject.startsWith('Out of Office:')) {
                thisCase.addError('Not saving Out of Office');
            } 
            
        }
    
    else if(thisCase.Origin == 'Email - Transit') {
        
           if(thisCase.Subject.toLowerCase().startsWith('automatic reply:')) {
                thisCase.addError('Not saving Automatic Reply');
            }
             else if(thisCase.Subject.startsWith('Out of Office:')) {
                thisCase.addError('Not saving Out of Office');
            } 
            
        }

 
Hi guys. I have a custom case object that prompts users upon creating a new case to select options from a picklist. Depending on which option is picked, the dependent sub-category picklist is then shown. Followed by a third sub-category. I need to be able to retrieve the different options and their succeeding choices in an excel sheet, with the dependent data all on the same row. I use the Python requests library to create a session with the Salesforce server and extract information from the page css. I also have the API names of the three picklists. Could anyone point me in the right direction to pull the picklist and push to csv file.