• Kim Stites
  • NEWBIE
  • 0 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 0
    Replies
I am trying to create a formula that gives me the week of a given quarter.  I had OR for all weeks but that gave me an error and then removing the OR gave me another error.  Can anyone help me with this formula?

IF( Week_of_the_Year__c = (1,15,30,43),1,
IF( Week_of_the_Year__c = OR(2,16,31,44),2,
IF( Week_of_the_Year__c = OR(3,17,32,45),3,
IF( Week_of_the_Year__c = OR(4,18,33,46),4,
IF( Week_of_the_Year__c = OR(5,19,34,47),5,
IF( Week_of_the_Year__c = OR(6,20,35,48),6,
IF( Week_of_the_Year__c = OR(7,21,36,49),7,
IF( Week_of_the_Year__c = OR(8,22,37,50),8,
IF( Week_of_the_Year__c = OR(9,23,38,51),9,
IF( Week_of_the_Year__c = OR(10,24,39,52),10,
IF( Week_of_the_Year__c = OR(11,25,40,53),11,
IF( Week_of_the_Year__c = OR(12,26,41,54),12,
IF( Week_of_the_Year__c = OR(13,27,42,55),13,
IF( Week_of_the_Year__c = OR(14,28,29,56),14,0))))))))))))))
I have enabled the standard quoting out of salesforce and when you click the button to generate the pdf it save to the related list Quote PDFs.  How do I also save it to Notes & Attachments?  Is there an easy way?  I am a very beginner in APEX.
I am changing Lost_Reason__c to a multi-select picklist and need it to include price but am getting an error everytime I run my test code.  Can someone please help?

 for (integer i=0; i<9; i++){
            if (i < 3){
                newOpportunities.get(i).stageName = 'Closed Won';
            }
            else if (i >= 3 && i < 6){
                newOpportunities.get(i).stageName = 'Closed Lost';
                newOpportunities.get(i).Lost_Reason__c = 'Price';  
                newOpportunities.get(i).Lost_Reason_Description__c = 'Because';
            }
            else {
                newOpportunities.get(i).stageName = 'Trial';
            }
        }