• Samuel Robert
  • NEWBIE
  • 20 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 7
    Questions
  • 5
    Replies
Hi,

I have devloped a pagination for custom  controllor, however i have finding the issue as, while i select the category as opened and hit on search it will list the set of records and i will hit on the next page botton to check the second set of records, now im on the second page. At this stage i again change the category to closed and hit on search it will list the set of records but still it is on second page not on the first page. Please Help me on this.

Please find the code below....

 
<apex:page controller="CaseAssocInTriageController" sidebar="False">
    <apex:includeScript value="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js" />            
    <apex:stylesheet value="{!URLFOR($Resource.OnlineOrderFormCss, 'OnlineOrderForm.css')}" />
    <apex:includeScript value="{!URLFOR($Resource.OnlineOrderFormScript, 'OnlineOrderFormScript.js')}"/>
    <style type="text/css">    
        td {        
        valign: middle!important;
        padding: 10px;        
        }
        
        .btnblue{
        margin-bottom:0px!important;        
        } 
        
        body .btnDisabled:hover{
        color: #909090!important;
        }
        body .btnDisabled{
        color: #909090!important;
        }  
        
        td .redbg{
        background-color:red!important;
        width:50px!important;
        height:50px!important;
        border:0px!important;
        margin:0px!important;
        }
        
        td .greenbg{
        background-color:green!important;
        width:50px!important;
        height:50px!important;
        border:0px!important;
        margin:0px!important;
        }
        
        td .yellowbg{
        background-color:yellow!important;
        width:50px!important;
        height:50px!important;
        border:0px!important;
        margin:0px!important;
        }
    </style>
    <apex:pageBlock title="Triage SLA's Dashboard" id="casesref">
        <apex:pageBlockButtons >                                                                                  
            <apex:actionstatus id="ocstatus">
                <apex:facet name="start">
                    <div class="waitingSearchDiv" id="el_loading" style="background-color: #fbfbfb;
                                                                         height: 100%;opacity:0.65;width:100%;"> 
                        <div class="waitingHolder">
                            <img class="waitingImage" src="/img/loading.gif" title="Please Wait..." />
                            <span class="waitingDescription">Please Wait...</span>
                        </div>
                    </div>
                </apex:facet>
            </apex:actionstatus>
        </apex:pageBlockButtons> 
        <apex:form >
            <apex:pageBlockSection columns="1">
                <apex:outputPanel id="ref">
                    <table colspan="3">
                        <tr>
                            <td><apex:outputLabel value="Case Status " style="font-weight:bold"/></td>
                            <td>                    
                                <apex:selectList size="1" value="{!caseStatus}" style="width:100px;Height:25px;">
                                    <apex:selectOption itemValue="Open"></apex:selectOption>
                                    <apex:selectOption itemValue="Closed"></apex:selectOption>
                                </apex:selectList> 
                            </td>                               
                            <td>
                                <apex:outputLabel value=" Account Name " style="font-weight:bold;"/>                    
                            </td>
                            <td>
                                <apex:selectList size="1" value="{!AcctName}" style="Height:25px;">
                                    <apex:selectOptions value="{!AcctNames}"></apex:selectOptions>
                                </apex:selectList>                            
                            </td>
                            <td></td>
                            <td>
                                <apex:commandButton value="Search" action="{!search}" styleClass="btnblue" status="ocstatus" reRender="ref,rest,bottompg,toppg,casesref">                                    
                                </apex:commandButton>
                            </td> 
                            <td>
                                
                            </td>
                        </tr>
                    </table>                     
                </apex:outputPanel> 
                <apex:outputPanel style="float:right;" id="toppg">
                    <apex:outputLabel value="Please choose options to view data.. " rendered="{! not isRecordFound}" style="font-weight:bold;color:#25729a;width:300px;"></apex:outputLabel>
                    <apex:outputLabel value="   {!pageInfo} : " rendered="{!isRecordFound}" style="font-weight:bold;color:#25729a;width:300px;"></apex:outputLabel>  
                    <apex:commandButton value="<<Previous page" action="{!searchPreviousPageOffset}"   status="ocstatus" reRender="casesref,toppg,rest" disabled="{!disablePreviousBtn}" style="color:#25729a">                    
                    </apex:commandButton>                                                  
                    <apex:commandButton value="Next page>>" action="{!searchNextPageOffset}"  status="ocstatus" reRender="casesref,toppg,rest,ref" disabled="{!disableNextBtn}" style="color:#25729a">                    
                    </apex:commandButton>
                </apex:outputPanel>
                <apex:outputPanel id="rest">   
                    <apex:pageBlockTable value="{!caseResults}" var="cr">
                        <apex:column headerValue="Case Number">
                            <apex:outputLink value="{!URLFOR($Action.Case.View, cr.Id)}" target="_blank">
                                {!cr.casenumber}
                            </apex:outputLink>                            
                        </apex:column>
                        <apex:column headerValue="Triage Date" value="{!cr.Date_Swap_Triage_New__c}">
                            <apex:facet name="header"></apex:facet>                             
                        </apex:column>
                        <apex:column headerValue="Age in Hours" value="{!cr.CaseHourCalc__c}">
                            <apex:facet name="header"></apex:facet>                             
                        </apex:column>
                        <apex:column style="padding:0px!important">                            
                            <apex:facet name="header">Severity</apex:facet>
                            <apex:outputPanel styleClass="redbg" rendered="{!(cr.priority=='Normal' && cr.CaseHourCalc__c>=31 && cr.status!='Closed') || (cr.priority=='High' && cr.CaseHourCalc__c>=6 && cr.status!='Closed') || (cr.priority=='Urgent' && cr.CaseHourCalc__c>=4 && cr.status!='Closed')}">
                                <div class="redbg"></div>
                            </apex:outputPanel>
                            <apex:outputPanel styleClass="yellowbg" rendered="{!(cr.priority=='Normal' && cr.CaseHourCalc__c>=24  && cr.CaseHourCalc__c<32 && cr.status!='Closed') || (cr.priority=='High' && cr.CaseHourCalc__c>=4 && cr.CaseHourCalc__c<6 && cr.status!='Closed') || (cr.priority=='Urgent' && cr.CaseHourCalc__c>=2 && cr.CaseHourCalc__c<4 && cr.status!='Closed')}">
                                <div class="yellowbg"></div>
                            </apex:outputPanel>
                            <apex:outputPanel styleClass="greenbg" rendered="{!(((cr.priority=='Normal' && cr.CaseHourCalc__c<24) || (cr.priority=='High' && cr.CaseHourCalc__c<4) || (cr.priority=='Urgent' && cr.CaseHourCalc__c<2)) || cr.status=='Closed')}">
                                <div class="greenbg"></div>
                            </apex:outputPanel>                                 
                        </apex:column>
                        <apex:column headerValue="Case Priority" value="{!cr.priority}" >
                            <apex:facet name="header">
                                <apex:commandLink action="{!sortByCasePriority}" 
                                                  reRender="rest" status="ocstatus">Case Priority
                                </apex:commandLink>
                            </apex:facet>                            
                        </apex:column>
                        <apex:column headerValue="Account Name" value="{!cr.account.name}">
                            <apex:facet name="header">
                                <apex:commandLink action="{!sortByCaseAccount}" 
                                                  reRender="rest" status="ocstatus">Account Name
                                </apex:commandLink>
                            </apex:facet>                            
                        </apex:column>                      
                        <apex:column headerValue="Subject" style="width:50%">
                            <apex:outputText value="{!cr.Subject}"></apex:outputText>
                        </apex:column>
                        <apex:column headerValue="Case Status" value="{!cr.status}">
                            <apex:facet name="header">
                                <apex:commandLink action="{!sortByCaseStatus}" 
                                                  reRender="rest" status="ocstatus">Case Status
                                </apex:commandLink>
                            </apex:facet>                            
                        </apex:column>
                        <apex:column headerValue="Case Owner" value="{!cr.Owner.name}">
                            <apex:facet name="header">
                                <apex:commandLink action="{!sortByCaseOwner}" 
                                                  reRender="rest" status="ocstatus">Case Owner
                                </apex:commandLink>
                            </apex:facet>                            
                        </apex:column>                                                  
                        <apex:column headerValue="Rally ID" value="{!cr.Rally_ID__c}">
                            <apex:facet name="header">
                                <apex:commandLink action="{!sortByRallyID}" 
                                                  reRender="rest" status="ocstatus">Rally ID
                                </apex:commandLink>
                            </apex:facet>                               
                        </apex:column>
                        <apex:column headerValue="Rally Development Status" value="{!cr.RALLYSM__Development_Status__c}">
                            <apex:facet name="header" >
                                <apex:commandLink action="{!sortByRallyDS}" 
                                                  reRender="rest" status="ocstatus">Rally Development Status
                                </apex:commandLink>
                            </apex:facet>                            
                        </apex:column>                                                                                                                         
                    </apex:pageBlockTable>
                </apex:outputPanel> 
                <apex:outputPanel style="float:right;" id="bottompg">
                    <apex:commandButton value="<<Previous page" action="{!searchPreviousPageOffset}"   status="ocstatus" reRender="casesref,toppg" disabled="{!disablePreviousBtn}" style="color:#25729a">                    
                    </apex:commandButton>                                                  
                    <apex:commandButton value="Next page>>" action="{!searchNextPageOffset}"  status="ocstatus" reRender="casesref,toppg  " disabled="{!disableNextBtn}" style="color:#25729a">                    
                    </apex:commandButton>
                </apex:outputPanel>
            </apex:pageBlockSection>            
        </apex:form>        
    </apex:pageBlock>        
