• Rick Rossi
  • NEWBIE
  • 10 Points
  • Member since 2021

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 17
    Questions
  • 7
    Replies
Hello, I am getting the following error message on a helper on a component: "Action failed: c:NotesObject$controller$doInit [helper.doInitHelper is not a function]"

Below is the doInit:

({
    doInit : function(component, event, helper) {
        helper.doInitHelper(component, event, helper);
    },
    
    openCreateModal : function(component, event, helper) {
        helper.openCreateModalHelper(component, event, helper);
    },
    
    closeModal : function(component, event, helper) {
        component.set("v.openNewModal", false);
    },
    
    createNote : function(component, event, helper) {
        helper.createNoteHelper(component, event, helper);
    },
    
    markComplete : function(component, event, helper) {
        helper.markCompleteHelper(component, event, helper);
    },
})
Hi!

I am running into issues on a hyperlink formula field that will provide a link to the related task.

I have a custom object and field that should store a link to the task but I am running into errors in my formula.

Can this be done?

HYPERLINK("https://XXXXXXXXX.lightning.force.com/lightning/r/Task/"&ID&"/view", Task_Link__)c)
Hi! 

I am trying to do a workflow field update VIA formula. The premise is when the task "status" field is changed I want to track the date and time of when it was changed and what user changed it. I am running into issues getting the user part into the formula and the error messages when trying to save my formula:

Error Message: Error: Field Status is a picklist field. Picklist fields are only supported in certain

Formula:

Date_Time_Status_Change__c  &
IF(NOT ISBLANK(Date_Time_Status_Change__c ), BR(), '') & 
TEXT(NOW()) + ' - ' +  Status

Any input would be great thank you!
I am running into issues on my trigger that is failing: It is supposed to prevent task creation related to an "inactive" contact and any time a user tries to create a task for an "inactive" contact. Any help would be great, this is what I have so far.

trigger TaskTrigger  on Task (before insert, before update) {

set<id>Ctids=new set<id>();

for(task t:trigger.new){
    Ctids.add(t.whatid);
}
if(!ctids.isempty()){
    List<Contact>lstacc=[select id,Status__c from contact where id in:ctids AND Status__c =:'Active'];
    Map<id,String>mapofcts=new Map<id,string>();
    for(Contact record: contacts) {
        mapofaccts.put(ct.id,Ct.Status__c);
    }
    for(task t:trigger.new){
        if(mapofaccts.containsKey(t.whatid)){
            t.addError ('Cannot Create a task For An In-Active Contact');
        }
    }
}

}
Hello!

I am looking to do a trigger on the task that would send values to a custom object (Comments History). The custom object should inherit the following fields from the task: Comments, Subject, Name,  Created by, Related to.

Any help with a trigger would be great.

Thanx!
Hello, 

I am trying to come up with a trigger but no luck. The logic is on the account object which parent accounts cannot have parent accounts and child accounts cannot have child accounts.

Any help would be great!

Thank you
Hello,

I am getting the same error on my custom lightning component, which is a custom component for account hierarchy. Any help would be great:

Message:Action failed: c:AccountHierarchy$controller$init [helper.checkForParent is not a function]

This is where the error occurs in my helper:

{
    checkForParent : function(component, event, helper) {
        var action = component.get("c.hasParent");
        var acctId = component.get('v.recordId');
        action.setParams({"accountId": acctId});

        action.setCallback(this, function(response) {
            var state = response.getState();
            if (state === "SUCCESS") {
                var result = response.getReturnValue();
                component.set("v.hasParent", result);
            }
        });
        $A.enqueueAction(action);
    },

    checkForChildren : function(component, event, helper) {
        var action = component.get("c.numChildren");
        var acctId = component.get('v.recordId');
        action.setParams({"accountId": acctId});

        action.setCallback(this, function(response) {
            var state = response.getState();
            if (state === "SUCCESS") {
                var result = response.getReturnValue();
                component.set("v.numChildren", result);
                if(result == 1) {
                    component.set("v.childOrChildren", "child");
                } else {
                    component.set("v.childOrChildren", "children");
                }
            }
        });
        $A.enqueueAction(action);
    }
})

Hello!
 
I need a validation that should not be on the creation of a lead but only on the edit on the lead. If my text field (reason why) is populated, then picklist A and Picklist B cannot be blank.
 
Any help would be great!
 
Thanx!
Hello,

Is it possible to have a contact trigger in which it clears a formula value if another field stores the same value? the logic is if the phone number is the same as the custom formula field phone number then the custom formula field will clear its value and turns blank.

Thnx!
Hello!

I am trying to do a mass update of all account emails to "testing.com"
however I am getting an error message saying my variable does not exist. This is my class.

global class BatchUpdateAccountField implements Database.Batchable <SObject>{
global Database.QueryLocator start (Database.BatchableContext bc)
{
    return Database.getQueryLocator('SELECT name from Account');
}
   global void execute(Database.BatchableContext bc, List<Account> acList)
   {
       for(Account ac :acList)
       {
          ac.email = ac.email + ' Testing.com';
           
       }
       
       update acList;
   }
    
    global void finish(Database.BatchableContext bc)
    {
        System.debug('>>>Finish');
    }
    
}


Any help would be great!
Hi all!

What would a trigger be to clear a value in a formula field if a new value in a different field is populated? I have two email fields "New email"  and "Temp email" once the new email field is populated than the "Temp Email" field should be blank.

Any help would be great!
Hi!

What would a batch class look like if I want to update any email field on the account, object, and lead to "In Development". I am having issues inserting the objects in an apex class, any help would be great.

