• Frances Allen
  • NEWBIE
  • 30 Points
  • Member since 2017

  • Chatter
    Feed
  • 0
    Best Answers
  • 2
    Likes Received
  • 0
    Likes Given
  • 23
    Questions
  • 17
    Replies
A user at our organization can edit reports in classic but cannot edit reports when they switch to LEX.

When they try to edit a report they get this error code: We're reporting this as error ID: -122014115. 

I've searched but not found any information on this particular code. If they have permission to edit in Classic, I assume they're fine to edit in LEX. Any links or information would be appreciated
I don't understand what else I need to add. 

This is my class and I'm testing this correctly. 
public with sharing class Volunteer implements Comparable {

    public Boolean isSelected { get; set; }
    public Boolean isActive { get; set; }
    public Boolean isAvailable { get; set; }
    public Decimal totalAvailability { get; set; }
    public Contact con { get; private set; }
    public List<Availability> availabilities { get; private set; }
    public List<Cohort_Assignment__c> existingAssignments { get; private set; }
    public Cohort_Assignment__c currentAssignment;
    private Cohort__c cohort;

    public Volunteer(Contact con, Cohort__c cohort) {
        this.con = con;
        this.isSelected = false;
        this.isActive = false;
        this.isAvailable = true;
        this.cohort = cohort;
        this.availabilities = new List<Availability>();
        this.existingAssignments = new List<Cohort_Assignment__c>();
        this.totalAvailability = 0;
    }

    public void addAvailability(Volunteer_Availability__c volunteerAvailability) {
        Availability newAvailability = new Availability(volunteerAvailability);
        this.availabilities.add(newAvailability);
        totalAvailability += newAvailability.hours;
    }

    public void addExistingAssignment(Cohort_Assignment__c assignment) {
        if(assignment.Cohort__c == this.cohort.Id) {
            this.currentAssignment = assignment;
            this.isSelected = true;
            if(assignment.Active__c) {
                this.isActive = true;
            }
        } 
    }

    public Integer getNumberOfAssignments() {
        return this.existingAssignments.size();
    }

    public class Availability {

        public Decimal hours { get; private set; }
        public String day { get; private set; }
        public String startTime { get; private set; }
        public String endTime { get; private set; }
        public Boolean allDay { get; private set; }

        public Availability(Volunteer_Availability__c volunteerAvailability) {
            day = volunteerAvailability.Day__c;
            startTime = volunteerAvailability.Start_Time__c;
            endTime = volunteerAvailability.End_Time__c;
            allDay = volunteerAvailability.All_Day__c;

            hours = allDay ? 10 : volunteerAvailability.End_Time_Hour__c - volunteerAvailability.Start_Time_Hour__c;
        }
    }

    public Integer compareTo(Object compareTo) {

        Volunteer compareToVolunteer = (Volunteer)compareTo;

        // compare Active
        if(isActive && !compareToVolunteer.isActive) return -1;
        if(!isActive && compareToVolunteer.isActive) return 1;

        // compare existing assignments
        if(existingAssignments.size() < compareToVolunteer.existingAssignments.size()) return -1;
        if(existingAssignments.size() > compareToVolunteer.existingAssignments.size()) return 1;

        // compare Colleges
        if(con.AccountId == cohort.College__c && compareToVolunteer.con.AccountId != cohort.College__c) return -1;
        if(con.AccountId != cohort.College__c && compareToVolunteer.con.AccountId == cohort.College__c) return 1;
        if(con.Account.Name > compareToVolunteer.con.Account.Name) return -1;
        if(con.Account.Name < compareToVolunteer.con.Account.Name) return 1;

        // compare availability
        if(totalAvailability > compareToVolunteer.totalAvailability) return 1;
        if(totalAvailability < compareToVolunteer.totalAvailability) return -1;

        return 0;
    }

}
This is the test class: 
@isTest