</apex:page>
 
public class CaseAssocInTriageController {
    public string rallyType {get;set;}
    public string AcctName {get;set;}
    public string caseStatus {get;set;}
    public string severity {get;set;}
    public Case caseAssoc {get; set;}
    
    public Integer nextPageOffset{get; set;}
    public Integer previousPageOffset{get; set;}
    public Integer currentPageOffset{get; set;}
    
    public boolean disableNextBtn{get{
        return nextPageOffset==0 ? true : ((Math.mod(nextPageOffset, 2) >0) ? true : false);
            }set;}
    
    
    public boolean disablePreviousBtn{get{     
        return  (currentPageOffset == 0 && previousPageOffset == 0) ? true : false;    
    } set;}    
    
    public void searchNextPageOffset()
    {
        currentPageOffset = nextPageOffset;
        if(Test.isRunningTest())
            currentPageOffset= 0;
        search();
    }
    
    public void searchPreviousPageOffset()
    {
        currentPageOffset = previousPageOffset;
        if(Test.isRunningTest())
            currentPageOffset= 0;
        search();
    }
    
    public boolean isRecordFound{get{
        return caseResults==null ? false : (caseResults.isEmpty() ? false : true);
            }set;}
    
    public Integer pagerecordCount{
        get
        {
            return caseResults==null ? 0 : (caseResults.isEmpty() ? 0 : caseResults.size());
                } 
        set;
    }
    
