• Kris Ryan SA
  • NEWBIE
  • 0 Points
  • Member since 2018

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 4
    Questions
  • 5
    Replies
Hi,
I am trying to create a trigger that creates an associated record when a record is created in a custom object called Project__c. I am not much of a coder, but thought I would give this a whirl.

I get all sorts of errors when it triggers.

Can someone please review and let me now what needs to be changed? I would greatly appreciate it!!

Here is the scenario.
The user creates a Project Charter. When that charter is approved, we create a Project and tie them together. There are 12 action steps on the Charter. The business unit wanted us to create Project Tasks associated to the new project from the 12 action steps on the Charter. My trigger, for now, is only working with the first action step.

Code:
trigger ProjectTasksFromActionSteps on TASKRAY__Project__c (after insert,after update) {
    
    Set<Id> pcIds = new Set<Id>();
    
    for (TASKRAY__Project__c recProj : Trigger.new){
        if(recProj.Created_from_Project_Charter__c != null) {
            pcIds.add(recProj.Created_from_Project_Charter__c);
        }
    }
    
    if(pcIds.size() > 0){
        
        Map<Id,Project_Charter__c> pcEntries = new Map<Id,Project_Charter__c>(
            [select Date__c,
             Project_Title__c,
             Action_Step_1_Title__c,
             Action_Step_1_by_When__c,
             Action_Step_1_Description__c
             from Project_Charter__c
             where id in :pcIds]
        );
        
        List<TASKRAY__Project_Task__c> newTasks = new List <TASKRAY__Project_Task__c>();
        
        for(TASKRAY__Project__c recProg : trigger.new){
            
            Project_Charter__c recPC = pcEntries.get(recProg.Created_from_Project_Charter__c);
            
            if (recPC.Action_Step_1_Title__c != null) {
                
                TASKRAY__Project_Task__c recTask = new TASKRAY__Project_Task__c(
                    OwnerId=recProg.OwnerId,
                    TASKRAY__Project__c=recProg.Id,
                    Name=recPC.Action_Step_1_Title__c,
                    TASKRAY__trStartDate__c=recPC.Date__c,
                    TASKRAY__List__c='Planned',
                    Task_Classification__c='Project'
                );
                
                newTasks.add(recTask);
            }
        }
        if(newTasks.size()>0){
        insert newTasks;
        }
    }
}
I would like to create Tasks from fields in a record. We have a custom object titled Project Charter. The Charter can have up to 12 Action Steps, which are comprised of Title, When, By Whom, and Description. When the Charter is approved, we automatically create a Project and tie them together via a lookup field. We would like to take the 12 Action Steps and automatically create Project Tasks and assign them to the Project that was just created. Can I create a collection variable in flow that will contain the four fields for all 12, making it like an array? I want to then loop through this collection variable and create the Project Tasks.

I will call this flow from Process Builder when a Project is created, sending the Project ID and the Project Charter ID.

I have not used Flow that much, so I'm not sure if this can be done, and if so, how.
Hi,
I am trying to connect to Salesforce via MS Access. When I try to login, I get an error message 'ODBC--connection to '{{Salesforce}}' failed'. When I look at my login history in Salesforce, it says 'Partner Product, Invalid Password, SimbaTechnologies/ODBCDriver/'. However, I can login from another application with exactly the same credentials and I get connected.

It is not the ODBC driver, as other people can connect from MS Access to Salesforce on my laptop.

What am I missing?

Thanks!
Kris
Hi,
We have an apex class that is defaulting information for a Visualforce page to send an email.
I have changed the class to pull the email signature from the user file. This is copying a rich text area field into another rich text area field.
This seems to work, shockingly, since I am not a coder. BUT there seems to be additional spacing on the visualforce page input.
Would someone be able to tell me how to fix this?

