+ Start a Discussion

Record size is not as required


I am writing a code where i have created two formula field which gives me number of days for particular month like this

Formula field= Febrary: To check number of days in febrary
IF( ISPICKVAL( Month__c , 'February') , TEXT(IF( OR((ISPICKVAL(Year__c, '2016')),(ISPICKVAL(Year__c,'2020')), ((ISPICKVAL(Year__c, '2024')))) , 29, 28)), null)

Formula field= NumberOfDays

My query is i am writing a code where i can create records for those particular days of particular month but by my code i am able to create only 30 records. I want that in picklist field if month is jan then it should create 31 records, if month is feb then accordingly leap year it should create 29/28 days. and if month is of 30 days then it should create 30 records. Now with my code i am able to create only 30 records for any month. In debug statement    System.debug('***************dy size******************'+dy); I am getting size 30. Can anyone please help me with this??


public with sharing class Calender {
    public List<DTP__c> mydtpList {set;get;}

    public Calender(ApexPages.StandardController controller)
          tid = ApexPages.currentPage().getParameters().get('id');
         System.debug('***************dtp added*******************'+tid); 


 public Decimal dy;
 public  id tid{get;set;}
    public PageReference createdtp() {
        System.debug('***************tid tid*******************'+tid);
        List<MTP__c> obj = [Select  Id, Month__c, Year__c,  February__c, NumberOfDays__c from MTP__c];
    for(MTP__c mt:obj)
    String str=mt.February__c;
     Decimal str= mt.NumberOfDays__c;
  List<DTP__c> newdtp= new List<DTP__c>();
   System.debug('***************dy size******************'+dy);
    for(Integer i = 1; i<=dy; i++)

       DTP__c  dt = new DTP__c();
       System.debug('****************dtp added********************'+tid);
       //insert newdtp;
    insert newdtp;
    return null;
    public List<DTP__c> getMydtpList(){
        List<DTP__c> mydtpList =[select Name, Expenses__c, MTP__c, Food_Expenses__c, Date__c, Visit_type__c from DTP__c where MTP__c=:tid];

        return mydtpList ;
    //List<DTP__c>  mydtpList = [select Expenses__c, Name, MTP__c, Food_Expenses__c, Visit_type__c from DTP__c where id=:tid];


VF PAge:

<apex:page standardController="MTP__c" extensions="Calender" action="{!createdtp}">

Thanks & Regards,

Harish RamachandruniHarish Ramachandruni

showme ant one of janvery month record in standard page .

Regards ,
Hi Harish,

Its not added in site. How can i show you standard page?

Regards ,