    public integer recordCount{get;set;}
    
    public String pageInfo{get{
        return 'Viewing (' + currentPageOffset + ' to ' + ((currentPageOffset + 2) >recordCount ? recordCount : (currentPageOffset + 2))  +') / ' + recordCount;
    }set;}
    
    public CaseAssocInTriageController(){
        if(AcctNames==null || AcctNames.isEmpty())        
            AcctNames = fetchAcctNames();     
        
        sortName = 'Owner.name';
        sortBy = 'ASC';
        ascdesvOwner=-1;
        ascdesvCAccount =-1;
        ascdesvCPriority=-1;
        ascdesvCStatus = -1;
        ascdesvRDS =-1;
        ascdesvRID =-1;
        
        nextPageOffset= 0;
        previousPageOffset = 0;
        currentPageOffset = 0;
        
    }
    
    public list<SelectOption> AcctNames {get;set;}    
    public list<SelectOption> fetchAcctNames(){
        list<SelectOption> AcctOptions = new list<SelectOption>();
        
        Integer reccount = Database.countQuery('select count() from account where type=\'customer\' ');
        
        decimal val = reccount/1000; 
        Integer loopCount = val.intValue() + (Math.mod(reccount,1000) > 0 ? 1 : 0);
        if(val==0)
            loopCount=1;
        
        system.debug('rec  : ' + reccount);
        system.debug('rec  : ' + val);
        system.debug('rec  : ' + loopCount);
        
        list<Account> acct = null;
        for(Integer index=0; index<loopCount; index++)
        {
            Integer offsetcount = index * 1000; 
            acct = [Select id,name from Account where type IN ('customer') limit 1000 OFFSET :offsetcount];
            if(acct != null || !acct.isEmpty()){
                AcctOptions.add(new SelectOption('All','All'));  
                for(Account acc: acct)
                    AcctOptions.add(new SelectOption(acc.Name,acc.Name));            
            }
        }
        return AcctOptions;
    } 
    