public class VolunteerTest {

    
   //create a cohort with Tuesday default 
    static testMethod void testVolunteerSorting() {
        
        
        Cohort__c cohort = new Cohort__c(
                Default_Day__c = 'Tuesday'
        );

        Contact con1 = TestDataFactory.getContact();
        Contact con2 = TestDataFactory.getContact();

        Cohort_Assignment__c assignment = new Cohort_Assignment__c(
                Active__c = true
        );

        Volunteer_Availability__c availability = new Volunteer_Availability__c(
                Day__c = 'Tuesday',
                Start_Time__c = '8:00 AM',
                End_Time__c = '9:00 AM'
        );
        
        availability.recalculateFormulas();

        Volunteer_Availability__c availabilityAllDay = new Volunteer_Availability__c(
                Day__c = 'Tuesday',
                All_Day__c = true
        );
        
        availabilityAllday.recalculateFormulas();

        Volunteer v1 = new Volunteer(con1, cohort);
        v1.addAvailability(availability);
        v1.addExistingAssignment(assignment);

        Volunteer v2 = new Volunteer(con1, cohort);
        v2.addAvailability(availabilityAllDay);
        v2.addExistingAssignment(assignment);
        
         Cohort_Assignment__c secondassignment = new Cohort_Assignment__c(
                Active__c = false 
             );
        
                Volunteer_Availability__c falseavailability = new Volunteer_Availability__c(
                Day__c = 'Tuesday',
                Start_Time__c = '8:00 AM',
                End_Time__c = '9:00 AM'
        );
        falseavailability.recalculateFormulas();

        Volunteer_Availability__c newavailabilityAllDay = new Volunteer_Availability__c(
                Day__c = 'Tuesday',
                All_Day__c = true
        );
        
        newavailabilityAllday.recalculateFormulas();

        Volunteer v3 = new Volunteer(con2, cohort);
        v3.addAvailability(falseavailability);
        v3.addExistingAssignment(secondassignment);

        Volunteer v4 = new Volunteer(con2, cohort);
        v4.addAvailability(availabilityAllDay);
        v4.addExistingAssignment(secondassignment);
        
        // new tests now 
        Cohort_Assignment__c thirdassignment = new Cohort_Assignment__c(
                Active__c = true 
             );
        
                Volunteer_Availability__c alldayavailability = new Volunteer_Availability__c(
                Day__c = 'Monday',
                All_day__c = true
        );
        
        alldayavailability.recalculateFormulas();

        Volunteer_Availability__c secondallday = new Volunteer_Availability__c(
                Day__c = 'Wednesday',
                All_Day__c = true
        );
        
        secondallday.recalculateFormulas();

        
        Volunteer v5 = new Volunteer(con2, cohort);
        v5.addAvailability(alldayavailability);
        v5.addExistingAssignment(thirdassignment);

        Volunteer v6 = new Volunteer(con2, cohort);
        v6.addAvailability(secondallday);
        v6.addExistingAssignment(thirdassignment);
        
        Test.startTest();
           testvolunteersorting();
        Test.stopTest();
        
        System.debug (v2.availabilities);
        System.assert(v2.isActive, true );
        System.assert(v2.isAvailable, true);
    }   
    
 }

 
Here's my error: 

No such column 'lastvieweddate' on entity 'Contact'. If you are attempting to use a custom field, be sure to append the '__c' after the custom field name.
  • I am not aware of this field on Contact in sandbox or production 
  • It is only present in metadata 
  • It is not used in Non-profit success pack field sets 
Very little is known about this error outside of these above points. It's not feasible to change my API to 27 or below as suggested by some. 
Does anyone know what is triggering this error? This is where the actual error is being triggered. In the bolded code below.
 
@isTest
private class ContactSearchController_Test {
	
    static testMethod void testClass() {
        Topic__c t = new Topic__c(Name='Test Topic', Active__c=true, Abbreviation__c='tt');
        insert t;
        City__c ci = new City__c(Name='Test City');
        insert ci;
        
        Account a = TestDataFactory.getCollege();
        a.City__c = ci.Id;
        insert a;

        Contact c = new Contact(lastName='lName', firstName='fName', Position__c='Test Postition', AccountId=a.Id, Topic_1__c=t.Id, MobilePhone='(703) 555-5555', Email='Test@acfsolutions.com');
        Contact c2 = new Contact(lastName='lName2', firstName='fName2', Position__c='Test Postition', AccountId=a.Id, Topic_1__c=t.Id, MobilePhone='(703) 556-5556', Email='Test2@acfsolutions.com');
        insert new List<Contact>{c, c2};

        User u = TestDataFactory.getUser(TestDataFactory.getLeadershipCouncilProfile(), c);

        System.runAs(u) {
            ContactSearchController.getSearchDetails();
            
            ContactSearchController.getContactDetail(c.Id);
        }
    }
}


 
I have a report with a unique custom field (picklist) that is pulling a blank value when it should pull a 'yes'. I've tried doing data loader, but this thing keeps showing the bad value. It is not a multi-select picklist! 
I'm having an issue with an approval process that has atypical routing needs. Can someone tell me if this is possible? 

