• ANKITA
  • NEWBIE
  • 30 Points
  • Member since 2011

  • Chatter
    Feed
  • 1
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 13
    Questions
  • 36
    Replies
hi all


i have written a controller fulk bulk insertion of records.for the user to input data i have declared userinputappointment in my controller and for the procees to go on i have declared my userinput
field values ti integers where my test case is showing errors plz help me resolve this issue

my controller
public class ExtTwo
{
public ExtTwo(ApexPages.StandardController controller) 
{ 
userInputAppointment = new Appointment__c();
}
public Appointment__c userInputAppointment {get; set;}
public list<appointment__c> apps {get;set;}  
public list<appointment__c> apps1 {get;set;}  
public list<appointment__c> apps2 {get;set;}
public list<appointment__c> apps3 {get;set;}
public list<appointment__c> apps4 {get;set;}
public list<appointment__c> apps5 {get;set;}

public PageReference save()
{
apps = new list<appointment__c>();
apps1 = new list<appointment__c>();
apps2 = new list<appointment__c>();
apps3 = new list<appointment__c>();
apps4 = new list<appointment__c>();
apps5 = new list<appointment__c>();
integer i=integer.valueof(userInputAppointment.from__c);          
integer i1=integer.valueof(userInputAppointment.To__c);
integer i2=integer.valueof(userInputAppointment.from_min__c);
integer i3=integer.valueof(userInputAppointment.To_Min__c);
if(i<i1)
{ 
for(integer k=0;k<(60-i2)/10;k++)
{
appointment__c ap = new appointment__c();
ap.branch__c =  userInputAppointment.branch__c;
ap.account__c = userInputAppointment.Account__c;
ap.doctor__c=userInputAppointment.doctor__c;
ap.appt_date__c = userInputAppointment.appt_date__c;
ap.Appt_AM_PM__c= 'AM';
if(integer.valueof(userInputAppointment.from__c)>=12)
{
ap.Appt_AM_PM__c= 'PM';
}
ap.Appt_Hour__c =String.valueOf(integer.valueof(userInputAppointment.from__c));
if(integer.valueof(userInputAppointment.from__c)>12)
{
ap.Appt_Hour__c =String.valueOf(integer.valueof(userInputAppointment.from__c)-12);
}
ap.Appt_Minute__c = userInputAppointment.from_min__c;
ap.RecordTypeid=userInputAppointment.RecordTypeid;
if(i2!=integer.valueof(userInputAppointment.from_min__c))
{
ap.RecordTypeid='012N0000000CgSu';
}
apps1.add(ap);
}
insert apps1;

my test case

@isTest
private class extwoTestclass
{
static testmethod void TestController() 
{

 
  ApexPages.StandardController con = new ApexPages.StandardController(new Appointment__c()); 
       
      ExtTwo cs = new ExtTwo(con);    
        
      PageReference pr2 = cs.save();
      
     
 } 
          
  }
plzz help me in this
error i am getting
system.null pointer exception.argument 1 cannot be null 
i think the error is in this part as userinputappointment__c is going null plz help me for my test case

integer i=integer.valueof(userInputAppointment.from__c);          
integer i1=integer.valueof(userInputAppointment.To__c);
integer i2=integer.valueof(userInputAppointment.from_min__c);
integer i3=integer.valueof(userInputAppointment.To_Min__c);



 

Hi All,

          I want to Override standared page(Account.Contact,Opportunity etc) with my VisualForce page with extension controller.Is it possible,if yes then please tell me how.

 

With Regards

Prabhash Mishra

Create Campaigns based  on the Type of campaigns. How do we set up the Budgeted Cost & Actual Cost for a campaign? 

 

 

Hi All,  

   I am trying to get the list of documents based on createdDate using Dynamic SOQL.

   I am getting SOQL Exception in this.  Please see the sample code. Any help would be greatly appreciated.    

 

Sample Code:  

Datetime fromDate = datetime.newInstance(2005,10,08, 1,02,03); 

try{ 

string sUserQuery = 'Select Name,CreatedDate From Document where CreatedDate >' + fromDate; 

system.debug('**User Query**' + sUserQuery); 

List<Sobject> lstQueryRecords = Database.query(sUserQuery); 

system.debug('--------lstQueryRecords-------' + lstQueryRecords); 

}

 catch(Exception ex){

system.debug(ex.getMessage()); 

 

Debug Logs :  System.QueryException: line 1:76 no viable alternative at character '<EOF>'

                          DEBUG|line 1:76 no viable alternative at character '<EOF>'

hi,

 

i have a check box on my VF page.

I don't have controller to my page.

When i click on that check box i need to display <input type="text"> in my VF page.

 

 

HI, i have checkbox and text dataype i.e status and points, if the status is active then it will enable the point text field  otherwise it should be disable the textbox (points) ,so how can i do the validation so kindly let me know ASAP.

Hi,

 

What is a merge field?

Where we use it?

 

thanks

 

 

 

Hi,

 

How can i use standard styles in my VF page?

Could you please send some samples to understand easily.

 

Thanks,

ANKITA

Hi,

 

I want to dosplay the approval history  of  a record  on a visualforce page in a Pageblock table.I am able to do the same by querying ProcessInstanceStep and providing TargetObject Id in where clause.

 

But I am not able to display the latest in the first row.I have used ORDER BY createdDate but still I am not able to view the latest on first row.Can anyone please how this can be sorted out.

 

Thanks,

Srilakshmi B

 

Hi All,

 

Can you pls tell me why is that record name is there while creating custom object. Why it's mandatory?

 

 

Cheers,

Jagdeep

<script>

function x(id)

{

-------

}

</script>

<apex:pageblocktable ---------- var="x">

  <apex:commandlink value="{!x.name}" onclick="x({!x.Id})"/>

</apex:pageblocktable>

It is not working.

How can i pass record id from page block section to javascript function.

please suggest me!

 

Thanks

ANKITA

Friends,

 

Can report be migrated from onse salesforce instance to other ?

(assuming the object schema / structure is same in both organization.)

 

Also, is it possible to migrate reports within Sandboxs of organization?

Will appreciate your hrelp.

Hi,

I have a page block table, in which i need to display Action name="clone" (Commandlink) and Name,city__c values from a custom object (like as shown below)

Action                      Name            City

clone                         A1               Hyd

clone                         A2               Jaipur

When i click on clone button, i need to add the same record again(below that existing record).

Can any one help me to solve this.

 

Thanks,

ANKITA

 

 

 

 

Hi,

 

I'm new to cloud development. Whenever and wherever I read about cloud computing, i find 'on-demand' word. What does it mean in context of cloud. Can anyone put more light on it.

 

Thanks

Hi All,

 

Here is my requirement.

I have one simple dot net webform, it contains 2 text fileds (Name, WebSite) and Submit Button.

If I hit submit button new record will be created on Account object (Salesforce) with Name and Website fields.

 

Can you please give me  ideas to acheive above requirement.

 

 

 

Thanks,

Krishna