    public String sortName{get;set;}
    public String sortBy{get;set;}
    
    public Integer ascdesvOwner{get; set;}
    public void sortByCaseOwner()
    {
        sortName = 'Owner.name';
        ascdesvOwner = ascdesvOwner== -1  ? 0 : (ascdesvOwner== 1 ? 0 : 1); 
            sortBy = ascdesvOwner ==0 ? 'ASC' : 'DESC';  
        System.debug('ascdesvOwner : ' + ascdesvOwner);
        search();
    }
    
    public Integer ascdesvCStatus{get; set;}
    public void sortByCaseStatus()
    {
        sortName = 'Status';
        ascdesvCStatus = ascdesvCStatus== -1  ? 0 : (ascdesvCStatus== 1 ? 0 : 1); 
            sortBy = ascdesvCStatus ==0 ? 'ASC' : 'DESC';  
        System.debug('ascdesvCStatus : ' + ascdesvCStatus);
        search();
    }
    
    public Integer ascdesvCPriority{get; set;}
    public void sortByCasePriority()
    {
        sortName = 'Priority';
        ascdesvCPriority = ascdesvCPriority== -1  ? 0 : (ascdesvCPriority== 1 ? 0 : 1); 
            sortBy = ascdesvCPriority ==0 ? 'ASC' : 'DESC';  
        System.debug('ascdesvCPriority : ' + ascdesvCPriority);
        search();
    }
    
    public Integer ascdesvCAccount{get; set;}
    public void sortByCaseAccount()
    {
        sortName = 'Account.name';
        ascdesvCAccount = ascdesvCAccount== -1  ? 0 : (ascdesvCAccount== 1 ? 0 : 1); 
            sortBy = ascdesvCAccount ==0 ? 'ASC' : 'DESC';  
        System.debug('ascdesvCAccount : ' + ascdesvCAccount);
        search();
    }
    
    public Integer ascdesvRID{get; set;}
    public void sortByRallyID()
    {
        sortName = 'Rally_ID__c';
        ascdesvRID = ascdesvRID== -1  ? 0 : (ascdesvRID== 1 ? 0 : 1); 
            sortBy = ascdesvRID ==0 ? 'ASC' : 'DESC';  
        System.debug('ascdesvRID : ' + ascdesvRID);
        search();
    }
    
    public Integer ascdesvRDS{get; set;}
    public void sortByRallyDS()
    {
        sortName = 'RALLYSM__Development_Status__c';
        ascdesvRDS = ascdesvRDS== -1  ? 0 : (ascdesvRDS== 1 ? 0 : 1); 
            sortBy = ascdesvRDS ==0 ? 'ASC' : 'DESC';  
        System.debug('ascdesvRDS : ' + ascdesvRDS);
        search();
    }
    
    public List<Case> caseResults{get; set;}
    
    public list<Integer> pageOffsets{get; set;} 
    
       
    
