Tuesday 7 June 2016

RECOVER From ECLIPSE ERROR code 13

Why Error code occurs....???
                                    I just updated Java to 1.8 u25, and now I get this message every time I try to open Eclipse


enter image description here



How to RECOVER From  ECLIPSE ERROR code 13....?????


1) Right-click on Computer and choose Properties.
2) Click Advanced system settings
3) Click Environment Variables...
4) Find the Path variable in the System variables section.
5) Choose it and click Edit...
6) Find and delete the above mentioned path.
This fixed it for me. I should mention that I already have the path:
c:\Program Files\Java\jdk1.7.0_21\bin
in the Path variable, but the new path was added to the beginning of the Path variable and therefore resolution would use that path first.
Like this every one will have own path .....so go to Local disk c; >>>  java  >>>find your version number >> bin folder
c:\Program Files\Java\jdk1.7.0_21\bin.......
Like this you have to edit the path inSystem variables section.
salesforce cheers!!!

Saturday 4 June 2016

HOSPITAL MANAGEMENT SYSTEM APPLICATION

CREATE CUSTOM APPLICATION OF HOSPITAL MANAGEMENT SYSTEM 


DESCRIPTION:
                            The hospital management software help to run smoothly the regular day to day basis operations of any hospital. The hospital management software is made such a way that it looks after the outpatients, inpatients, billings, database of the patients, and the hospital information including the availability of the doctors, their specialization, the payments to various members of the staff and the billing process.

HOSPITAL MANAGEMENT SYSTEM FOR OUTPATIENTS:

                             Normally in small hospital we can able to see some order of execution .In that manner I have created a application as I am a developer beginner.In hospitals we can see Registration for patient ,Doctor Details, Appointment Details,Medication Details.


OBJECTS:
                  i)  PATIENT
                 ii)  DOCTOR
                 iii) APPOINTMENT
                 iv)  MEDICATION.

i) FIELDS FOR PATIENTS:







ii) FIELDS FOR  DOCTORS:









iii) FIELDS FOR  APPOINTMENTS:






iii) FIELDS FOR  MEDICATIONS:








CREATE VALIDATION RULES AND FORMULA FIELDS:

i) Formula to calculate AGE from DOB:    FORMULA FIELDS.
    (TODAY()-DOB__C)/365.2425

ii) To avoid DOB equal to TODAY :          VALIDATION RULE.
     DOB__C = TODAY().

iii)Next visit should be greater than 30 days than Appointment Created Date:
       Next_visit__c<(Date value(Created Date )+30)


CREATE VISUALFORCE PAGES :

I have created Visualforce pages for objects REGISTRATION (HOME PAGE VF )PATIENT, DOCTOR, APPOINTMENT.

  
VISUALFORCE PAGE CODE FOR REGISTRATION (HOME PAGE VF )



<apex:page showHeader="False" sidebar="false" Controller="homepage" >
<style type="text/css">
p { font-weight: bold; }
</style>
<p><center> <font size="6" color="BLUE"> <b> HOSPITAL MANAGEMENT SYSTEM </b> </font></center> </p>
  
  <apex:form >
  <apex:pageBlock title="NEW ENTRIES">
  <center>
  <apex:commandButton value="New Patient" action="https://c.ap2.visual.force.com/apex/patients?sfdc.tabName=01r28000000UAYC"/>
  <apex:commandButton value="New Doctor" action="https://c.ap2.visual.force.com/apex/Doctors?sfdc.tabName=01r28000000UAg1"/>
  <apex:commandButton value="New Appointment" action="https://c.ap2.visual.force.com/apex/HospitalManagementSystem?sfdc.tabName=01r28000000UAoU"/>
  </center>
