• Erin Rico-Allen 2
  • NEWBIE
  • 40 Points
  • Member since 2016

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 8
    Questions
  • 0
    Replies
So we have these two look-up(user) fields on the Account object:
  • Account_Manager__c
  • Enterprise_Solutions_Manager__c
On Account Teams, we have 2 team role picklist values that correspond to these fields (api names):
  • Account Manager
  • Enterprise Solution Manager
I need a before trigger that will update the account fields automatically based on the Account Team roles setup based on the owner of the account (so each owner has a pre-set account team).

I am not a developer and I don't really write code. Can someone help me out with this?

Thanks!
Erin
Hi,
We have met our max on roles created in our Salesforce org. I need to be able to pull all roles that currently aren't being used (no users are listed in them). Trying to write a SQL Query to plug into Workbench in order to get the role id, last modified date, name, etc. Can someone help me?

Thanks!
Getting this error when I try to add my Towermaps to a new app builder page:
User-added image

Here are the codes I have based on the trailhead exercise:

TowerMapUtilClass:
public inherited sharing class TowerMapUtilClass {
     public static List<sObject> queryObjects(String theObject, List<String> theFields, String theFilter, String sortField, String sortOrder) {
          String theQuery = 'SELECT ' + string.join(theFields, ',');
          theQuery += ' FROM ' + theObject;
          if(!String.isEmpty(theFilter)) {
               theQuery += ' WHERE ' + theFilter;
          }
          if(!String.isEmpty(sortField)) {
               theQuery += ' ORDER BY ' + sortField;
               if(!String.isEmpty(sortOrder)) {
                    theQuery += ' ' + sortOrder;
               }
          }
          return database.query(theQuery);
     }


TowerMapControllerClass:
public inherited sharing class TowerMapControllerClass {
     @AuraEnabled
     public static List<Tower__c> getAllTowers() {
          String theObject = 'Tower__c';
          List<String> theFields = new List<String>{'Id', 'Name', 'State__r.Name', 'Tower_Location__Latitude__s', 'Tower_Location__Longitude__s'};
          String theFilter = '';
          String sortField = 'Name';
          String sortOrder = 'ASC';
          List<Tower__c> allTowers = TowerMapUtilClass.queryObjects(theObject, theFields, theFilter, sortField, sortOrder);
          return allTowers;
     }
Towermap:
<aura:component implements="flexipage:availableForAllPageTypes" controller="TowerMapControllerClass" access="global" >
     <aura:attribute name="mapMarkers" type="Object" access="PRIVATE" />
     <aura:attribute name="markersTitle" type="String" access="PRIVATE" />
     <aura:handler name="init" value="{!this}" action="{!c.handleInit}"/>
     <aura:if isTrue="{!!empty(v.mapMarkers)}" >
          <lightning:map mapMarkers="{!v.mapMarkers}" markersTitle="{!v.markersTitle}" zoomLevel="5"/>
 
     </aura:if>
</aura:component>

Towermap Controller:
({
     handleInit: function (component, event, helper) {
          helper.initHelper(component, event, helper);
     }
})
Towermap Helper:
({
     initHelper : function(component, event, helper) {
          helper.utilSetMarkers(component, event, helper);
     },
     utilSetMarkers : function(component, event, helper) {
          let action = component.get("c.getAllTowers");
          action.setCallback(this, function(response) {
               const data = response.getReturnValue();
               const dataSize = data.length;
               let markers = [];
               for(let i=0; i < dataSize; i += 1) {
                    const Tower = data[i];
                    markers.push({
                        'location': {
                             'Latitude' : Tower.Tower_Location__Latitude__s,
                             'Longitude' : Tower.Tower_Location__Longitude__s
                        },
                        'icon': 'utility:Tower',
                        'title' : Tower.Name,
                        'description' : Tower.Name + ' Tower Location at ' + Tower.State__r.Name
                   });
               }
               component.set('v.markersTitle', 'Out and About Communications Tower Locations');
               component.set('v.mapMarkers', markers);
          });
          $A.enqueueAction(action);
     }
})

I also created the cutom object Tower.

Anyone know where my break is?

Thanks!

Erin
Need help with a formula
I need to add a new component to the formula below for a Process Builder step:

DATE(
YEAR([Opportunity].CloseDate)+FLOOR((MONTH([Opportunity].CloseDate) + IF( TEXT([Opportunity].Pre_Paid_Contract__c)="Month to month" || TEXT([Opportunity].Pre_Paid_Contract__c)="One Time Payment", 1, VALUE(TRIM(LEFT(TEXT([Opportunity].Pre_Paid_Contract__c),2))) ))/12) + IF(AND(MONTH([Opportunity].CloseDate)=12,IF( TEXT([Opportunity].Pre_Paid_Contract__c)="Month to month" || TEXT([Opportunity].Pre_Paid_Contract__c)="One Time Payment", 1, VALUE(TRIM(LEFT(TEXT([Opportunity].Pre_Paid_Contract__c),2))) )>=12),-1,0)
,
IF( MOD( MONTH([Opportunity].CloseDate) + IF( TEXT([Opportunity].Pre_Paid_Contract__c)="Month to month" || TEXT([Opportunity].Pre_Paid_Contract__c)="One Time Payment", 1, VALUE(TRIM(LEFT(TEXT([Opportunity].Pre_Paid_Contract__c),2))) ) , 12 ) = 0, 12 , MOD( MONTH([Opportunity].CloseDate) + IF( TEXT([Opportunity].Pre_Paid_Contract__c)="Month to month" || TEXT([Opportunity].Pre_Paid_Contract__c)="One Time Payment", 1, VALUE(TRIM(LEFT(TEXT([Opportunity].Pre_Paid_Contract__c),2))) ) , 12 ))
,
MIN(
DAY([Opportunity].CloseDate),
CASE(
MAX( MOD( MONTH([Opportunity].CloseDate) + IF( TEXT([Opportunity].Pre_Paid_Contract__c)="Month to month" || TEXT([Opportunity].Pre_Paid_Contract__c)="One Time Payment", 1, VALUE(TRIM(LEFT(TEXT([Opportunity].Pre_Paid_Contract__c),2))) ) , 12 ) , 1),
9,30,
4,30,
6,30,
11,30,
2,28,
31
)
)
)

I need this formula to take into account that if the field "[Opportunity].Pre_Paid_Contract__c" is blank, than we want the date to default to what we have setup for the "One Time Payment" scenario. Unfortunately, if it's blank now, it errors out the process.

Been trying to replace all "TEXT([Opportunity].Pre_Paid_Contract__c)" with "BLANKVALUE(TEXT(Opportunity].Pre_Paid_Contract__c), "One Time Payment")" but keep getting syntax errors.

Can someone help me figure out how to make this addition in my complex code?

Thanks!

Erin
So I have been trying to pass the Generate & Analyze Logs Trailhead challenge. I keep getting this error: User-added image

But I have all that already in my "Executive Details" perspective: 

User-added image

Am I missing something else? Why can't I complete this challenge????

Thanks!

Erin
Attempting to do this trailhead exercise: https://trailhead.salesforce.com/modules/developer_console/units/developer_console_logs

I am unable to get my debug logs to open even with the checkbox checked. Plus nothing is showing up under the logs tab. I set the Apex Code log level to Finest as instructed but I still get nothing. All my popups are enabled for the site.

Thanks!

Erin
User-added image
I have created a visual flow that triggers when a new button "Resolve Case" is clicked. This then takes the user to another screen where only Resolve Case statuses can be selected. Once selected, the case is updated. My new question is, if a Case is in a Resolve status for more than 4 hrs, it needs to be updated to Closed so what is the best way to do this? Should I add to this flow and if so what would it look like?

Thanks!

Erin
I am new to visual flows and I have been reading all documentation on flows and everything but I am still having some issues manuveuring through the process. Here is what I want to do:

Have this process trigger every time the Resolve Button is hit on a Case:
- Button opens new window which only contains the Resolve Statuses I have
- Once Resolved Status is chosen and Saved, the Case Status field will update

I know the button is the last step since I need the flow url to link them but how do I go about the new window with the Resolve Statuses only? Also how do I setup the Record Update since there are 4 possible Resolve choices that can update the Case Status?

If anyone can please walk me through this, I'd truly appreciate it.

Thanks!