    public void search(){
        
        system.debug('offsetCount :: ' + currentPageOffset);
                        
        if(caseStatus=='Open' && AcctName=='All')
        {
            caseResults = Database.query(
                'SELECT id,casenumber,subject,Owner.name,account.name,status,priority,Rally_ID__c,RALLYSM__Development_Status__c,Date_Swap_Triage_New__c,Severity__c,CaseHourCalc__c,DateTime_Swaped_In_Triage__c '+
                'FROM Case where Date_Swap_Triage_New__c !=null and status!=\'Closed\' '+
                'ORDER BY ' + sortname + ' ' + sortBy + ' ' +
                'limit 2 OFFSET ' + currentPageOffset
            );
            if(caseResults!=null && !caseResults.isEmpty())
            {
                recordCount = Database.countQuery(
                    'SELECT count() '+
                    'FROM Case where  Date_Swap_Triage_New__c !=null and status!=\'Closed\' '
                );                
            }
        }
        
        if(caseStatus=='Closed'  && AcctName=='All')
        {
            caseResults = Database.query(
                'SELECT id,casenumber,subject,Owner.name,account.name,status,priority,Rally_ID__c,RALLYSM__Development_Status__c,Date_Swap_Triage_New__c,Severity__c,CaseHourCalc__c,DateTime_Swaped_In_Triage__c '+
                'FROM Case where Date_Swap_Triage_New__c !=null and  status=\'Closed\' '+
                'ORDER BY ' + sortname + ' ' + sortBy + ' ' +
                'limit 2 OFFSET ' + currentPageOffset
            );        
            if(caseResults!=null && !caseResults.isEmpty())
            {
                recordCount = Database.countQuery(
                    'SELECT count() '+
                    'FROM Case where  Date_Swap_Triage_New__c !=null and  status=\'Closed\' '
                );                
            }
        }                                
        
        if(caseStatus=='Open'  && AcctName!='All')
        {
            caseResults = Database.query(
                'SELECT id,casenumber,subject,Owner.name,account.name,status,priority,Rally_ID__c,RALLYSM__Development_Status__c,Date_Swap_Triage_New__c,Severity__c,CaseHourCalc__c,DateTime_Swaped_In_Triage__c '+
                'FROM Case where Date_Swap_Triage_New__c !=null and status!=\'Closed\' and account.name=\''+ AcctName + '\' ' +
                'ORDER BY ' + sortname + ' ' + sortBy + ' ' +
                'limit 2 OFFSET ' + currentPageOffset
            );
            
            if(caseResults!=null && !caseResults.isEmpty())
            {
                recordCount = Database.countQuery(
                    'SELECT count() '+
                    'FROM Case where  Date_Swap_Triage_New__c !=null and  status!=\'Closed\' and account.name=\''+ AcctName + '\' '
                );                
            }                
        }
        
        if(caseStatus=='Closed'  && AcctName!='All')
        {
            caseResults = Database.query(
                'SELECT id,casenumber,subject,Owner.name,account.name,status,priority,Rally_ID__c,RALLYSM__Development_Status__c,Date_Swap_Triage_New__c,Severity__c,CaseHourCalc__c,DateTime_Swaped_In_Triage__c '+
                'FROM Case where Date_Swap_Triage_New__c !=null and status=\'Closed\' and account.name=\''+ AcctName + '\' ' +
                'ORDER BY ' + sortname + ' ' + sortBy + ' ' +
                'limit 2 OFFSET ' + currentPageOffset
            );
            if(caseResults!=null && !caseResults.isEmpty())
            {
                recordCount = Database.countQuery(
                    'SELECT count() '+
                    'FROM Case where  Date_Swap_Triage_New__c !=null and  status=\'Closed\' and account.name=\''+ AcctName + '\' '
                );                
            } 
              
        }                
        
        previousPageOffset = (currentPageOffset==0) ? 0 : (currentPageOffset -2);
            nextPageOffset = ((currentPageOffset + 2) > recordCount) ? (currentPageOffset + (Math.mod(recordCount, 2))) : (currentPageOffset + 2) ;
                System.debug('previousPageOffset : ' + previousPageOffset);        
        System.debug('nextPageOffset : ' + nextPageOffset);  
              
        
    }
   
}


 
Hello Team, 

As i was researching here i was able to find Schedule or Batch  for attaching one report doc and sending mail to the user., However my requirement is How to get all reports in one Excel Attachment and send a mail to the user.

"This is my Code now im stuck with what i shoud do in the Execute to get all the reports in one excel attachment"
 
global class ScheduleBatchReports implements Database.batchable<sObject>
{

    global Database.QueryLocator start(Database.BatchableContext BC)
    {
         
        String crpt = 'SELECT Name FROM Report';
        return Database.getQueryLocator(crpt);
    }
   
    global void execute(Database.BatchableContext BC, List<Report> scope)
    {
        for(Report r : scope){} 
        
        
             }    
   
    global void finish(Database.BatchableContext BC)
    {
    }
   
}

Guys please assist me, ASAP.

Thanks in Advance.
Hi ,

Can anybody help me with Remedy fore integration in Salesforce for incident management.
What are the procedure.
how Data loader will be used here.
Will workflows and triggers will be used, Since it is a managed App for ticketing tool
Can any one tell me how to view the Source code of this below page