Apex Class code:
public PCharter(ApexPages.StandardController stdController) {
    this.ProjectCharter = (Project_Charter__c)stdController.getRecord();
    this.getProjectCharter();
    User u = [Select Id, Name, Email_Signature__c from User where Id =: UserInfo.getUserId()];
    this.ProjectCharter.Email_Message__c = u.Email_Signature__c;

Visualforce Page:
<p>Message:  <br /><apex:inputTextarea richtext="true" value="{!ProjectCharter.Email_Message__c}" rows="20"/></p>

Here is my email signature:
Email Signature from User record
This is what the field ends up looking like:
Email Message
See the additional line spacing? How can I make it look exactly like the email signature?

Thanks!!!
Hi,
I am trying to connect to Salesforce via MS Access. When I try to login, I get an error message 'ODBC--connection to '{{Salesforce}}' failed'. When I look at my login history in Salesforce, it says 'Partner Product, Invalid Password, SimbaTechnologies/ODBCDriver/'. However, I can login from another application with exactly the same credentials and I get connected.

It is not the ODBC driver, as other people can connect from MS Access to Salesforce on my laptop.

What am I missing?

Thanks!
Kris
Hi,
I am trying to create a trigger that creates an associated record when a record is created in a custom object called Project__c. I am not much of a coder, but thought I would give this a whirl.

I get all sorts of errors when it triggers.

Can someone please review and let me now what needs to be changed? I would greatly appreciate it!!

Here is the scenario.
The user creates a Project Charter. When that charter is approved, we create a Project and tie them together. There are 12 action steps on the Charter. The business unit wanted us to create Project Tasks associated to the new project from the 12 action steps on the Charter. My trigger, for now, is only working with the first action step.

Code:
trigger ProjectTasksFromActionSteps on TASKRAY__Project__c (after insert,after update) {
    
    Set<Id> pcIds = new Set<Id>();
    
    for (TASKRAY__Project__c recProj : Trigger.new){
        if(recProj.Created_from_Project_Charter__c != null) {
            pcIds.add(recProj.Created_from_Project_Charter__c);
        }
    }
    
    if(pcIds.size() > 0){
        
        Map<Id,Project_Charter__c> pcEntries = new Map<Id,Project_Charter__c>(
            [select Date__c,
             Project_Title__c,
             Action_Step_1_Title__c,
             Action_Step_1_by_When__c,
             Action_Step_1_Description__c
             from Project_Charter__c
             where id in :pcIds]
        );
        
        List<TASKRAY__Project_Task__c> newTasks = new List <TASKRAY__Project_Task__c>();
        
        for(TASKRAY__Project__c recProg : trigger.new){
            
            Project_Charter__c recPC = pcEntries.get(recProg.Created_from_Project_Charter__c);
            
            if (recPC.Action_Step_1_Title__c != null) {
                
                TASKRAY__Project_Task__c recTask = new TASKRAY__Project_Task__c(
                    OwnerId=recProg.OwnerId,
                    TASKRAY__Project__c=recProg.Id,
                    Name=recPC.Action_Step_1_Title__c,
                    TASKRAY__trStartDate__c=recPC.Date__c,
                    TASKRAY__List__c='Planned',
                    Task_Classification__c='Project'
                );
                
                newTasks.add(recTask);
            }
        }
        if(newTasks.size()>0){
        insert newTasks;
        }
    }
}
Hi,
I am trying to connect to Salesforce via MS Access. When I try to login, I get an error message 'ODBC--connection to '{{Salesforce}}' failed'. When I look at my login history in Salesforce, it says 'Partner Product, Invalid Password, SimbaTechnologies/ODBCDriver/'. However, I can login from another application with exactly the same credentials and I get connected.

It is not the ODBC driver, as other people can connect from MS Access to Salesforce on my laptop.

What am I missing?

Thanks!
Kris
Hi,
We have an apex class that is defaulting information for a Visualforce page to send an email.
I have changed the class to pull the email signature from the user file. This is copying a rich text area field into another rich text area field.
This seems to work, shockingly, since I am not a coder. BUT there seems to be additional spacing on the visualforce page input.
Would someone be able to tell me how to fix this?

Apex Class code:
public PCharter(ApexPages.StandardController stdController) {
    this.ProjectCharter = (Project_Charter__c)stdController.getRecord();
    this.getProjectCharter();
    User u = [Select Id, Name, Email_Signature__c from User where Id =: UserInfo.getUserId()];
    this.ProjectCharter.Email_Message__c = u.Email_Signature__c;

Visualforce Page:
<p>Message:  <br /><apex:inputTextarea richtext="true" value="{!ProjectCharter.Email_Message__c}" rows="20"/></p>

Here is my email signature:
Email Signature from User record
This is what the field ends up looking like:
Email Message
See the additional line spacing? How can I make it look exactly like the email signature?

Thanks!!!