Submitter submites to first approver. 
When first approver rejects it is sent back to submitter 
When the submitter resubmits the opportunity then goes to approver 2 (not approver 1) 
Then the opportunity is sent to approver 1 upon approval. 

No matter what I do, my opportunities keep submitting to the first approver. I've tried designing a second approval process for approver 2 using a hidden field to delineate it from the approval process that is connected to approver 1. 

Should I use Process Builder or should I just stick to the approval process. I cannot deploy any classes, so code solutions won't work.
I'd like to preface this post saying that I do not have access to create triggers in my Org currently. I'm automating this process entirely through Process Builder. 

The problem: 
I've created a process that checks a box on contact records after a record for another object is created. I'll refer to this object as 'availability'.  After a record for availbility is created, the checkbox located on a contact record is checked. It's that simple. However, I want to validate when there are no more availability records ( no availability records exist ) and uncheck that box when someone has erased their last availability record. 

The question:
What formula could I use to check if the boolean on contacts is checked, validate that there are no more availability records, and then uncheck the box? 

Any solutions or ideas would be appreciated.
Besides using the documentation located here: 
https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_objects_visualforceaccessmetrics.htm

What are other ways to query how many visualforce pages exist in your org? I feel like there is an easier way to do this, like looking under 
pages in setup? What special advantage does querying give you? 



 
I want to preface that I am using the newest version of files for Salesforce Lightning, not classic Notes and Attachments.

We want to ensure that at least one file is uploaded to an opportunity in notes and attachments ( we have enabled files so the upload is of Salesforce files ). 

I cannot see how validation is possible from the opportunity itself. Is anyone doing this without using Process Builder or a Trigger? 

Thanks in Advance.
Hello All, 

I believe that this formula is incorrect in that we cannot use an if statement this way. If there are any pros on the board that quickly double-check my knowledge.
The purpose of this field is to determine current school year according to fiscal year which is after July. 

IF (MONTH(TODAY())>=7, YEAR(TODAY())+1,
IF (MONTH(TODAY())<7, YEAR(TODAY()),0))
IF (MONTH(TODAY())>=7, YEAR(TODAY())+1,
IF (MONTH(TODAY())<7, YEAR(TODAY()),0))

If today’s month is greater or equal to July add one more year to the year otherwise if false  
And today’s month is is less July, todays year, otherwise 0
 
Wouldn’t it be just YEAR(TODAY()) with no comma and zero following?



 
I want to edit our stage forecasing so that the committed date will not show up as the closed date. I have changed the category from closed to open, but I the system seems to get buggy and then changes it back after that. Has anyone tried to customize their stages and experienced this error before? 

 
For instance, if I log into a Salesforce community and I'm a 'cat' record type, would I then have the option to create a 'dog' record type if I'm not assigned this record type? How can you restrict their access to creating a 'dog' record type? Basically, I need to confirm that a specific user with a certain record type cannot create a record that is not their record type.
I know that this error is referring my user update in line 14, but appears to be a mistake that is actually masking another mistake as I've already identified the user id with contact id in my code.

My full error upon deployment is :  
System.DmlException: Update failed. First exception on row 0; first error: MISSING_ARGUMENT, Id not specified in an update call: []
Stack Trace: Class.IncompleteWorkshopLogsTest.testOnlyIncompleteWorkshopsReturned: line 14, column 1

Line 14  is 
update u;
The controller is here: 
@isTest
public class IncompleteWorkshopLogsTest {

   @isTest
   private static void testOnlyIncompleteWorkshopsReturned() {
       
       //create contact
       Contact c = new Contact(FirstName='Test', LastName = 'Test');
       insert c;
       
       User u = new User();
       u.ContactId = c.Id;
       
       update u; 
       
       //tie teaching to a volunteer and contact id 
       Workshop_Signup__c incompleteLog = new Workshop_Signup__c(
           Volunteer__c = c.Id    
       );
       
       insert incompleteLog;

       Workshop_Signup__c completeLog = new Workshop_Signup__c(
           Volunteer__c = c.Id
       );
       
       insert completeLog;

       //create and insert a workshop log that would indicate one finished vs. unfinished
       Workshop_log__c unfinished = new Workshop_log__c(RCM_A9__c = '');
       Workshop_log__c finished = new Workshop_log__c(RCM_A9__c = 'Complete');
       
       // tie workshop log to teaching record 
       incompleteLog.Id = unfinished.Id;
       completeLog.Id = finished.Id;
       insert  unfinished;
       insert  finished;
       
       insert new List<Workshop_Signup__c> { completeLog, incompleteLog };
        

       Test.startTest();

       IncompleteWorkshopLogs controller = new IncompleteWorkshopLogs();

       List<Workshop_Signup__c> results = controller.getTeaching();
       
       update results;

       Test.stopTest();

       System.assertEquals(1, results.size());
       System.assertEquals('Complete', results[0].Workshop_Log_Status__c);
      
   }
}