</apex:pageBlock>
<apex:pageBlock title="PATIENT DETAILS">

       <apex:pageBlockButtons location="top"> 
       <apex:commandButton value="New Patient"  action="/apex/patients?sfdc.tabName=01r28000000UAYC"/>
       </apex:pageBlockButtons>
  
       <apex:pageBlockTable value="{!patlists}" var="p">
       
       <apex:column style="align:right" headerValue="Patient Names">
       <apex:outputLink value="/{!p.id}">{!p.Name}</apex:outputLink>
       </apex:column>
      
       <apex:column style="align:left" headerValue="mobile">
       <apex:outputLink value="/{!p.id}">{!p.Mobile__c}</apex:outputLink>
       </apex:column>
       
       <apex:column style="align:left" headerValue="Appointments">
       <apex:repeat value="{!p.Appointments__r}" var="b">
       <apex:outputLink value="/{!b.id}">{!b.Name}</apex:outputLink><br/>
       </apex:repeat>
       </apex:column>
       
       <apex:column style="align:left" headerValue="Appointment Date">
       <apex:repeat value="{!p.Appointments__r}" var="a"><br/>
       {!a.Appointment_Date__c}
       </apex:repeat>
       </apex:column>
</apex:pageBlockTable>
</apex:pageBlock>

<apex:pageBlock title="DOCTOR DETAILS" >
       <apex:pageBlockButtons location="top"> 
       <apex:commandButton value="New Doctor" action="https://c.ap2.visual.force.com/apex/Doctors?sfdc.tabName=01r28000000UAg1"/>
       </apex:pageBlockButtons>
  
       <apex:pageBlockTable value="{!doclists}" var="d">
       
       <apex:column style="align:right" headerValue="Doctor Names">
       <apex:outputLink value="/{!d.id}">{!d.Name}</apex:outputLink>
       </apex:column>
      
       <apex:column style="align:left" headerValue="mobile">
       <apex:outputLink value="/{!d.id}">{!d.Mobile__c}</apex:outputLink>
       </apex:column>
       
       <apex:column style="align:left" headerValue="Appointments">
       <apex:repeat value="{!d.Appointments__r}" var="a">
       <apex:outputLink value="/{!a.id}">{!a.Name}</apex:outputLink>
       </apex:repeat>
       </apex:column>
       
       <apex:column style="align:left" headerValue="Appointment Date">
       <apex:repeat value="{!d.Appointments__r}" var="b">
       {!b.Appointment_Date__c}
       </apex:repeat>
       </apex:column>
       
</apex:pageBlockTable>
</apex:pageBlock>

<apex:pageBlock title="APPOINTMENT DETAILS" >
       <apex:pageBlockButtons location="top">
       <apex:commandButton value="New Appointment" action="https://c.ap2.visual.force.com/apex/HospitalManagementSystem?sfdc.tabName=01r28000000UAoU"/>
       </apex:pageBlockButtons>
       <apex:pageBlockTable value="{!applists}" var="a">
       
       <apex:column style="align:right" headerValue="Appointment No">
       <apex:outputLink value="/{!a.id}">{!a.Name}</apex:outputLink>
       </apex:column>
       
       <apex:column style="align:left" headerValue="Patient Name">
      <apex:outputLink value="/{!a.id}">{!a.Patient_Name__r.Name}</apex:outputLink>
      </apex:column>
      
      <apex:column style="align:left" headerValue="Appoinment Date">
      <apex:outputLink value="/{!a.id}">{!a.Appointment_Date__c}</apex:outputLink>
      </apex:column>
      
      <apex:column style="align:left" headerValue="Doctor Name">
      <apex:outputLink value="/{!a.id}">{!a.Doctor_Name__r.Name}</apex:outputLink>
      </apex:column>
      
</apex:pageBlockTable>
</apex:pageBlock>
</apex:form>

</apex:page>


CONTROLLER FOR FOR REGISTRATION (HOME PAGE VF ):



public  class homepage {

    public List<Patient__c>  patlists{set;get;}

     public List<Doctor__c>  doclists{set;get;}

     public List<Appointment__c> applists{set;get;}

