• Connor Cain
  • NEWBIE
  • 40 Points
  • Member since 2018

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 16
    Questions
  • 17
    Replies
We have run into an interesting problem; we are creating a table of AccountContactRelations for the users to edit fields from the account, Contact, and Account Contact relation for mulitple accounts they are assigned. 

here is our Query:
List<AccountContactRelation> a = [SELECT id, AccountId, Account.Name, Contact.LastName, Roles FROM AccountContactRelation]

We display these to the user for them to quickly edit, but the issue comes when we need to save the records. how would we be able to save Account.Name and Contact.LastName?
I am creating a Validation rule that a field cant be changed once a date is pasted unless you are a system admin, this all works except the ISCHANGED() section which wont work. Any help would be appreciated.
members__c is a number field and Start_Date__c is a date field.

AND(
$Profile.Name <> 'System Administrator',
ISCHANGED(Members__c),
Start_Date__c <= TODAY()
)
I am trying to create a Custom class to better display a list of multiple objects but when i search for my variables of the Class, the Visualforce throws a code like: "Unknown property 'AccountTestExtension.AccountDataModel.Size' " as well as the Title variable.

Visual Force
<apex:repeat value="{!AccountGroups}" var="AG">
           <tr>
                    <th colspan="{!AG.Size}" scope="row">{!AG.Title}</th>
                    <th colspan="2" scope="row">{!AG.Notes}</th>
           </tr>
           <apex:repeat value="{!AG.Accounts}" var="acc">
                     <tr>
                        <td><apex:outputField value="{!acc.Name}"  style=" height: 40px"/></td>  
                        <td><apex:inputField value="{!Acc.Notes__c}"  style=" height: 40px"/></td>
                        <td><apex:inputField value="{!QAC.Description}"  style=" height: 40px"/></td>
                     </tr>                
            </apex:repeat>
</apex:repeat>
Apex:
public List<AccountDataModel> AccountGroup;

//main code to sort Accounts into different groups and create the different inputs of AccountGroup
//
//

public with Sharing Class AccountDataModel{
        public String Title;
        public Integer Size;
        public String Notes;
        Public List<Account> Accounts;
        public QADataModel(String title, Integer sze, String note,List<Accounts> Acc){
            this.Title = title;
            this.Size = sze;
            this.Notes = note;
            this.Accounts = acc;
        }
        
    }


 
hello Everyone,

As strange as it sounds I am looking for a way to Activate all picklist values on the field level and recordtype level on an Object using Apex. This way, for a time, all records with deactivated values can be cloned or inserted.

 
Hello! I am trying to Pass 3 values from the URL to a Query for Conga. The document worked until I added the Multiple Values to the Ive followed the Conga document to have this is my URL:

&QueryId=[DataGatheringTaskbeta]a0o18000000J68aAAC?pv0={!Field1}~pv1={!Field2}~pv2{!Field3},

And the query following:

SELECT fields FROM task WHERE WhatId = 'pv0' OR WhatId = 'pv1' OR WhatId = 'pv2'

When generating the Document i get this error:

'Unable to parse the query id entries, please check the URL syntax.'


What am I doing wrong or should I break up the query into 3 queries and do a query per value?
Is It possible to only have an Apex method called only when the tab it is under is selected? The code is displaying a query under each tab and I am trying to avoid a Apex CPU Limit reached.
hello everyone,
We have a Lightning Web Component with 3 Comboboxes. I built out the first one using the code from the Lighting Web Component resource page and it works great. I then copied and pasted the code (while changing the value names and labels as to not cause an error)  but the two new Combo Boxes arent working. when selecting a value the ComboBox returns a null value rather than the initial ' ' value and doesnt select the value I wanted to select. 
How do I remove the bit of space inbetween the tab and its content in our Lightning Web Component?
User-added image
Ive created a Apex class that creates a record when a document is downloaded to have record that someone downloaded it, here is the code:
public class *method* implements Sfc.ContentDownloadHandlerFactory {

    public Sfc.ContentDownloadHandler getContentDownloadHandler(List<ID> ids, Sfc.ContentDownloadContext context) {
    	Sfc.ContentDownloadHandler contentDownloadHandler = new Sfc.ContentDownloadHandler();
        customObject__c um = new customObject__c();
  		um.User_Name__c = UserInfo.getName();
  		um.Access_Date__c = datetime.now();
  		um.Record_ID__c = ids.get(0);
    	        um.Type__c = 'File Download';
  		insert um;
        contentDownloadHandler.isDownloadAllowed = true;
        return contentDownloadHandler;
    }
}

