• Boom dev9x
  • NEWBIE
  • 55 Points
  • Member since 2015

  • Chatter
    Feed
  • 2
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 9
    Replies
I am having trouble figuring out a formula used within a workflow that will notify a person of a renewal on a contract. The tricky thing is that we have a field called Contract Exp Date (date field). This is the end of a contract. We have another field called Renewal Options (picklist: values = 1 year, 2 years, 3 years, 4 years, 5 years, other). Even though a contract is officially up at the time of the Contract Exp Date, if the Renewal Options are set to 1 year, the rep needs a notification a year into the contract. (Fyi- we do not use the Contract object... these are custom fields). For example: If we have a Contract Exp Date of 6/30/2020, Renewal Option of 1 year, and today is 1/26/15, the end user will need a notification that the contract is up for renewal 90 days before 6/30/2015. Then, the next year, they will need a notification 90 days before 6/30/2016 and so on. Is there a way to do this?

I possibly thought about maybe creating a field to say what the next Renewal Date would be based on the Contract Exp Date and Renewal Options, and then use the Renewal Date to create the workflow, but I am faced with the same difficulty of figuring out the formula.
Hey ,

I´ve create a buttom where it creates a password based on the birthday of my account (YYYYMMDD) , the problem is that when we the day/month as a zero its ignored . Any one has a solutions:

Eg: Birthday : 1992/05/09
      Password : 199259 instead of 19920509

This is the code
 if( resultados != null && resultados.size() > 0){
          
            for(Account  result: resultados){
                    
                    result.Username__c = result.NIF__c;
                    result.Password__c = ''+result.PersonBirthdate.day() + result.PersonBirthdate.month() + result.PersonBirthdate.year();
            } 
        }

Thank u in advanced

I have creaed two feilds 1. Daily comment count 2. Total Comment Count and every day schedule the job at 12:00am so that daily comment will become 0 and added to Total comment count. However when schedule job is running on case the last updaed date is getting modifed as per the job run, below is the schedule job code.

global class CaseCommentCount_JobScheduler implements Schedulable {

    global void execute (SchedulableContext sc)
    {
       
        List <Case> daily_UpdatedCaseList = new List<Case>();
               
        List <Case> daily_CaseList = [select id,Daily_Comment_Count__c from case where Daily_Comment_Count__c > 0 AND Status !='Closed'];
        
        System.debug('CaseCommentCount_JobScheduler : daily_CaseList size' + daily_CaseList.size());
        for(case c : daily_CaseList ){
            c.Daily_Comment_Count__c = 0;
            daily_UpdatedCaseList.add(c);
       }
        update daily_UpdatedCaseList;
        System.debug('CaseCommentCount_JobScheduler : daily_UpdatedCaseList size' + daily_UpdatedCaseList.size());
        
    }
}

1. is there any other way without changing and modifed last updaed 
2. I am planning to update the job every day at 9:00pm 
3. Please help in the code to schedule the job everyday.

Regards
Shaker 
 
Hi all,
I've got a related list on my Opportunity page layout.  It has a custom button on it with OnClick javascript.  I want the button to be visible only if the Opportunity.StageName = 'Closed/Won'.  I've done this using a VisualForce page on the layout that hides the button, but this seems incredibly kludgy.  Does anybody have a better suggestion?
Thanks, Jim
I am new to salesforce development and have been trying to do cross-object updates. I have worked through numerous errors, and am now getting no errors. The code compiles and seems to run just fine. Except that its not doing what its supposed to do. In a test App that I created i have an "Attack" object. I have a custom field called "Hit or Miss" (In order to create an Attack you must select a Unit Object to attack) When the Hit or Miss field is = "HIT" then the status of the Unit Object should go to "Dead" The status is a picklist with values Dead or Alive. Hopefully I have explained enough so that you can understand what it is I am trying to do. Here is my code.

trigger statusTrigger on Attack__c (after insert) 
{
    for(Attack__c a : Trigger.New)
    {
        
        if(a.Hit_or_Miss__c =='HIT!')
        {   
            List<Unit_Type__c> unit = [SELECT Name,Status__c FROM Unit_Type__c WHERE Name = : 'a.Who_To_Attack__c'];
            for(Unit_Type__c u : unit)
            {
                u.Status__c = 'Dead';
                
            }
            update unit;
        }
        else
        {
            //Do Nothing.  
        }
        
    }
    
}

Can you see what im doing wrong?
I am having trouble figuring out a formula used within a workflow that will notify a person of a renewal on a contract. The tricky thing is that we have a field called Contract Exp Date (date field). This is the end of a contract. We have another field called Renewal Options (picklist: values = 1 year, 2 years, 3 years, 4 years, 5 years, other). Even though a contract is officially up at the time of the Contract Exp Date, if the Renewal Options are set to 1 year, the rep needs a notification a year into the contract. (Fyi- we do not use the Contract object... these are custom fields). For example: If we have a Contract Exp Date of 6/30/2020, Renewal Option of 1 year, and today is 1/26/15, the end user will need a notification that the contract is up for renewal 90 days before 6/30/2015. Then, the next year, they will need a notification 90 days before 6/30/2016 and so on. Is there a way to do this?

I possibly thought about maybe creating a field to say what the next Renewal Date would be based on the Contract Exp Date and Renewal Options, and then use the Renewal Date to create the workflow, but I am faced with the same difficulty of figuring out the formula.
Hey ,

I´ve create a buttom where it creates a password based on the birthday of my account (YYYYMMDD) , the problem is that when we the day/month as a zero its ignored . Any one has a solutions:

Eg: Birthday : 1992/05/09
      Password : 199259 instead of 19920509

This is the code
 if( resultados != null && resultados.size() > 0){
          
            for(Account  result: resultados){
                    
                    result.Username__c = result.NIF__c;
                    result.Password__c = ''+result.PersonBirthdate.day() + result.PersonBirthdate.month() + result.PersonBirthdate.year();
            } 
        }

Thank u in advanced
Is it possible to show the direct download links (e.g. Attachment 1, Attachment 2) of attachments on a view?
I have an invoice object where the original invoice (pdf) is uploaded. But to make it easier to get an overview it would be useful to have a button/link on the list view of all invoices to get the document directly instead of opening the invoice, clicking on the attachment(s) and click view file for every invoice.

Can someone help me along on how to implement this, or tell me if this is possible?
I'm having trouble accessing the attachments from the object via code.