VF coding and Apex class 

http://support.catalinamarketing.com/apex/GasCoupon
/-- Below is my Visual force page coding.

<apex:page Controller="CreateAccount" >

<head>
  <meta charset="utf-8"/>
  <title>jQuery UI Datepicker - Default functionality</title>
  <link rel="stylesheet" href="//code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css"/>
  <script src="//code.jquery.com/jquery-1.10.2.js"></script>
  <script src="//code.jquery.com/ui/1.11.4/jquery-ui.js"></script>
  <link rel="stylesheet" href="/resources/demos/style.css"/>

  <script>
  $(function() {
    $( "#datepicker" ).datepicker();
  });
  </script>
</head>
<body>
 

 
</body>

<apex:stylesheet value="http://www.pageresource.com/wallpapers/wallpaper/latest-google-hd.jpg"/>
 <apex:form id="form">
 <div align="center" draggable="false" >
 <apex:image url="http://googlezone.ru/wp-content/uploads/2014/11/101020141429292562322.jpg" width="120" height="50"/>
 </div>
 <apex:pageBlock title="Create your Google Account" mode="edit"  id="pgblock"> 
 <apex:pageBlockSection >
 
 Firstname <apex:inputtext value="{!Firstname}"/>
 Lastname <apex:inputtext value="{!Lastname}"/>
 Username <apex:inputtext value="{!Username}"/>
 Password <apex:inputtext value="{!Password}"/>
 Retypepassword <apex:inputtext value="{!Retypepassword}"/>
 MobilePhone <apex:inputtext value="{!MobilePhone}"/>
 Email <apex:inputtext value="{!Email}"/>
 DateOfBirth <input type="text"  id="datepicker"/>
 </apex:pageBlockSection>
 <apex:commandButton action="{!saveRecord}" style="float:centre" styleClass="button" value="Save" id="recordID"  />
 </apex:pageBlock>
 </apex:form>
</apex:page>


Apex Class

public with sharing class CreateAccount {

    public PageReference saveRecord() {
       
 GoogleBlog__c blog = new GoogleBlog__c();
    blog.FirstName__c= Firstname;
    blog.Lastname__c= Lastname;
    blog.Password__c= Password;
    blog.RetypePassword__c= Retypepassword;
    blog.Username__c= Username;
    blog.MobilePhone__c= MobilePhone;
    blog.Email__c= Email;
    Date.valueOf(DateOfBirth);
    insert blog;
    system.debug('!!!!!!!!!!' + blog);
  return null;
  
    }

    public String getContact() {
        return null;
    }


Public string Firstname {get;set;}
Public string Lastname {get;set;}
Public string Username {get;set;}
Public string Password {get;set;}
Public string Retypepassword {get;set;}
Public string MobilePhone {get;set;}
Public string Email {get;set;}
Public string DateOfBirth {get;set;}
}

When i try to save a Recod it throws me error like this, Can anyone suggest me what is the mistake in thisERROR
/-- Below is my Visual force page coding.

<apex:page Controller="CreateAccount" >

<head>
  <meta charset="utf-8"/>
  <title>jQuery UI Datepicker - Default functionality</title>
  <link rel="stylesheet" href="//code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css"/>
  <script src="//code.jquery.com/jquery-1.10.2.js"></script>
  <script src="//code.jquery.com/ui/1.11.4/jquery-ui.js"></script>
  <link rel="stylesheet" href="/resources/demos/style.css"/>

  <script>
  $(function() {
    $( "#datepicker" ).datepicker();
  });
  </script>
</head>
<body>
 

 
</body>

<apex:stylesheet value="http://www.pageresource.com/wallpapers/wallpaper/latest-google-hd.jpg"/>
 <apex:form id="form">
 <div align="center" draggable="false" >
 <apex:image url="http://googlezone.ru/wp-content/uploads/2014/11/101020141429292562322.jpg" width="120" height="50"/>
 </div>
 <apex:pageBlock title="Create your Google Account" mode="edit"  id="pgblock"> 
 <apex:pageBlockSection >
 
 Firstname <apex:inputtext value="{!Firstname}"/>
 Lastname <apex:inputtext value="{!Lastname}"/>
 Username <apex:inputtext value="{!Username}"/>
 Password <apex:inputtext value="{!Password}"/>
 Retypepassword <apex:inputtext value="{!Retypepassword}"/>
 MobilePhone <apex:inputtext value="{!MobilePhone}"/>
 Email <apex:inputtext value="{!Email}"/>
 DateOfBirth <input type="text"  id="datepicker"/>
 </apex:pageBlockSection>
 <apex:commandButton action="{!saveRecord}" style="float:centre" styleClass="button" value="Save" id="recordID"  />
 </apex:pageBlock>
 </apex:form>