Tests have been a major roadblock in getting things deployed here, so any assistance would be appreciated.

Thanks, 

Frances 

  
I want to show payment data on a visual force page. I cannot get this to work. I am thinking that I have correctly queried through a nested relationship statement and all is well, but this is not happening.  The visualforce page is here: 
   
<apex:page controller="TestRollUpData">
    <apex:form >
        <apex:pageBlock title="Tests" id="more_tests">
			<apex:pageBlockTable value="{! Opportunity }" var="o">
                <apex:column value="{! o.Name}"/>
                <apex:column value="{! o.Designated_Fiscal_Year__c}"/>
                <apex:column value="{! o.Amount}"/>
            </apex:pageBlockTable>
            <apex:pageBlockTable value="{! o.npe01__OppPayment__r }" var="x">
                <apex:column value="{! x.npe01__Payment_Date__c}"/>
            </apex:pageBlockTable>
            <apex:repeat value="{! Opportunity }" var="x">
              <script>
                  document.getElementById('totalRevenue').value =
                 parseFloat(document.getElementById('totalRevenue').value) + {! Opportunity.Amount};
              </script>
            </apex:repeat>
        </apex:pageBlock>
    </apex:form>
</apex:page>

and the controller is here:
 
public class TestRollUpData {
    

   
    public List<Opportunity> getOpportunity(){ 
    
         List<Opportunity> tests = [SELECT Name, Amount, Designated_fiscal_year__c,
                                    (SELECT npe01__Payment_Date__c FROM  npe01__OppPayment__r ) FROM Opportunity 
            WHERE Designated_fiscal_year__c = '2020-2021' LIMIT 10];	
           
           return tests;
           
         }
    
    }

​Does anyone have any idea if this is because my npe01__OppPayment__r field is reference NPSP managed fields and is not standard Salesforce payment or is this just a bad query? I think theoretically this makes sense. Why will this not show on the page? The only error I'm getting is Unknown property 'TestRollUpData.o'. On my TestRollUpData page and controller.

Thanks.
 
Hello, 

Has anyone else been able to reduce these error messages through programmatic means? These errors seem to be coming from a managed package which, in my experience, have been very difficult to to intercept or interpret code wise. The npsp class is why I know this is the Non-Profit Success Pack at work. Does anyone have experience specifically with identifying the types of processes which would be causing this? I believe that it is mass data manipulation, or users uploading many records into the system.

Thank You,

Frances Allen 
Our users in Salesforce have the email format on creation: 
jcarroll=mycompany.com@example.com 

Somehow I've managed to change my email address to a proper form of 
rsmith@mycompany.com.

When I try to change any other users' emails the format always reverts back to the same as in the first example. In other words, I cannot change it from jcarroll=mycompany.com@example.com  to jcarroll@mycompany.com.

Rather than log a case I though I'd get input from people here first.
Hello,

I'm trying to change emails within a sandbox so I can test an approvals process. The sandbox email contains an equal sign in this format tsmith=mycompany.org. Everytime I try to save as tsmith@mycompany.org it just changes back to tsmith=mycompany.org. Does anyone have a clue as to why this is and how I can change emails? 
Is there a way to prevent users from changing an opportunity, but allowing them to make edits on an opportunity? For example, I want to submit an alteration request in an approval, but I change the fields I was changed before sending it over to the approver? I don't believe this is plausible. They'd have to save their changes, and my validation prevents them from altering the record after a committed stage. 

The reason I want to do this is to cut down on the emails that would need to be sent in verifying the changes that need to be made on the opportunity. I would just put in the error message 'contact the finance manager for changes to committed records.'

Thanks.
Hello, 

I am wondering is anyone else has had this problem. When we are refreshing the dashboards, the dashboard just turns to code. It isn't anymore complicated than that. Literally, it is just html tags and styling. Does anyone know why this might be? 

Thanks.
If there is a post out there that covers this specifically, feel free to point me in that direction. I've researched the tar out of this one.

I need to update a picklist with a trigger using a value that is already a global value, not inserting a new value. The picklist gives me dates in this format:

2018 - 2019
2016 - 2017
etc.

I want the trigger to update a picklist value that is '2016 - 2017' to '2018 - 2019' after the record is saved. Originally, I was thinking that Apex might treat these values as an array and I could iterate from [0] to [1] etc. I don't see this capability baked into any code out there. I'm aware of the getPickListValue(), but this method seems to be used for value insertion or detection, not update.

Is this type of updating possible in Apex? If so, how? If not, are there Salesforce tools I can use to essentially tell the system ' on selection of this boolean field, after a save, update the picklist value to the next in the sequence' - as we're never going to skip years on this update. This picklist exists to place opportunities into a consecutive fiscal year.

Thanks All.
I want to clone a record through Apex using a trigger to customize staging and update date fields.
I've run into two problems:

1. My original record isn't saved. I want the original record to save and a copy to be made from it. I'm looking for an automatic cloning action essentially.

The copy is known by the addage "planning" onto the name of the Opportunity.

2. The trigger is acting on all updates, meaning I can't change and save a field without activating the trigger. Do
I just need to change the parameters? Is there a way to check and limit with Trigger.Old?

Trigger that conditionally stages.
trigger FinancialPlanning on Opportunity (before update) {
 List<Opportunity> oppList = new List<Opportunity>();
    //creating list of opps in which items will live  
    for(Opportunity x : Trigger.new) {
          x.Name = x.Name + ' planning';
          
      
          if (x.StageName == '0 - Deferred'){
    			x.StageName = '1 - Research';
                x.Ask_Ready_Date__c = x.Ask_Ready_Date__c + 365;
                x.npsp__Ask_Date__c = x.npsp__Ask_Date__c + 365;
                x.Verbal_Date__c = x.Verbal_Date__c + 365; 
                x.Committed_Date__c = x.Committed_Date__c +365; 
                x.CloseDate = x.CloseDate + 365;
              
          }else if (x.StageName == '0 - Declined'){
                x.StageName = '1 - Research';
                x.Ask_Ready_Date__c = x.Ask_Ready_Date__c + 365;
                x.npsp__Ask_Date__c = x.npsp__Ask_Date__c + 365;
                x.Verbal_Date__c = x.Verbal_Date__c + 365; 
                x.Committed_Date__c = x.Committed_Date__c +365; 
                x.CloseDate = x.CloseDate + 365;
                
          }else if (x.StageName == '0 - Unresponsive') {
                x.StageName = '1 - Research';
                x.Ask_Ready_Date__c = x.Ask_Ready_Date__c + 365;
                x.npsp__Ask_Date__c = x.npsp__Ask_Date__c + 365;
                x.Verbal_Date__c = x.Verbal_Date__c + 365; 
                x.Committed_Date__c = x.Committed_Date__c +365; 
                x.CloseDate = x.CloseDate + 365;
               
          }else if (x.StageName == '1 - Research') {
				x.Ask_Ready_Date__c = x.Ask_Ready_Date__c + 365;
                x.npsp__Ask_Date__c = x.npsp__Ask_Date__c + 365;
                x.Verbal_Date__c = x.Verbal_Date__c + 365; 
                x.Committed_Date__c = x.Committed_Date__c +365; 
                x.CloseDate = x.CloseDate + 365;
               
          }else if (x.StageName == '2 - Intro'){
                x.Ask_Ready_Date__c = x.Ask_Ready_Date__c + 365;
                x.npsp__Ask_Date__c = x.npsp__Ask_Date__c + 365;
                x.Verbal_Date__c = x.Verbal_Date__c + 365; 
                x.Committed_Date__c = x.Committed_Date__c +365; 
                x.CloseDate = x.CloseDate + 365;
              
          }else if (x.StageName == '3 - Educate'){
                x.Ask_Ready_Date__c = x.Ask_Ready_Date__c + 365;
                x.npsp__Ask_Date__c = x.npsp__Ask_Date__c + 365;
                x.Verbal_Date__c = x.Verbal_Date__c + 365; 
                x.Committed_Date__c = x.Committed_Date__c +365; 
                x.CloseDate = x.CloseDate + 365;
              
          }else if (x.StageName == '4 - Ask Ready'){
                x.npsp__Ask_Date__c = x.npsp__Ask_Date__c + 365;
                x.Verbal_Date__c = x.Verbal_Date__c + 365; 
                x.Committed_Date__c = x.Committed_Date__c +365; 
                x.CloseDate = x.CloseDate + 365;
              
          }else if (x.StageName == '5 - Request'){
                x.Verbal_Date__c = x.Verbal_Date__c + 365; 
                x.Committed_Date__c = x.Committed_Date__c +365; 
                x.CloseDate = x.CloseDate + 365;
              
          }else if (x.StageName == '6 - Verbal'){
                x.Committed_Date__c = x.Committed_Date__c +365; 
                x.CloseDate = x.CloseDate + 365;
              
          }else if (x.StageName == '7 - Committed'){
                x.Committed_Date__c = x.Committed_Date__c +365; 
                x.CloseDate = x.CloseDate + 365;
              
          }else{
                x.Committed_Date__c = x.Committed_Date__c +365; 
                x.CloseDate = x.CloseDate + 365;
          }
          //get this picklist's value and update field with method. 
          x.Designated_Fiscal_Year__c = x.Designated_Fiscal_Year__c ; 
		  
        if (oppList.size() > 0) insert oppList;
            oppList.add(x);
      }
     
}
Here is what I've got in my controller class:
public class FinancialCloningController {
    //added an instance varaible for the standard controller
    private ApexPages.StandardController controller {get; set;}
    