Thanks!
Apex Class Question: How would I send an email to a public group once a duplicate lead is converted into a duplicate account and contact? I keep recieving error messages on mine, any help would be great.

Thanks!
Hi!

I am trying to update all case subject values to "Case Subject"

How would this look like if I want to do this in a batch class? I am running into errors.

Thank you!
I am trying to mask the case object (case subject) to a value of "N/A"how woudl that look in an apex class?

Thanks!
Hello,

I currently cannot use the out of the box duplicate/matcing rules for the contact object due to the amount of duplicates. How would a trigger look like to allow duplicates but notifity the users that a duplicates exist? The criteria is exact Account ID, email, and fuzzy first and last name.

Thanx!
I get the following message for my public class however I cant seem to find where the error is.


Error: Unknown property 'String.name'

<apex:page controller="importDataFromCSVController">
    <apex:form >
        <apex:pagemessages />
        <apex:pageBlock >
            <apex:pageBlockSection columns="4"> 
                  <apex:inputFile value="{!csvFileBody}"  filename="{!csvAsString}"/>
                  <apex:commandButton value="Import Account" action="{!importCSVFile}"/>
            </apex:pageBlockSection>
        </apex:pageBlock>
        <apex:pageBlock >
           <apex:pageblocktable value="{!accList}" var="acc">
              <apex:column value="{!acc.name}" />
              <apex:column value="{!acc.AccountNumber}" />
              <apex:column value="{!acc.Type}" />
              <apex:column value="{!acc.Accountsource}" />
              <apex:column value="{!acc.Industry }" />
        </apex:pageblocktable>
     </apex:pageBlock>
   </apex:form>
</apex:page>
I am running into issues on my trigger that is failing: It is supposed to prevent task creation related to an "inactive" contact and any time a user tries to create a task for an "inactive" contact. Any help would be great, this is what I have so far.

trigger TaskTrigger  on Task (before insert, before update) {

set<id>Ctids=new set<id>();

for(task t:trigger.new){
    Ctids.add(t.whatid);
}
if(!ctids.isempty()){
    List<Contact>lstacc=[select id,Status__c from contact where id in:ctids AND Status__c =:'Active'];
    Map<id,String>mapofcts=new Map<id,string>();
    for(Contact record: contacts) {
        mapofaccts.put(ct.id,Ct.Status__c);
    }
    for(task t:trigger.new){
        if(mapofaccts.containsKey(t.whatid)){
            t.addError ('Cannot Create a task For An In-Active Contact');
        }
    }
}

}
Hello, 

I am trying to come up with a trigger but no luck. The logic is on the account object which parent accounts cannot have parent accounts and child accounts cannot have child accounts.

Any help would be great!

Thank you
Hello,

I am getting the same error on my custom lightning component, which is a custom component for account hierarchy. Any help would be great:

Message:Action failed: c:AccountHierarchy$controller$init [helper.checkForParent is not a function]

This is where the error occurs in my helper:

{
    checkForParent : function(component, event, helper) {
        var action = component.get("c.hasParent");
        var acctId = component.get('v.recordId');
        action.setParams({"accountId": acctId});

        action.setCallback(this, function(response) {
            var state = response.getState();
            if (state === "SUCCESS") {
                var result = response.getReturnValue();
                component.set("v.hasParent", result);
            }
        });
        $A.enqueueAction(action);
    },

    checkForChildren : function(component, event, helper) {
        var action = component.get("c.numChildren");
        var acctId = component.get('v.recordId');
        action.setParams({"accountId": acctId});

        action.setCallback(this, function(response) {
            var state = response.getState();
            if (state === "SUCCESS") {
                var result = response.getReturnValue();
                component.set("v.numChildren", result);
                if(result == 1) {
                    component.set("v.childOrChildren", "child");
                } else {
                    component.set("v.childOrChildren", "children");
                }
            }
        });
        $A.enqueueAction(action);
    }
})

Hello!
 
I need a validation that should not be on the creation of a lead but only on the edit on the lead. If my text field (reason why) is populated, then picklist A and Picklist B cannot be blank.
 
Any help would be great!
 
Thanx!
Hi!

I am trying to update all case subject values to "Case Subject"

How would this look like if I want to do this in a batch class? I am running into errors.

Thank you!
Hello,

I currently cannot use the out of the box duplicate/matcing rules for the contact object due to the amount of duplicates. How would a trigger look like to allow duplicates but notifity the users that a duplicates exist? The criteria is exact Account ID, email, and fuzzy first and last name.

Thanx!
I get the following message for my public class however I cant seem to find where the error is.


Error: Unknown property 'String.name'

<apex:page controller="importDataFromCSVController">
    <apex:form >
        <apex:pagemessages />
        <apex:pageBlock >
            <apex:pageBlockSection columns="4"> 
                  <apex:inputFile value="{!csvFileBody}"  filename="{!csvAsString}"/>
                  <apex:commandButton value="Import Account" action="{!importCSVFile}"/>
            </apex:pageBlockSection>
        </apex:pageBlock>
        <apex:pageBlock >
           <apex:pageblocktable value="{!accList}" var="acc">
              <apex:column value="{!acc.name}" />
              <apex:column value="{!acc.AccountNumber}" />
              <apex:column value="{!acc.Type}" />
              <apex:column value="{!acc.Accountsource}" />
              <apex:column value="{!acc.Industry }" />
        </apex:pageblocktable>
     </apex:pageBlock>
   </apex:form>
</apex:page>