Skip to main content
Code:

 

Profile enquiryprof = [Select Id from Profile where Name='Interface administrator'];

 

  Period__c change = Period__c.getValues(enquiryprof.Id);

 

  change = [select month__c,year__c from Period__c where Name=' Interface administrator'];

 

  Integer yr = Integer.valueOf(change.year__c);

 

  Integer mn = Integer.valueOf(change.month__c);

 

   if(mn == 12)

 

       {   

 

        yr++;   

 

        mn=1;

 

       }

 

      else

 

       {   

 

        mn++;

 

       }

 

   update change;

 

The values in my particular profile are not updating.
20 respuestas
  1. 7 ene 2014, 06:12
    (I forgot to convert back to String!)

     

    Use this at the end instead:

     

    change.Year__c = String.valueOf(yr);

     

    change.Month__c = String.valueOf(mn);

     

    update change;
0/9000