    //instance for the variables being passed by id on the url
	private Opportunity opp {get;set;}
    
    //set the id of the record that is created
    public ID newRecordId {get;set;}
    
    public FinancialCloningController(ApexPages.StandardController controller) {
        this.opp = (Opportunity)controller.getRecord();
        this.controller = controller;
        opp = (Opportunity)controller.getRecord(); 
         
    }
    
    public PageReference cloneOpportunity() {

         // setup the save point for rollback
         Savepoint sp = Database.setSavepoint();
         Opportunity newOpp;

         try{

             //Copy the Opportunity - only include the records you want to clone 
             opp = [SELECT Id, Name, StageName FROM Opportunity WHERE ID = :opp.id];
             insert newOpp;
             newOpp.clone(false, false, false, false);

             //set the id of the new po created for testing
             newRecordId = newOpp.id;
             

         } catch (Exception e){
             // roll everything back in case of error
            Database.rollback(sp);
            ApexPages.addMessages(e);
            return null;
         }

          return new PageReference('/'+newOpp.id+'/e?retURL=%2F'+newOpp.id);
        
    }

}
I'm not sure that I can isolate a triggers actions to a button. Obviously, I'm very new to Salesforce and don't know if there is a way to do this without triggers. I feel the trigger is too powerful in this case. Why is the original record saving as a new record (conditional logic is fine and works), and can this trigger be isolated to a button action?

Thanks.





 
Hello, 

I am wondering is anyone else has had this problem. When we are refreshing the dashboards, the dashboard just turns to code. It isn't anymore complicated than that. Literally, it is just html tags and styling. Does anyone know why this might be? 

Thanks.
Besides using the documentation located here: 
https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_objects_visualforceaccessmetrics.htm

What are other ways to query how many visualforce pages exist in your org? I feel like there is an easier way to do this, like looking under 
pages in setup? What special advantage does querying give you? 



 
I want to preface that I am using the newest version of files for Salesforce Lightning, not classic Notes and Attachments.

We want to ensure that at least one file is uploaded to an opportunity in notes and attachments ( we have enabled files so the upload is of Salesforce files ). 

I cannot see how validation is possible from the opportunity itself. Is anyone doing this without using Process Builder or a Trigger? 

Thanks in Advance.
Hello All, 

I believe that this formula is incorrect in that we cannot use an if statement this way. If there are any pros on the board that quickly double-check my knowledge.
The purpose of this field is to determine current school year according to fiscal year which is after July. 

IF (MONTH(TODAY())>=7, YEAR(TODAY())+1,
IF (MONTH(TODAY())<7, YEAR(TODAY()),0))
IF (MONTH(TODAY())>=7, YEAR(TODAY())+1,
IF (MONTH(TODAY())<7, YEAR(TODAY()),0))

If today’s month is greater or equal to July add one more year to the year otherwise if false  
And today’s month is is less July, todays year, otherwise 0
 
Wouldn’t it be just YEAR(TODAY()) with no comma and zero following?



 
I want to show payment data on a visual force page. I cannot get this to work. I am thinking that I have correctly queried through a nested relationship statement and all is well, but this is not happening.  The visualforce page is here: 
   