</apex:page>


Apex Class

public with sharing class CreateAccount {

    public PageReference saveRecord() {
       
 GoogleBlog__c blog = new GoogleBlog__c();
    blog.FirstName__c= Firstname;
    blog.Lastname__c= Lastname;
    blog.Password__c= Password;
    blog.RetypePassword__c= Retypepassword;
    blog.Username__c= Username;
    blog.MobilePhone__c= MobilePhone;
    blog.Email__c= Email;
    Date.valueOf(DateOfBirth);
    insert blog;
    system.debug('!!!!!!!!!!' + blog);
  return null;
  
    }

    public String getContact() {
        return null;
    }


Public string Firstname {get;set;}
Public string Lastname {get;set;}
Public string Username {get;set;}
Public string Password {get;set;}
Public string Retypepassword {get;set;}
Public string MobilePhone {get;set;}
Public string Email {get;set;}
Public string DateOfBirth {get;set;}
}

When i try to save a Recod it throws me error like this, Can anyone suggest me what is the mistake in this
ERROR :
Visualforce ErrorHelp for this Page
System.NullPointerException: Argument cannot be null.
Error is in expression '{!saveRecord}' in component <apex:commandButton> in page createaccount: Class.CreateAccount.saveRecord: line 13, column 1
Class.CreateAccount.saveRecord: line 13, column 1
/-- Below is my Visual force page coding.

<apex:page Controller="CreateAccount" >

<head>
  <meta charset="utf-8"/>
  <title>jQuery UI Datepicker - Default functionality</title>
  <link rel="stylesheet" href="//code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css"/>
  <script src="//code.jquery.com/jquery-1.10.2.js"></script>
  <script src="//code.jquery.com/ui/1.11.4/jquery-ui.js"></script>
  <link rel="stylesheet" href="/resources/demos/style.css"/>

  <script>
  $(function() {
    $( "#datepicker" ).datepicker();
  });
  </script>
</head>
<body>
 

 
</body>

<apex:stylesheet value="http://www.pageresource.com/wallpapers/wallpaper/latest-google-hd.jpg"/>
 <apex:form id="form">
 <div align="center" draggable="false" >
 <apex:image url="http://googlezone.ru/wp-content/uploads/2014/11/101020141429292562322.jpg" width="120" height="50"/>
 </div>
 <apex:pageBlock title="Create your Google Account" mode="edit"  id="pgblock"> 
 <apex:pageBlockSection >
 
 Firstname <apex:inputtext value="{!Firstname}"/>
 Lastname <apex:inputtext value="{!Lastname}"/>
 Username <apex:inputtext value="{!Username}"/>
 Password <apex:inputtext value="{!Password}"/>
 Retypepassword <apex:inputtext value="{!Retypepassword}"/>
 MobilePhone <apex:inputtext value="{!MobilePhone}"/>
 Email <apex:inputtext value="{!Email}"/>
 DateOfBirth <input type="text"  id="datepicker"/>
 </apex:pageBlockSection>
 <apex:commandButton action="{!saveRecord}" style="float:centre" styleClass="button" value="Save" id="recordID"  />
 </apex:pageBlock>
 </apex:form>
</apex:page>


Apex Class

public with sharing class CreateAccount {

    public PageReference saveRecord() {
       
 GoogleBlog__c blog = new GoogleBlog__c();
    blog.FirstName__c= Firstname;
    blog.Lastname__c= Lastname;
    blog.Password__c= Password;
    blog.RetypePassword__c= Retypepassword;
    blog.Username__c= Username;
    blog.MobilePhone__c= MobilePhone;
    blog.Email__c= Email;
    Date.valueOf(DateOfBirth);
    insert blog;
    system.debug('!!!!!!!!!!' + blog);
  return null;
  
    }

    public String getContact() {
        return null;
    }


Public string Firstname {get;set;}
Public string Lastname {get;set;}
Public string Username {get;set;}
Public string Password {get;set;}
Public string Retypepassword {get;set;}
Public string MobilePhone {get;set;}
Public string Email {get;set;}
Public string DateOfBirth {get;set;}
}