how would I write a Test Class to simulate a User Downloading a File?
I know I might be using this wrong but its worth a shot to ask.
We are looking to autogenerate 73 tasks (always changing) when a record is create. rather than edit process builders every year I have the code check a CSV saved as a Static Resource and build the tasks from the list. 
now rather than let them edit this file, I would like to set up some Code (and UI) to edit the Static Resource CSV and add lines to it. Is this possible or should I be saving this file somewhere else?
Hello everyone,
Not sure if this is the right place for this but I am working on installing Salesforce CLI and finally got it to work, only problem is I have to drill down from my C:\User\*name*> all the way down to where the Files are in C:\Program Files. when i see all the tutorials online, people seem to be able to open it immediately while in their user directory in command prompt. Is there a way to set it so I can do this as well?
I can't get a test class to work for a Trigger that is only looking for when a Case Comment is Updated.

trigger validation on CaseComment (before update) {  
    if(Trigger.isUpdate){
        for(CaseComment caseCmt : Trigger.new){
            if(caseCmt.CreatedById != System.UserInfo.getUserId()){
                caseCmt.addError('You can not edit Someone else\'s Comment');
            }
        }
    }
}

Any Help/Advice would be appreciated:)
hello, i am printing a Table into a Excel spread-sheet and need the text to wrap in the <Cell> tags? Below is the Style im using so far

<Style ss:ID="s1">
                   <Alignment/>
                        <Borders>
                        <Border ss:Position="Bottom" ss:LineStyle="Double" ss:Weight="3"/>
                        <Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="1"/>
                    </Borders>
                       <Font ss:Bold="1"/>
                       <Interior ss:Pattern='Solid' ss:Color="#2f9f38" ss:white-Space="normal"/>
                    <NumberFormat/>
                    <Protection/> 
                 </Style>
I am building an Apex project that will display a current Data Dictionary of our Org for Specific objects. I am also using this project to learn how to program in Apex and this is my first experience. I have build out a working model that gets the Api Name, label, and Datatype from the code below:
---------------------------------------------------------------------------------------------------------------
public static List<DataPoint> getAccountList(){
        List<DataPoint> myList = new List<DataPoint>();
        List<FieldDefinition> Query1 = new List<FieldDefinition>([Select DeveloperName, Label, Datatype From FieldDefinition where EntityDefinition.QualifiedApiName = 'Account' ORDER BY DeveloperName limit 1000]);
        For(Integer i = 0; i < Query1.Size(); i++){
            Try{
                String Q1 = String.valueOf(Query1[i]);
                DataPoint dp = new DataPoint(Q1.substringBetween('DeveloperName=',', Label='),
                                             Q1.substringBetween('Label=',', DataType='),
                                             Q1.substringBetween('DataType=',', EntityDefinitionId='),
                                             '', '', '');  //just a stand in 
               //Query to get Inhelptext, Description, and Created Date 
               //Add Inhelptext, Description, and Created Date to dp where the DeveloperName matches 
                myList.add(dp); 
            }Catch(System.NullPointerException e){
                 myList.add(new DataPoint('','','','','',''));
            }
        }
        Return myList;
    }
---------------------------------------------------------------------------------------------------------------
**DataPoint is just a custom class I built to hold the values and display them on the VisualForce Page. 
Now I would like to query InhelpText, Description, and maybe Created Date from CustomFields but I run into errors like [invalid: Customfield] because CustomField needs the Tooling API to be able to query into this.
So for my Question, How can I get the Description, InlineHelpText, to be able to put into these lists and complete the Data Dictionary? Is there a Work around to allow Tooling API or should I be taking a different approach? What can I add to my code above to make it work?
 

I am working on creating a Automated Data Dictionary using Conga Composer. I am looking to Get the Label, API name, DataType, and Description.Right now I am Able to run this query into the FieldDefinition:

Select DeveloperName, Label, Datatype 
From FieldDefinition where EntityDefinition.QualifiedApiName = 'Plan__c' 
ORDER BY DeveloperName


But when i run this Query into CustomField i get an Error:
Select DeveloperName, Label, Datatype 
From FieldDefinition where EntityDefinition.QualifiedApiName = 'Plan__c' 
ORDER BY DeveloperName


Error:
ERROR at Row:1:Column:53
sObject type 'CustomField' is not supported. If you are attempting to use a custom object, be sure to append the '__c' after the entity name. Please reference your WSDL or the describe call for the appropriate names.