<apex:page controller="TestRollUpData">
    <apex:form >
        <apex:pageBlock title="Tests" id="more_tests">
			<apex:pageBlockTable value="{! Opportunity }" var="o">
                <apex:column value="{! o.Name}"/>
                <apex:column value="{! o.Designated_Fiscal_Year__c}"/>
                <apex:column value="{! o.Amount}"/>
            </apex:pageBlockTable>
            <apex:pageBlockTable value="{! o.npe01__OppPayment__r }" var="x">
                <apex:column value="{! x.npe01__Payment_Date__c}"/>
            </apex:pageBlockTable>
            <apex:repeat value="{! Opportunity }" var="x">
              <script>
                  document.getElementById('totalRevenue').value =
                 parseFloat(document.getElementById('totalRevenue').value) + {! Opportunity.Amount};
              </script>
            </apex:repeat>
        </apex:pageBlock>
    </apex:form>
</apex:page>

and the controller is here:
 
public class TestRollUpData {
    

   
    public List<Opportunity> getOpportunity(){ 
    
         List<Opportunity> tests = [SELECT Name, Amount, Designated_fiscal_year__c,
                                    (SELECT npe01__Payment_Date__c FROM  npe01__OppPayment__r ) FROM Opportunity 
            WHERE Designated_fiscal_year__c = '2020-2021' LIMIT 10];	
           
           return tests;
           
         }
    
    }

​Does anyone have any idea if this is because my npe01__OppPayment__r field is reference NPSP managed fields and is not standard Salesforce payment or is this just a bad query? I think theoretically this makes sense. Why will this not show on the page? The only error I'm getting is Unknown property 'TestRollUpData.o'. On my TestRollUpData page and controller.

Thanks.
 
Our users in Salesforce have the email format on creation: 
jcarroll=mycompany.com@example.com 

Somehow I've managed to change my email address to a proper form of 
rsmith@mycompany.com.

When I try to change any other users' emails the format always reverts back to the same as in the first example. In other words, I cannot change it from jcarroll=mycompany.com@example.com  to jcarroll@mycompany.com.

Rather than log a case I though I'd get input from people here first.
Hello, 

I am wondering is anyone else has had this problem. When we are refreshing the dashboards, the dashboard just turns to code. It isn't anymore complicated than that. Literally, it is just html tags and styling. Does anyone know why this might be? 

Thanks.
I want to clone a record through Apex using a trigger to customize staging and update date fields.
I've run into two problems:

1. My original record isn't saved. I want the original record to save and a copy to be made from it. I'm looking for an automatic cloning action essentially.

The copy is known by the addage "planning" onto the name of the Opportunity.

2. The trigger is acting on all updates, meaning I can't change and save a field without activating the trigger. Do
I just need to change the parameters? Is there a way to check and limit with Trigger.Old?