When i try to save a Recod it throws me error like this, Can anyone suggest me what is the mistake in this
ERROR :
Visualforce ErrorHelp for this Page
System.NullPointerException: Argument cannot be null.
Error is in expression '{!saveRecord}' in component <apex:commandButton> in page createaccount: Class.CreateAccount.saveRecord: line 13, column 1
Class.CreateAccount.saveRecord: line 13, column 1
Hi ,

Can anybody help me with Remedy fore integration in Salesforce for incident management.
What are the procedure.
how Data loader will be used here.
Will workflows and triggers will be used, Since it is a managed App for ticketing tool
/-- Below is my Visual force page coding.

<apex:page Controller="CreateAccount" >

<head>
  <meta charset="utf-8"/>
  <title>jQuery UI Datepicker - Default functionality</title>
  <link rel="stylesheet" href="//code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css"/>
  <script src="//code.jquery.com/jquery-1.10.2.js"></script>
  <script src="//code.jquery.com/ui/1.11.4/jquery-ui.js"></script>
  <link rel="stylesheet" href="/resources/demos/style.css"/>

  <script>
  $(function() {
    $( "#datepicker" ).datepicker();
  });
  </script>
</head>
<body>
 

 
</body>

<apex:stylesheet value="http://www.pageresource.com/wallpapers/wallpaper/latest-google-hd.jpg"/>
 <apex:form id="form">
 <div align="center" draggable="false" >
 <apex:image url="http://googlezone.ru/wp-content/uploads/2014/11/101020141429292562322.jpg" width="120" height="50"/>
 </div>
 <apex:pageBlock title="Create your Google Account" mode="edit"  id="pgblock"> 
 <apex:pageBlockSection >
 
 Firstname <apex:inputtext value="{!Firstname}"/>
 Lastname <apex:inputtext value="{!Lastname}"/>
 Username <apex:inputtext value="{!Username}"/>
 Password <apex:inputtext value="{!Password}"/>
 Retypepassword <apex:inputtext value="{!Retypepassword}"/>
 MobilePhone <apex:inputtext value="{!MobilePhone}"/>
 Email <apex:inputtext value="{!Email}"/>
 DateOfBirth <input type="text"  id="datepicker"/>
 </apex:pageBlockSection>
 <apex:commandButton action="{!saveRecord}" style="float:centre" styleClass="button" value="Save" id="recordID"  />
 </apex:pageBlock>
 </apex:form>
</apex:page>


Apex Class

public with sharing class CreateAccount {

    public PageReference saveRecord() {
       
 GoogleBlog__c blog = new GoogleBlog__c();
    blog.FirstName__c= Firstname;
    blog.Lastname__c= Lastname;
    blog.Password__c= Password;
    blog.RetypePassword__c= Retypepassword;
    blog.Username__c= Username;
    blog.MobilePhone__c= MobilePhone;
    blog.Email__c= Email;
    Date.valueOf(DateOfBirth);
    insert blog;
    system.debug('!!!!!!!!!!' + blog);
  return null;
  
    }

    public String getContact() {
        return null;
    }


Public string Firstname {get;set;}
Public string Lastname {get;set;}
Public string Username {get;set;}
Public string Password {get;set;}
Public string Retypepassword {get;set;}
Public string MobilePhone {get;set;}
Public string Email {get;set;}
Public string DateOfBirth {get;set;}
}

When i try to save a Recod it throws me error like this, Can anyone suggest me what is the mistake in thisERROR

 

 I get the following Error when i try to save this

 

Error: Compile Error: unexpected token: 'List' at line 4 column 4

 

 

public class createoriginalfcst {

    public static List<SMART_Product__c>ActiveSKUs  {
    List<SMART_Product__c>ActiveSKUs=[SELECT Name FROM SMART_Product__c WHERE Product_Status__c='Active']
    }


}

 

 

 

Kindly help