• Alberto OM
  • NEWBIE
  • 0 Points
  • Member since 2015
  • Salesforce Technical Consultant


  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 6
    Replies
Hi
I'm new to salesforce.
Can anyone help in writing the test class.
global class tridentUpdateOverduePGLWebService
{    
    webservice static SFAResponse updateOverdue(Overdue_element[] OverdueRec) 
    {       
        //HttpRequest req = new HttpRequest();   
        //req.setHeader('Content-Type','application/x-www-form-urlencoded');
        SFAResponse objResponse = new SFAResponse();
        Exceptions__c excep = new Exceptions__c();                          // to capture web service failure exceptions.
        list<OverDue_PGL__c> OverdueLst = new list<OverDue_PGL__c>{};
        
    for (Integer i=0; i<OverdueRec.size();i++)
    {
        OverDue_PGL__c OverDueObj= new OverDue_PGL__c();
        
        OverDueObj.CustomerName_name1_new__c= OverdueRec[i].CustomerName_name1_new;
        OverDueObj.Total_Outstanding_INR_DMBTR_new__c = OverdueRec[i].Total_Outstanding_INR_DMBTR_new;
        OverDueObj.Payment_Term_Zterm_new__c = OverdueRec[i].Payment_Term_Zterm_new;
        OverDueObj.Overdue_Amount_INR_ovr_amt_new__c = OverdueRec[i].Overdue_Amount_INR_ovr_amt_new;
        OverDueObj.Ageing_Days_days_new__c = OverdueRec[i].Ageing_Days_days_new;      
        OverDueObj.Excise_Invoice_exnum_new__c = OverdueRec[i].Excise_Invoice_exnum_new;      
        OverDueObj.Item_Text_sgtxt_new__c = OverdueRec[i].Item_Text_sgtxt_new;
                              
        OverdueLst.add(OverDueObj);
        system.debug('Values taken');
  }

    if (Overduelst.size()>0)
    {                     
        try
            {
                insert OverdueLst;                
                objResponse.Status = true;
                objResponse.Description = 'Record Updated';
                system.debug('Record Updated');     
            }    
       catch(exception e)
            {
                system.debug('Error');
                excep.Record_Id__c = OverdueLst[0].CustomerName_name1_new__c;
                excep.error__c = e.getmessage();
                insert excep;
                
              //objResponse.SFDCId = OverdueLst.CustName;
                objResponse.Status = false;
                objResponse.Description = e.getmessage();
            }
     }
     else
     {        
      objResponse.Status = false;
      objResponse.Description ='No Item found to update';
      system.debug('Record not Updated');
     }
   return objResponse;                                                  // this will return result.
   }
        global class Overdue_element
      {
        webservice string CustomerName_name1_new;
        webservice string Total_Outstanding_INR_DMBTR_new;
        webservice string Payment_Term_Zterm_new;
        webservice string Overdue_Amount_INR_ovr_amt_new;
        webservice string Ageing_Days_days_new;
        webservice string Excise_Invoice_exnum_new;
        webservice string Item_Text_sgtxt_new;
    }
     global class SFAResponse
    {
      //webservice Id SFDCId;       
        webservice Boolean Status; 
        webservice String Description;
    }
}

need urgently.
Please guide and help
Hi,

text field and search button in account. 

I wanna get some results based on which i enter the text in the field in account object from google and display in my account page.

for example if I entered the hotel name it should show the hotels near by Account holder address.

Actually I planning to designing the vf page and add it to the account page layout for showing results.

but I don't know how to make a outbound integration with google.