Trigger that conditionally stages.
trigger FinancialPlanning on Opportunity (before update) {
 List<Opportunity> oppList = new List<Opportunity>();
    //creating list of opps in which items will live  
    for(Opportunity x : Trigger.new) {
          x.Name = x.Name + ' planning';
          
      
          if (x.StageName == '0 - Deferred'){
    			x.StageName = '1 - Research';
                x.Ask_Ready_Date__c = x.Ask_Ready_Date__c + 365;
                x.npsp__Ask_Date__c = x.npsp__Ask_Date__c + 365;
                x.Verbal_Date__c = x.Verbal_Date__c + 365; 
                x.Committed_Date__c = x.Committed_Date__c +365; 
                x.CloseDate = x.CloseDate + 365;
              
          }else if (x.StageName == '0 - Declined'){
                x.StageName = '1 - Research';
                x.Ask_Ready_Date__c = x.Ask_Ready_Date__c + 365;
                x.npsp__Ask_Date__c = x.npsp__Ask_Date__c + 365;
                x.Verbal_Date__c = x.Verbal_Date__c + 365; 
                x.Committed_Date__c = x.Committed_Date__c +365; 
                x.CloseDate = x.CloseDate + 365;
                
          }else if (x.StageName == '0 - Unresponsive') {
                x.StageName = '1 - Research';
                x.Ask_Ready_Date__c = x.Ask_Ready_Date__c + 365;
                x.npsp__Ask_Date__c = x.npsp__Ask_Date__c + 365;
                x.Verbal_Date__c = x.Verbal_Date__c + 365; 
                x.Committed_Date__c = x.Committed_Date__c +365; 
                x.CloseDate = x.CloseDate + 365;
               
          }else if (x.StageName == '1 - Research') {
				x.Ask_Ready_Date__c = x.Ask_Ready_Date__c + 365;
                x.npsp__Ask_Date__c = x.npsp__Ask_Date__c + 365;
                x.Verbal_Date__c = x.Verbal_Date__c + 365; 
                x.Committed_Date__c = x.Committed_Date__c +365; 
                x.CloseDate = x.CloseDate + 365;
               
          }else if (x.StageName == '2 - Intro'){
                x.Ask_Ready_Date__c = x.Ask_Ready_Date__c + 365;
                x.npsp__Ask_Date__c = x.npsp__Ask_Date__c + 365;
                x.Verbal_Date__c = x.Verbal_Date__c + 365; 
                x.Committed_Date__c = x.Committed_Date__c +365; 
                x.CloseDate = x.CloseDate + 365;
              
          }else if (x.StageName == '3 - Educate'){
                x.Ask_Ready_Date__c = x.Ask_Ready_Date__c + 365;
                x.npsp__Ask_Date__c = x.npsp__Ask_Date__c + 365;
                x.Verbal_Date__c = x.Verbal_Date__c + 365; 
                x.Committed_Date__c = x.Committed_Date__c +365; 
                x.CloseDate = x.CloseDate + 365;
              
          }else if (x.StageName == '4 - Ask Ready'){
                x.npsp__Ask_Date__c = x.npsp__Ask_Date__c + 365;
                x.Verbal_Date__c = x.Verbal_Date__c + 365; 
                x.Committed_Date__c = x.Committed_Date__c +365; 
                x.CloseDate = x.CloseDate + 365;
              
          }else if (x.StageName == '5 - Request'){
                x.Verbal_Date__c = x.Verbal_Date__c + 365; 
                x.Committed_Date__c = x.Committed_Date__c +365; 
                x.CloseDate = x.CloseDate + 365;
              
          }else if (x.StageName == '6 - Verbal'){
                x.Committed_Date__c = x.Committed_Date__c +365; 
                x.CloseDate = x.CloseDate + 365;
              
          }else if (x.StageName == '7 - Committed'){
                x.Committed_Date__c = x.Committed_Date__c +365; 
                x.CloseDate = x.CloseDate + 365;
              
          }else{
                x.Committed_Date__c = x.Committed_Date__c +365; 
                x.CloseDate = x.CloseDate + 365;
          }
          //get this picklist's value and update field with method. 
          x.Designated_Fiscal_Year__c = x.Designated_Fiscal_Year__c ; 
		  
        if (oppList.size() > 0) insert oppList;
            oppList.add(x);
      }
     
}
Here is what I've got in my controller class:
public class FinancialCloningController {
    //added an instance varaible for the standard controller
    private ApexPages.StandardController controller {get; set;}
    
    //instance for the variables being passed by id on the url
	private Opportunity opp {get;set;}
    
    //set the id of the record that is created
    public ID newRecordId {get;set;}
    
    public FinancialCloningController(ApexPages.StandardController controller) {
        this.opp = (Opportunity)controller.getRecord();
        this.controller = controller;
        opp = (Opportunity)controller.getRecord(); 
         
    }
    
    public PageReference cloneOpportunity() {

         // setup the save point for rollback
         Savepoint sp = Database.setSavepoint();
         Opportunity newOpp;

         try{

             //Copy the Opportunity - only include the records you want to clone 
             opp = [SELECT Id, Name, StageName FROM Opportunity WHERE ID = :opp.id];
             insert newOpp;
             newOpp.clone(false, false, false, false);

             //set the id of the new po created for testing
             newRecordId = newOpp.id;
             

         } catch (Exception e){
             // roll everything back in case of error
            Database.rollback(sp);
            ApexPages.addMessages(e);
            return null;
         }

          return new PageReference('/'+newOpp.id+'/e?retURL=%2F'+newOpp.id);
        
    }

}
I'm not sure that I can isolate a triggers actions to a button. Obviously, I'm very new to Salesforce and don't know if there is a way to do this without triggers. I feel the trigger is too powerful in this case. Why is the original record saving as a new record (conditional logic is fine and works), and can this trigger be isolated to a button action?

Thanks.





 
The business logic is that all financial information that is classified under Stage 7 is handed over to the finance department on the 10th of the following month. For example, all Stage 7 financial fields of September should be closed on the October 10th. After October 10th, I don't want anyone but finance to have access to a restricted field. Ideally, I like the logic behind this solution:

http://www.salesforcetutorial.com/field-level-security-salesforce/

My psuedo code for this would be
If the month and day of the current month are at the 10th, then all expected payments amount fields for the last month should be locked.
Is there a date function that calculates last month only or am I overthinking and should put something like MONTH() - 1?