   public homepage()

   {

      patlists=[Select id,name,Mobile__c,(Select Id,  Name, Appointment_Date__c From Appointments__r) From Patient__c];

      doclists=[select id,name,Mobile__c,(Select Id,  Name, Appointment_Date__c From Appointments__r) from Doctor__c];

      applists=[select id,name,Appointment_Date__c, Patient_Name__c,Doctor_Name__c,Doctor_Name__r.Name,Patient_Name__r.Name from Appointment__c];

}

}



VISUALFORCE PAGE CODE FOR   PATIENTS:

<apex:page sidebar="false" showHeader="false" controller="patientcontroller">
<apex:form >
<apex:pageBlock title="NEW PATIENT DETAILS">


    <apex:pageBlock >
    
    <apex:pageBlockSection >
    <apex:inputField value="{!p.Patient_ID__c }"/>
    <apex:inputField value="{!p.Name}" required="true"/>
    <apex:inputField value="{!p.Address__c }"/>
    <apex:inputField value="{!p.Age__c }"/>
    <apex:inputField value="{!p.Email__c}"/>
    <apex:inputField value="{!p.Mobile__c}"/>
    <apex:inputField value="{!p.Gender__c}"/>
     <apex:inputField value="{!p.DOB__c}"/>
    <apex:inputField value="{!p.Blood_Group__c}"/>
    
    </apex:pageBlockSection>
    
    <apex:pageBlockButtons >
    <apex:commandButton value="Save" action="{!save}" />
    <apex:commandButton value="Save & New" action="{!saveandnew}" />
    <apex:commandButton value="Cancel" action="/apex/Registration" immediate="true"/>
    
    </apex:pageBlockButtons>
   </apex:pageBlock>
    
    
</apex:pageBlock>
</apex:form>

</apex:page>



CONTROLLER FOR FOR PATIENTS:

public class patientcontroller {
public Patient__c p {get; set;}

public patientcontroller(){
p = new Patient__c();
}

public PageReference save() {
return null;
}

public PageReference saveandnew() {
insert p;

PageReference PageRef = new PageReference('/apex/patients');
p.clear();
return PageRef;
}

}


VISUALFORCE PAGE CODE FOR DOCTORS:

<apex:page sidebar="false" showHeader="false" Controller="Doctorcontroller">
<apex:form >
<apex:pageBlock title="NEW DOCTOR DETAILS">
    
    
    <apex:pageBlockSection >
    <apex:inputField value="{!d.Doctor_ID__c }"/>
    <apex:inputField value="{!d.Name}" required="true"/>
    <apex:inputField value="{!d.Email__c }"/>
    <apex:inputField value="{!d.Mobile__c }"/>
    <apex:inputField value="{!d.Specialization__c}"/>
    <apex:inputField value="{!d.Gender__c}"/>
    <apex:inputField value="{!d.DOB__c}"/>
    <apex:inputField value="{!d.Age__c}"/>
    <apex:inputField value="{!d.Blood__c}"/>
     </apex:pageBlockSection>
    
    
    <apex:pageBlockButtons >
    <apex:commandButton value="Save" action="{!save}" />
    <apex:commandButton value="Save & New" action="{!saveandnew}" />
    <apex:commandButton value="Cancel" action="/apex/Registration" immediate="true" />
    </apex:pageBlockButtons>
  
    
    
</apex:pageBlock>
</apex:form>

</apex:page>

CONTROLLER FOR FOR DOCTORS:

public class Doctorcontroller {

public Doctor__c d {get; set;}

public Doctorcontroller(){
d = new Doctor__c();
}

public PageReference save() {
return null;
}

public PageReference saveandnew() {
insert d;

PageReference PageRef = new PageReference('/apex/Doctors');
d.clear();
return PageRef;
}

}

VISUALFORCE PAGE CODE FOR APPOITMENTS:

<apex:page sidebar="false" showHeader="false" Controller="Appointmentcontroller">
<apex:form >

    <apex:pageBlock title="Appointment DETAILS">
    
    <apex:pageBlockSection >
    <apex:inputField value="{!a.Name}" />
    <apex:inputField value="{!a.Appointment_Date__c }"/>
    <apex:inputField value="{!a.Doctor_Name__c}"/>
    <apex:inputField value="{!a.Patient_Name__c }"/>
    
    
    
    </apex:pageBlockSection>
    
    <apex:pageBlockButtons >
    <apex:commandButton value="Save" action="{!save}" />
    <apex:commandButton value="Save & New" action="{!save}" />
    <apex:commandButton value="Cancel" action="/apex/Registration" />
    </apex:pageBlockButtons>
    
   
    
    
</apex:pageBlock>
</apex:form>
  

</apex:page>


CONTROLLER FOR FOR APPOINTMENTS:

public class Appointmentcontroller {

public Appointment__c a{get;set;}

public Appointmentcontroller(){
a=new Appointment__c();
}
public pagereference save(){
return null;
}
public pagereference saveandnew(){
insert a;

pagereference pageref =new PageReference('/apex/HospitalManagementSystem');
a.clear();
return pageref;
}

}












            




Generate QR Code for any object in 5 Min

Generate QR Code for any object in 5 Min


Do you know about QR Code....???
                                                      Quick Response Codes are a type of two-dimensional bar code that can be read using smartphones and dedicated QR reading devices, that link directly to text, emails, websites, phone numbers and more! You may have even got to this site by scanning a QR code!

How To Implement In Salesforce.....???
                 So pick any object for this. I have picked Contact object.

1. Click on Setup. It is placed on Top-Right.
2. Then in Left panel, go to Customize –> Contacts –> Fields
3. Click on New button to create the new custom field.
4. Select Formula field type here.
5. Fill field name with “QR Code” and Select Formula Return Type as “Text”
6. Then paste the following code in formula area:

Explanation of above code:
1. IMAGE(image_url, alternate_text [, height, width]) : Is a function to show image with giving URL.
2. https://chart.googleapis.com/chartchs=200×200&cht=qr&chl=https://cs87.salesforce.com/’& Id
2.1 https://chart.googleapis.com/chart : Is Google Chart API
2.2 chs: Height and width of QR Code
2.3 cht: Chart Type. We need to put qr for QR code
2.4 chl: QR Code will generate this text. (In our example I am putting URL of record)
Note: Please put your domain Url instead of https://mas-dev-ed.my.salesforce.com
Now Save your formula field and open any record. You can see a QR Code on record.
Screen Shot 2016-06-04 at 8.51.10 AM
Now you can use any QR Code scanner app on mobile.
I am using Google Goggles. You can download from here:
https://play.google.com/store/apps/details?id=com.google.android.apps.unveil&hl=en
Now Open this app and scan your code. It will look like this:
Screenshot_2016-06-04-08-54-09
Click on generated link on the bottom of the screen. It will redirect to record.
Salesforce Rocks!!!!



Wednesday 1 June 2016

Render As Excel In Salesforce

Visualforce page RenderAs:

<apex:page contentType="application/x-excel#RenderAsTestFile.xls" standardController="TestObject__c">
    <apex:pageBlock >
        <apex:pageblockTable value="{!TestObject__c}" var="v" border="1"
                      columnsWidth="100px,200px,150px" cellspacing="0" cellpadding="8">
            <apex:column headerValue="Id">{!v.Name}</apex:column>
            <apex:column headerValue="Name">{!v.Name__c}</apex:column>
            <apex:column headerValue="Contact Number">{!v.Mobile__c}</apex:column>
            <apex:column headerValue="Mail id">{!v.Mail_id__c}</apex:column>
        </apex:pageblockTable>
    </apex:pageBlock>  
</apex:page>


 Render As EXCEL FILE