I am able to run both Queries in Dev Console but how can I Run both in Conga to get the Information I want. or is there even a better way?

When Changing the Case Owner and Selecting "Send Notification Email", the email isnt being sent, When checking the Email Log, It looks like the email is there. Email Deliverability is set to "All Emails". Whats wrong and how can I start recieving these Emails?
User-added image




 
I am creating a Validation rule that a field cant be changed once a date is pasted unless you are a system admin, this all works except the ISCHANGED() section which wont work. Any help would be appreciated.
members__c is a number field and Start_Date__c is a date field.

AND(
$Profile.Name <> 'System Administrator',
ISCHANGED(Members__c),
Start_Date__c <= TODAY()
)
I am trying to create a Custom class to better display a list of multiple objects but when i search for my variables of the Class, the Visualforce throws a code like: "Unknown property 'AccountTestExtension.AccountDataModel.Size' " as well as the Title variable.

Visual Force
<apex:repeat value="{!AccountGroups}" var="AG">
           <tr>
                    <th colspan="{!AG.Size}" scope="row">{!AG.Title}</th>
                    <th colspan="2" scope="row">{!AG.Notes}</th>
           </tr>
           <apex:repeat value="{!AG.Accounts}" var="acc">
                     <tr>
                        <td><apex:outputField value="{!acc.Name}"  style=" height: 40px"/></td>  
                        <td><apex:inputField value="{!Acc.Notes__c}"  style=" height: 40px"/></td>
                        <td><apex:inputField value="{!QAC.Description}"  style=" height: 40px"/></td>
                     </tr>                
            </apex:repeat>
</apex:repeat>
Apex:
public List<AccountDataModel> AccountGroup;

//main code to sort Accounts into different groups and create the different inputs of AccountGroup
//
//

public with Sharing Class AccountDataModel{
        public String Title;
        public Integer Size;
        public String Notes;
        Public List<Account> Accounts;
        public QADataModel(String title, Integer sze, String note,List<Accounts> Acc){
            this.Title = title;
            this.Size = sze;
            this.Notes = note;
            this.Accounts = acc;
        }
        
    }


 
Is It possible to only have an Apex method called only when the tab it is under is selected? The code is displaying a query under each tab and I am trying to avoid a Apex CPU Limit reached.
hello everyone,
We have a Lightning Web Component with 3 Comboboxes. I built out the first one using the code from the Lighting Web Component resource page and it works great. I then copied and pasted the code (while changing the value names and labels as to not cause an error)  but the two new Combo Boxes arent working. when selecting a value the ComboBox returns a null value rather than the initial ' ' value and doesnt select the value I wanted to select. 
Ive created a Apex class that creates a record when a document is downloaded to have record that someone downloaded it, here is the code:
public class *method* implements Sfc.ContentDownloadHandlerFactory {

    public Sfc.ContentDownloadHandler getContentDownloadHandler(List<ID> ids, Sfc.ContentDownloadContext context) {
    	Sfc.ContentDownloadHandler contentDownloadHandler = new Sfc.ContentDownloadHandler();
        customObject__c um = new customObject__c();
  		um.User_Name__c = UserInfo.getName();
  		um.Access_Date__c = datetime.now();
  		um.Record_ID__c = ids.get(0);
    	        um.Type__c = 'File Download';
  		insert um;
        contentDownloadHandler.isDownloadAllowed = true;
        return contentDownloadHandler;
    }
}

how would I write a Test Class to simulate a User Downloading a File?
Hello everyone,
Not sure if this is the right place for this but I am working on installing Salesforce CLI and finally got it to work, only problem is I have to drill down from my C:\User\*name*> all the way down to where the Files are in C:\Program Files. when i see all the tutorials online, people seem to be able to open it immediately while in their user directory in command prompt. Is there a way to set it so I can do this as well?
I can't get a test class to work for a Trigger that is only looking for when a Case Comment is Updated.

trigger validation on CaseComment (before update) {  
    if(Trigger.isUpdate){
        for(CaseComment caseCmt : Trigger.new){
            if(caseCmt.CreatedById != System.UserInfo.getUserId()){
                caseCmt.addError('You can not edit Someone else\'s Comment');
            }
        }
    }
}

Any Help/Advice would be appreciated:)
hello, i am printing a Table into a Excel spread-sheet and need the text to wrap in the <Cell> tags? Below is the Style im using so far

<Style ss:ID="s1">
                   <Alignment/>
                        <Borders>
                        <Border ss:Position="Bottom" ss:LineStyle="Double" ss:Weight="3"/>
                        <Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="1"/>
                    </Borders>
                       <Font ss:Bold="1"/>
                       <Interior ss:Pattern='Solid' ss:Color="#2f9f38" ss:white-Space="normal"/>
                    <NumberFormat/>
                    <Protection/> 
                 </Style>
I am building an Apex project that will display a current Data Dictionary of our Org for Specific objects. I am also using this project to learn how to program in Apex and this is my first experience. I have build out a working model that gets the Api Name, label, and Datatype from the code below:
---------------------------------------------------------------------------------------------------------------
public static List<DataPoint> getAccountList(){
        List<DataPoint> myList = new List<DataPoint>();
        List<FieldDefinition> Query1 = new List<FieldDefinition>([Select DeveloperName, Label, Datatype From FieldDefinition where EntityDefinition.QualifiedApiName = 'Account' ORDER BY DeveloperName limit 1000]);
        For(Integer i = 0; i < Query1.Size(); i++){
            Try{
                String Q1 = String.valueOf(Query1[i]);
                DataPoint dp = new DataPoint(Q1.substringBetween('DeveloperName=',', Label='),
                                             Q1.substringBetween('Label=',', DataType='),
                                             Q1.substringBetween('DataType=',', EntityDefinitionId='),
                                             '', '', '');  //just a stand in 
               //Query to get Inhelptext, Description, and Created Date 
               //Add Inhelptext, Description, and Created Date to dp where the DeveloperName matches 
                myList.add(dp); 
            }Catch(System.NullPointerException e){
                 myList.add(new DataPoint('','','','','',''));
            }
        }
        Return myList;
    }
---------------------------------------------------------------------------------------------------------------
**DataPoint is just a custom class I built to hold the values and display them on the VisualForce Page. 
Now I would like to query InhelpText, Description, and maybe Created Date from CustomFields but I run into errors like [invalid: Customfield] because CustomField needs the Tooling API to be able to query into this.
So for my Question, How can I get the Description, InlineHelpText, to be able to put into these lists and complete the Data Dictionary? Is there a Work around to allow Tooling API or should I be taking a different approach? What can I add to my code above to make it work?
 

I am working on creating a Automated Data Dictionary using Conga Composer. I am looking to Get the Label, API name, DataType, and Description.Right now I am Able to run this query into the FieldDefinition:

Select DeveloperName, Label, Datatype 
From FieldDefinition where EntityDefinition.QualifiedApiName = 'Plan__c' 
ORDER BY DeveloperName


But when i run this Query into CustomField i get an Error:
Select DeveloperName, Label, Datatype 
From FieldDefinition where EntityDefinition.QualifiedApiName = 'Plan__c' 
ORDER BY DeveloperName


Error:
ERROR at Row:1:Column:53
sObject type 'CustomField' is not supported. If you are attempting to use a custom object, be sure to append the '__c' after the entity name. Please reference your WSDL or the describe call for the appropriate names.



I am able to run both Queries in Dev Console but how can I Run both in Conga to get the Information I want. or is there even a better way?

Hello,
I am trying to learn about SFDX and have installed Visual Studio Code + Salesforce Extensions.
I skiped the step that says "Make sure you have the latest version of the Salesforce CLI installed, and that your system meets the necessary requirements." because, before installing VS Code + the SF Extensions, I reviewed the list of extensions includeded in SF Extensions and saw that it included CLI.
It was a confusion moment and... I think I also read out there that it was better to installed CLI as part of SF Extension (which includes a set of extensions).

Eventually, because I was not able to create new Project from VS Code (Ctrl+Shift+P), I decided to revisite the steps to set up SF DX with VS Code, and decided to intall SF CLI by downloading a file (win64) from here (https://developer.salesforce.com/tools/sfdxcli ) and execute installation of that file.

Right now, my laptop has the following installed:
- Visual Studio Code + Salesforce Extensions (look at screenshot below)
- Salesforce CLI (win64) dowloaded from the above link

User-added image

How can I verify if Salesforce CLI works fine? I have tried executing cmd.exe the following command: sfdx --version
... but I am getting this error message:
User-added image

Do you think that the fact that I installed SF CLI after installing VS Code is the reason for the above command line not being recognized?

How can I make sure that I have all the SFDX tools correctly installed?

Thank you very much.

 
  • December 09, 2018
  • Like
  • 0
When Changing the Case Owner and Selecting "Send Notification Email", the email isnt being sent, When checking the Email Log, It looks like the email is there. Email Deliverability is set to "All Emails". Whats wrong and how can I start recieving these Emails?
User-added image