• Chermadurai
  • NEWBIE
  • 0 Points
  • Member since 2012

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 17
    Questions
  • 32
    Replies

Hello..

 

Is there any update for System.RunAs in Summer 13.

 

My testcase runs successful in Sandbox. but getting error in Production..

 

System.TypeException:System.RunAs can only be used with an active user

Hello..

 

The page wizard contains 4 page. in first page,When i select radio boutton and moved to next page ,Now i need to go previous page again,So i clicked previous button and return to first page but the Radiobutton have nt selected which i clicked...

 

Plz help..

Hi All,

 

I got a certification from my Admin, Now where i can add the Certificate in Salesforce for accessing External Webservice..

Hi All,

 

I got a certification from my Admin, Now where i can add the Certificate in Salesforce for accessing External Webservice..

Hi..

 

When i press enter key in text box, it does not performing its operation and doing the command button action..how can i solve this...

Dear All,

 

I have WSDL file, now i need to call few functions on this..wat i need to do now..

 

i tried like this:

 

The WSDL file is:

 

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:tns="http://192.168.0.61:8080/RFCServer/REST/WebService/GetFeeds"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="WSDLRFC"
targetNamespace="http://192.168.0.61:8080/RFCServer/REST/WebService/GetFeeds">
<wsdl:types>
<xsd:schema targetNamespace="http://192.168.0.61:8080/RFCServer/REST/WebService/GetFeeds">
<xsd:element name="NewOperation">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="in" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="NewOperationResponse">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="out" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>
</wsdl:types>
<wsdl:message name="NewOperationRequest">
<wsdl:part element="tns:NewOperation" name="parameters"/>
</wsdl:message>
<wsdl:message name="NewOperationResponse">
<wsdl:part element="tns:NewOperationResponse" name="parameters"/>
</wsdl:message>
<wsdl:portType name="WSDLRFC">
<wsdl:operation name="NewOperation">
<wsdl:input message="tns:NewOperationRequest"/>
<wsdl:output message="tns:NewOperationResponse"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="WSDLRFCSOAP" type="tns:WSDLRFC">
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="NewOperation">
<soap:operation soapAction="http://192.168.0.61:8080/RFCServer/REST/WebService/GetFeeds"/>
<wsdl:input>
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="WSDLRFC">
<wsdl:port binding="tns:WSDLRFCSOAP" name="WSDLRFCSOAP">
<soap:address location="http://www.example.org/"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>

 

Now,

 

Setup|Develop|Apex Class| Generate from WSDL | 

 

The following compile Error is occur:

 

//Generated by wsdl2apex

public class WebservicefromJava {
public class NewOperation_element {
public String in;
private String[] in_type_info = new String[]{'in','http://www.w3.org/2001/XMLSchema','string','1','1','false'};
private String[] apex_schema_type_info = new String[]{'http://192.168.0.61:8080/RFCServer/REST/WebService/GetFeeds','false','false'};
private String[] field_order_type_info = new String[]{'in'};
}
public class NewOperationResponse_element {
public String out;
private String[] out_type_info = new String[]{'out','http://www.w3.org/2001/XMLSchema','string','1','1','false'};
private String[] apex_schema_type_info = new String[]{'http://192.168.0.61:8080/RFCServer/REST/WebService/GetFeeds','false','false'};
private String[] field_order_type_info = new String[]{'out'};
}
public class WSDLRFCSOAP {
public String endpoint_x = 'http://www.example.org/';
public Map<String,String> inputHttpHeaders_x;
public Map<String,String> outputHttpHeaders_x;
public String clientCertName_x;
public String clientCert_x;
public String clientCertPasswd_x;
public Integer timeout_x;
private String[] ns_map_type_info = new String[]{'http://192.168.0.61:8080/RFCServer/REST/WebService/GetFeeds', 'WebservicefromJava'};
public String NewOperation(String in) {
WebservicefromJava.NewOperation_element request_x = new WebservicefromJava.NewOperation_element();
WebservicefromJava.NewOperationResponse_element response_x;
request_x.in = in;
Map<String, WebservicefromJava.NewOperationResponse_element> response_map_x = new Map<String, WebservicefromJava.NewOperationResponse_element>();
response_map_x.put('response_x', response_x);
WebServiceCallout.invoke(
this,
request_x,
response_map_x,
new String[]{endpoint_x,
'http://192.168.0.61:8080/RFCServer/REST/WebService/GetFeeds/NewOperation',
'http://192.168.0.61:8080/RFCServer/REST/WebService/GetFeeds',
'NewOperation',
'http://192.168.0.61:8080/RFCServer/REST/WebService/GetFeeds',
'NewOperationResponse',
'WebservicefromJava.NewOperationResponse_element'}
);
response_x = response_map_x.get('response_x');
return response_x.out;
}
}
}

 

Now Error Messge is:

The following generated class(es) have compilation errors:
Error: FeedService
Error: unexpected token: 'in' at 5:22

 

THanx in Advance..

Dear All,

 

I need to get the currently selected  view (Ex: Now picklist selected "All Open Leads")records in Leads. Using SOQL..

 

THanks in Advance..

My Class is:

 

global class FBR_ApexSchedulerMonthlyClass Implements Schedulable
{
global void execute(SchedulableContext sc)
{
ValAdd();
}
public static void ValAdd()//Set<Id> InquiryId
{

List<FBR_Inquiry__c> Inquiry= [SELECT KPIInquiryContent__c,KPIInquiryContent__r.Account__c,CommodityName__c,ModifyDate__c,Status__c from FBR_Inquiry__c ];
{
FBR_Inquiry__c FBR= Inquiry[0];
Date startDate=FBR.ModifyDate__c.toStartOfMonth();
Date endDate=FBR.ModifyDate__c.toStartOfMonth().addMonths(1);

LIST<AggregateResult> countmonth=[SELECT count(KPIInquiryContent__c) coun from FBR_Inquiry__c where KPIInquiryContent__r.Account__c=:FBR.KPIInquiryContent__r.Account__c and ModifyDate__c >= :startDate AND ModifyDate__c < :endDate and PayoffObject__c=:'○' and Status__c IN('対応中' ,'対応完了')];
//LIST<AggregateResult> calmonth=[Select CALENDAR_MONTH(WorkDate__c), count(ImportCount__c) icount from WorkResultsMonth__c where Account_Name__c=:acname GROUP BY CALENDAR_MONTH(WorkDate__c)];
LIST<AggregateResult> calmonth=[Select sum(ImportCount__c) icount from WorkResultsMonth__c where WorkDate__c >= :startDate and WorkDate__c < :endDate and Account_Name__c=:FBR.KPIInquiryContent__r.Account__c and name='dfjg'];

List<KPIAccident__c> acc= [SELECT MonthlyGeneratedCount__c,MonthlyPPM__c from KPIAccident__c where Account__c=:FBR.KPIInquiryContent__r.Account__c];
if(!acc.isEmpty() )
{

KPIAccident__c accupdate = acc[0];
double totalcountmonth=double.Valueof(countmonth[0].get('coun'));

accupdate.MonthlyGeneratedCount__c=totalcountmonth;

double totalmonthwork= double.Valueof(calmonth[0].get('icount'));
accupdate.MonthlyPPM__c=(totalcountmonth/totalmonthwork)*1000000;
update accupdate;
}
else
{
KPIAccident__c kpi = new KPIAccident__c();
List<KPIAccident__c> ToUpdate = new List<KPIAccident__c>();
// kpi.Date__c=FBR.ModifyDate__c;
kpi.Account__c=FBR.KPIInquiryContent__r.Account__c;
// kpi.itemname__c= FBR.CommodityName__c;

double totalcountmonths=double.Valueof(countmonth[0].get('coun'));
kpi.MonthlyGeneratedCount__c=totalcountmonths;
double totalmonthworks= double.Valueof(calmonth[0].get('icount'));

kpi.MonthlyPPM__c=(totalcountmonths/totalmonthworks)*1000000;
ToUpdate.add(kpi);
insert ToUpdate;

}
/
}
} }

 

 

My Test Case  is:

 

@isTest(SeeAllData=true)
class FBR_ApexScheduleMonthClassTest {
static testMethod void myUnitTest() {
test.startTest();
// FBR_ApexSchedulerMonthlyClass.valadd();
account a = new account();
a.name='saaa';
insert a;
KPI_StoreInquiryStatus__c a3 = new KPI_StoreInquiryStatus__c(Account__c=a.id,name='asdf');
insert a3;
KPIInquiryStatus__c a4 = new KPIInquiryStatus__c();
a4.Account__c=a.id;
insert a4;

FBR_Inquiry__c fi=new FBR_Inquiry__c();

fi.KPIInquiryContent__c=a3.id;
fi.KpiInquiryRef__c=a4.id;
fi.CommodityName__c='fgggggj';
fi.ModifyDate__c=date.parse('2012/10/10');
fi.Status__c ='hkjcyh';
insert fi;


Double tot=0;
//WorkResultsMonth__c wk= new WorkResultsMonth__c (Account_Name__c=a.id, WorkDate__c = System.today());
// insert wk;
// LIST<AggregateResult> calmonth=[SELECT sum(ImportCount__c) from WorkResultsMonth__c where WorkDate__c = TODAY and Account_Name__c= :a.id] ;
WorkResultsMonth__c wk=new WorkResultsMonth__c();
wk.WorkDate__c =date.parse('2012/10/10');
wk.Account_Name__c=a.id;
wk.ImportCount__c=10;
insert wk;

List<KPIAccident__c> acc= new List<KPIAccident__c>();
acc=[SELECT MonthlyGeneratedCount__c,MonthlyPPM__c from KPIAccident__c where Account__c=:a.id];

KPIAccident__c kpi = new KPIAccident__c();
kpi.MonthlyGeneratedCount__c=tot;
kpi.MonthlyPPM__c=456;
acc.add(kpi);

List<KPIAccident__c> acc2= new List<KPIAccident__c>();
KPIAccident__c kpi2 = new KPIAccident__c();
kpi2.Account__c=a.id;
kpi2.MonthlyGeneratedCount__c=tot;
kpi2.MonthlyPPM__c=147;
acc.add(kpi2); 
insert acc;
 update acc2;


FBR_ApexSchedulerMonthlyClass Updates = new FBR_ApexSchedulerMonthlyClass();
String schedule = '0 0 19 * * ?';
system.schedule('Nightly Update', schedule, Updates );


test.stopTest();
}
}

 

 

The Else Part doesnt covered in test case..

 

Hello,

 

 

global class ApexScheduledClass Implements Schedulable
            {
                       global void execute(SchedulableContext sc)
                        {
                                    ValAdd();
                        }
 public  static void ValAdd()
  { 
 
List<FBR_Inquiry__c> Inquiry= [SELECT KPIInquiryContent__c,KPIInquiryContent__r.Account__c,CommodityName__c,ModifyDate__c,Status__c from FBR_Inquiry__c  ];
{
FBR_Inquiry__c FBR= Inquiry[0];
Date startDate=FBR.ModifyDate__c.toStartOfMonth();
Date endDate=FBR.ModifyDate__c.toStartOfMonth().addMonths(1);

LIST<AggregateResult> countmonth=[SELECT count(KPIInquiryContent__c) coun from FBR_Inquiry__c where KPIInquiryContent__r.Account__c=:FBR.KPIInquiryContent__r.Account__c and ModifyDate__c >= :startDate AND ModifyDate__c < :endDate and PayoffObject__c=:'○' and Status__c IN('dry' ,'dfjgfj')];

LIST<AggregateResult> calmonth=[Select count(ImportCount__c) icount from WorkResultsMonth__c where WorkDate__c >= :startDate and WorkDate__c < :endDate and Account_Name__c=:FBR.KPIInquiryContent__r.Account__c];

List<KPIAccident__c> acc= [SELECT Date__c,MonthlyGeneratedCount__c,MonthlyPPM__c from KPIAccident__c where  Account_Name__c=:FBR.KPIInquiryContent__r.Account__c and Date__c >= :startDate and Date__c < :endDate];
if(!acc.isEmpty() )
      {
         
          KPIAccident__c accupdate = acc[0];        
          Integer totalcountmonth=Integer.Valueof(countmonth[0].get('coun'));
         
          accupdate.MonthlyGeneratedCount__c=totalcountmonth;  
        
          Integer totalmonthwork= Integer.Valueof(calmonth[0].get('icount'));
          accupdate.MonthlyPPM__c=((totalmonthwork/totalcountmonth)*1000000);
          update accupdate;
      }else
      {
         KPIAccident__c kpi = new KPIAccident__c();
         List<KPIAccident__c> ToUpdate = new List<KPIAccident__c>();
         kpi.Date__c=FBR.ModifyDate__c;        
          kpi.Account__c=FBR.KPIInquiryContent__r.Account__c;        
         kpi.itemname__c= FBR.CommodityName__c;    
        
         Integer totalcountmonths=Integer.Valueof(countmonth[0].get('coun'));
         kpi.MonthlyGeneratedCount__c=totalcountmonths;
         Integer totalmonthworks= Integer.Valueof(calmonth[0].get('icount'));
                   
         kpi.MonthlyPPM__c=((totalmonthworks/totalcountmonths)*1000000);
         ToUpdate.add(kpi);
         insert ToUpdate;

}
}
} }

 

Above is my class, After save this go to Setup->Develop->Apex Classes then clicking on the ‘Schedule Apex’ button. and scheduled my class to run monthly but it doesn't get  start..

 

Is there any wrong what i did,, Please help me solve this

Hello,

 

Here is my code how can i schedule this monthly.. Please help me..

 

 

 

global class FBR_InquiryMonthly{

 

    public  static void ValAdd(Set<Id> InquiryId)
  { 
 
List<FBR_Inquiry__c> Inquiry= [SELECT KPIInquiryContent__c,KPIInquiryContent__r.Account__c,CommodityName__c,ModifyDate__c,Status__c from FBR_Inquiry__c  where Id =:InquiryId];
{
FBR_Inquiry__c FBR= Inquiry[0];
Date startDate=FBR.ModifyDate__c.toStartOfMonth();
Date endDate=FBR.ModifyDate__c.toStartOfMonth().addMonths(1);

 

LIST<AggregateResult> countmonth=[SELECT count(KPIInquiryContent__c) coun from FBR_Inquiry__c where KPIInquiryContent__r.Account__c=:FBR.KPIInquiryContent__r.Account__c and ModifyDate__c >= :startDate AND ModifyDate__c < :endDate and PayoffObject__c=:'○' and Status__c IN('ftyti ,'vinjk')];
 
LIST<AggregateResult> calmonth=[Select count(ImportCount__c) icount from WorkResultsMonth__c where WorkDate__c >= :startDate and WorkDate__c < :endDate and Account_Name__c=:FBR.KPIInquiryContent__r.Account__c];

 

 

List<KPIAccident__c> acc= [SELECT Date__c,MonthlyGeneratedCount__c,MonthlyPPM__c from KPIAccident__c where  Account_Name__c=:FBR.KPIInquiryContent__r.Account__c and Date__c >= :startDate and Date__c < :endDate];    
if(!acc.isEmpty() )
      {
         
          KPIAccident__c accupdate = acc[0];        
          Integer totalcountmonth=Integer.Valueof(countmonth[0].get('coun'));
         
          accupdate.MonthlyGeneratedCount__c=totalcountmonth;  
        
          Integer totalmonthwork= Integer.Valueof(calmonth[0].get('icount'));
          accupdate.MonthlyPPM__c=((totalmonthwork/totalcountmonth)*1000000);
          update accupdate;
      }else
      {
         KPIAccident__c kpi = new KPIAccident__c();
         List<KPIAccident__c> ToUpdate = new List<KPIAccident__c>();
         kpi.Date__c=FBR.ModifyDate__c;        
          kpi.Account__c=FBR.KPIInquiryContent__r.Account__c;        
         kpi.itemname__c= FBR.CommodityName__c;      
         Integer totalcountmonths=Integer.Valueof(countmonth[0].get('coun'));
         kpi.MonthlyGeneratedCount__c=totalcountmonths;
         Integer totalmonthworks= Integer.Valueof(calmonth[0].get('icount'));
                   
         kpi.MonthlyPPM__c=((totalmonthworks/totalcountmonths)*1000000);
         ToUpdate.add(kpi);
         insert ToUpdate;

 

}
}
 }}

 

Hello..

 

There is problem in using Aggregate function, but i dont know whats wrong in this please help me..

 

But it save with out any error

 

public class FBR_InquiryMonthly{

  @future   public  static void ValAdd(Set<Id> InquiryId) {  integer total;     

string accountname;     

List<FBR_Inquiry__c> Inquiry= [SELECT KPIInquiryContent__c,KPIInquiryContent__r.Account__c,CommodityName__c,ModifyDate__c,Status__c from FBR_Inquiry__c where Id =:InquiryId];

FBR_Inquiry__c FBR= Inquiry[0]; Date startDate=FBR.ModifyDate__c.toStartOfMonth();

Date endDate=FBR.ModifyDate__c.toStartOfMonth().addMonths(1);

LIST<AggregateResult> countmonth=[SELECT count(KPIInquiryContent__c) coun from FBR_Inquiry__c where KPIInquiryContent__r.Account__c=:FBR.KPIInquiryContent__r.Account__c and ModifyDate__c >= :startDate AND ModifyDate__c < :endDate and PayoffObject__c=:'○' and Status__c IN('hgj' ,'fyh')];

 

List<KPIAccident__c> acc= [SELECT Date__c,MonthlyGeneratedCount__c,MonthlyPPM__c from KPIAccident__c where Date__c >= :startDate and Date__c < :endDate and Account_Name__c=:FBR.KPIInquiryContent__r.Account__c];

  

LIST<AggregateResult> calmonth=[Select count(ImportCount__c) icount from WorkResultsMonth__c where WorkDate__c >= :startDate and WorkDate__c < :endDate ];

 

if(!acc.isEmpty() )       {                    

KPIAccident__c accupdate = acc[0];                

decimal decimalcountmonth = 0 ;

string strcount= '' +countmonth[0].get('coun') ;           

decimalcountmonth=decimal.ValueOf(strcount);        

  accupdate.MonthlyGeneratedCount__c=decimalcountmonth;           

 decimal totalmonth = 0 ; string strcounts= '' +calmonth[0].get('icount') ;        

   totalmonth=decimal.ValueOf(strcounts);             

  accupdate.MonthlyPPM__c=((decimalcountmonth/totalmonth)*1000000);

          update accupdate;    

   }else       {     

     KPIAccident__c kpi = new KPIAccident__c();        

  List<KPIAccident__c> ToUpdate = new List<KPIAccident__c>();    

      kpi.Date__c=FBR.ModifyDate__c;        

          kpi.Account__c=FBR.KPIInquiryContent__r.Account__c;              

   kpi.itemname__c= FBR.CommodityName__c;       

       decimal decimalcountmonths = 0 ; string strcoun= '' +countmonth[0].get('coun') ;          decimalcountmonths=decimal.ValueOf(strcoun);       

   kpi.MonthlyGeneratedCount__c=decimalcountmonths;    

      decimal totalmonths = 0 ; string strcountss= '' +calmonth[0].get('icount') ;         

 totalmonths=decimal.ValueOf(strcountss);          

    kpi.MonthlyPPM__c=((decimalcountmonths/totalmonths)*1000000);      

   ToUpdate.add(kpi);   

       insert ToUpdate;

} }  }

Can i know how to schedule trigger Every first day of month..

Please help me to reach above 75% for the below test case..now its only 67%

 

public with sharing class storeInquiryListController {
Public Integer noOfRecords{get; set;}
Public Integer size{get;set;}
public string errormsg{get;set;}
public String status;
Public String contid;
public ApexPages.StandardSetController setCon {
get{ if(setCon == null){
status='';
contid='';
try {
status = ApexPages.currentPage().getParameters().get('status');
if(status!=null)
status = status.trim();
contid=ApexPages.currentPage().getParameters().get('Id');
if(contid!=null)
contid = contid.trim();
} catch (System.StringException e) {
System.debug('Error in param Processing: ' + e);
}
size = 25;
string queryString = 'SELECT Id, Name,KPIInquiryContent__c,Status__c,ModifyDate__c '+
' FROM FBR_Inquiry__c WHERE KPIInquiryContent__c = \''+contid+
'\' AND Status__c = \''+status +'\' Order by Name';

setCon = new ApexPages.StandardSetController(Database.getQueryLocator(queryString));
setCon.setPageSize(size);
noOfRecords = setCon.getResultSize();
if(noOfRecords ==0) {
errormsg='No records to display';
} else {
errormsg='';
}
}
return setCon;
}set;
}
Public List<FBR_Inquiry__c> getStoreInquiryList(){
List<FBR_Inquiry__c> inqList = new List<FBR_Inquiry__c>();
List<FBR_Inquiry__c> castList =(List<FBR_Inquiry__c>)setCon.getRecords();
for(FBR_Inquiry__c a : castList ) //(List<FBR_Inquiry__c>)setCon.getRecords())

inqList.add(a);

return inqList;

}
public pageReference refresh() {
 if( size ==25)
{
string queryString = 'SELECT Id, Name,KPIInquiryContent__c,Status__c,ModifyDate__c '+
' FROM FBR_Inquiry__c WHERE KPIInquiryContent__c = \''+contid+
'\' AND Status__c = \''+status +'\' Order by Name';
setCon = new ApexPages.StandardSetController(Database.getQueryLocator(queryString));
setCon.setPageSize(size); }
if( size ==50)
{
string queryString = 'SELECT Id, Name,KPIInquiryContent__c,Status__c,ModifyDate__c '+
' FROM FBR_Inquiry__c WHERE KPIInquiryContent__c = \''+contid+
'\' AND Status__c = \''+status +'\' Order by Name';
setCon = new ApexPages.StandardSetController(Database.getQueryLocator(queryString));
setCon.setPageSize(size); }
if( size ==100)
{
string queryString = 'SELECT Id, Name,KPIInquiryContent__c,Status__c,ModifyDate__c '+
' FROM FBR_Inquiry__c WHERE KPIInquiryContent__c = \''+contid+
'\' AND Status__c = \''+status +'\' Order by Name';
setCon = new ApexPages.StandardSetController(Database.getQueryLocator(queryString));
setCon.setPageSize(size); }
if( size ==200)
{
string queryString = 'SELECT Id, Name,KPIInquiryContent__c,Status__c,ModifyDate__c '+
' FROM FBR_Inquiry__c WHERE KPIInquiryContent__c = \''+contid+
'\' AND Status__c = \''+status +'\' Order by Name';
setCon = new ApexPages.StandardSetController(Database.getQueryLocator(queryString));
setCon.setPageSize(size); }

return null;
}
public Integer getpage{
get{ integer i;
if(math.mod(noOfRecords,size)==0) {
i=noOfRecords/size;
}else {
i=noOfRecords/size+1;
}
return i;
}
set;}
//Test Case

static testmethod void testPagingstoreInquiryListController()
{

integer noOfRecords;
try{
Test.startTest();
ApexPages.StandardSetController setCon;

storeInquiryListController Si=new storeInquiryListController ();
ID contid='a0hQ0000002yfkK';
ID status='00NQ0000000ouHz';

ApexPages.currentPage().getParameters().put('id', status);
ApexPages.currentPage().getParameters().put('id', contId);

integer size=25;
try
{
String queryString = 'SELECT Id, Name,KPIInquiryContent__c,Status__c,ModifyDate__c '+
' FROM FBR_Inquiry__c WHERE KPIInquiryContent__c = \''+contid+
'\' AND Status__c = \''+status +'\' Order by Name';
setCon = new ApexPages.StandardSetController(Database.getQueryLocator(queryString));
Setcon.setPageSize(size);
if(noOfRecords ==0) {
system.debug('No records to display');
} else {
//errormsg='';
}

}
Catch (Exception e){}

List<FBR_Inquiry__c> inqList = new List<FBR_Inquiry__c>();
FBR_Inquiry__c ob =new FBR_Inquiry__c();
inqList.add(ob);
System.assert(inqList.size()>0);

//ApexPages.StandardSetController controller = new ApexPages.StandardSetController(inqList);
//Si.getStoreInquiryList();
Si.refresh();


if( size ==25)
{

ApexPages.currentPage().getParameters().put('id', status);
ApexPages.currentPage().getParameters().put('id', contId);
string queryString = 'SELECT Id, Name,KPIInquiryContent__c,Status__c,ModifyDate__c '+
' FROM FBR_Inquiry__c WHERE KPIInquiryContent__c = \''+contid+
'\' AND Status__c = \''+status +'\' Order by Name';
setCon = new ApexPages.StandardSetController(Database.getQueryLocator(queryString));
setCon.setPageSize(size); }
if( size ==50)
{
string queryString = 'SELECT Id, Name,KPIInquiryContent__c,Status__c,ModifyDate__c '+
' FROM FBR_Inquiry__c WHERE KPIInquiryContent__c = \''+contid+
'\' AND Status__c = \''+status +'\' Order by Name';
setCon = new ApexPages.StandardSetController(Database.getQueryLocator(queryString));
setCon.setPageSize(size); }
if( size ==100)
{
string queryString = 'SELECT Id, Name,KPIInquiryContent__c,Status__c,ModifyDate__c '+
' FROM FBR_Inquiry__c WHERE KPIInquiryContent__c = \''+contid+
'\' AND Status__c = \''+status +'\' Order by Name';
setCon = new ApexPages.StandardSetController(Database.getQueryLocator(queryString));
setCon.setPageSize(size); }
if( size ==200)
{
string queryString = 'SELECT Id, Name,KPIInquiryContent__c,Status__c,ModifyDate__c '+
' FROM FBR_Inquiry__c WHERE KPIInquiryContent__c = \''+contid+
'\' AND Status__c = \''+status +'\' Order by Name';
setCon = new ApexPages.StandardSetController(Database.getQueryLocator(queryString));
setCon.setPageSize(size); }
Si.getStoreInquiryList();
try
{
Integer i = Si.getpage;
System.assertNotEquals(Si, null);
if(math.mod(noOfRecords,size)==0) {
i=noOfRecords/size;
}else {
i=noOfRecords/size+1;
}

}
catch(Exception E){}
test.stopTest();
}
catch(Exception E){}
}
}

Hi..my reqirement is if he is an administrator need to display ' U r Admin' else ' U r not an Admin'...

 

Is it possible???

Hi..my reqirement is if he is an administrator need to display ' U r Admin' else ' U r not an Admin'...

 

Is it possible???

 

 

 

Hello,

Please help me to write test case for the below class.

 

 

public with sharing class ABC{

Public Integer noOfRecords{get; set;}
Public Integer size{get;set;}
public string errormsg{get;set;}
public ApexPages.StandardSetController setCon {
get{ if(setCon == null){
String status='';
String contid='';
try {
status = ApexPages.currentPage().getParameters().get('status');
status = status.trim();
contid=ApexPages.currentPage().getParameters().get('Id');
contid = contid.trim();
} catch (System.StringException e) {
System.debug('Error in param Processing: ' + e);
}
size = 10;
string queryString = string queryString = 'SELECT Id, Name FROM Sample__c Order by Name WHERE InquiryContent__c = \''+contid+ '\' AND Status__c = \''+status +'\' Order by Name';
setCon = new ApexPages.StandardSetController(Database.getQueryLocator(queryString));
setCon.setPageSize(size);
noOfRecords = setCon.getResultSize();
if(noOfRecords ==0) {
errormsg='No records to display';
} else {
errormsg='';
}
}
return setCon;
}set;
}
Public List<Sample__c> sampleList(){
List<Sample__c> inqList = new List<Sample__c>();
for(Sample__c a : (List<Sample__c>)setCon.getRecords())
inqList.add(a);
return inqList;
}
public pageReference refresh() {
setCon = null;
sampleList();
setCon.setPageNumber(1);
return null;
}
public Integer getpage{
get{ integer i;
if(math.mod(noOfRecords,size)==0) {
i=noOfRecords/size;
}else {
i=noOfRecords/size+1;
}
return i;
}
set;}
}

Dear All,

I have Inquiry__c  table and Accident__c table. 

Inquiry__c   table Contains Date__c,Name__c,Account__c,Status__c(Picklist), __cStatus2(Picklist).

Now need to count Number of Accounts per month by when both picklist shows 'OK' .

The count values should be stored in Table2 Accident__c table. 
It Contains Date__c,ItemName__c,Account__c,MonthlyGeneratedcount__c

My Code saves with out any error but i haven't get any O/P. Please help me.

Here is my code:

public class Inquiry{
 
  @future   public  static void ValAdd(Set<Id> InquiryId) {  
             //integer countmonth,countyear;
string accountname;
List<Inquiry__c> Inquiry= [SELECT Account__c,Name__c,Date__c,Status__c from Inquiry__c where Id =:InquiryId];
Accident__c kpi = new Accident__c();
 
Inquiry__c FBR= Inquiry[0];
  
  Date startDate=FBR.Date__c.toStartOfMonth();
Date endDate=FBR.Date__c.toStartOfMonth().addMonths(1);
 
//Date startDatey=FBR.Date__c.toStartOfyear();
//Date endDatey=FBR.Date__c.toStartOfday();
            LIST<AggregateResult> countmonth=[SELECT count(Account__c)coun from Inquiry__c where Account__c=:FBR.Account__cand Date__c >= :startDate AND Date__c < :endDate and Status__c=:'OK' and Status2__c=:'OK'];
                         
    List<Accident__c> acc= [SELECT Date__c,Account__c ,itemname__c,MonthlyGeneratedCount__c from Accident__c where Date__c >= :startDate and Date__c < :endDate and Account__c=:FBR.Account__c];     
 
 if(!acc.isEmpty() )
      {
          
          Accident__c accupdate = acc[0];
  Decimal decimalcountmonth = 0 ; string strcount= '' +countmonth[0].get('coun') ; 
 decimalcountmonth=Decimal.ValueOf(strcount); 
  kpi.MonthlyGeneratedCount__c=decimalcountmonth;
          update accupdate ;
      }else
      {
          List<Accident__c> ToUpdate = new List<Accident__c>(); 
          kpi.Date__c=FBR.Date__c;               
          kpi.Account__c = FBR.Account__c;   
          kpi.itemname__c= FBR.Name__c;     
          Decimal decimalcountmonths = 0 ; string strcount= '' +countmonth[0].get('coun') ; 
 decimalcountmonths=Decimal.ValueOf(strcount); 
         kpi.MonthlyGeneratedCount__c=decimalcountmonths; 
                    ToUpdate.add(kpi);
          insert ToUpdate;
 
 }
 }

Hello..

 

The page wizard contains 4 page. in first page,When i select radio boutton and moved to next page ,Now i need to go previous page again,So i clicked previous button and return to first page but the Radiobutton have nt selected which i clicked...

 

Plz help..

Hi All,

 

I got a certification from my Admin, Now where i can add the Certificate in Salesforce for accessing External Webservice..

Hi..

 

When i press enter key in text box, it does not performing its operation and doing the command button action..how can i solve this...

Dear All,

 

I need to get the currently selected  view (Ex: Now picklist selected "All Open Leads")records in Leads. Using SOQL..

 

THanks in Advance..

Can somebody help me creating a test case please...  it is a scheduled apex class, here is my code ..

 

global class FBR_ApexScheduleMonthClass Implements Schedulable
            {
                       global void execute(SchedulableContext sc)
                        {
                                    ValAdd();
                        }
 public  static void ValAdd()//Set<Id> InquiryId
  {  
  
List<FBR_Inquiry__c> Inquiry= [SELECT KPIInquiryContent__c,KPIInquiryContent__r.Account__c,CommodityName__c,ModifyDate__c,Status__c from FBR_Inquiry__c  ];
{
FBR_Inquiry__c FBR= Inquiry[0];
Date startDate=FBR.ModifyDate__c.toStartOfMonth();
Date endDate=FBR.ModifyDate__c.toStartOfMonth().addMonths(1);

LIST<AggregateResult> countmonth=[SELECT count(KPIInquiryContent__c) coun from FBR_Inquiry__c where KPIInquiryContent__r.Account__c=:FBR.KPIInquiryContent__r.Account__c and ModifyDate__c >= :startDate AND ModifyDate__c < :endDate and PayoffObject__c=:'○' and Status__c IN('対応中' ,'対応完了')];
 //LIST<AggregateResult> calmonth=[Select CALENDAR_MONTH(WorkDate__c), count(ImportCount__c) icount from WorkResultsMonth__c where Account_Name__c=:acname GROUP BY CALENDAR_MONTH(WorkDate__c)];
LIST<AggregateResult> calmonth=[Select count(ImportCount__c) icount from WorkResultsMonth__c where WorkDate__c >= :startDate and WorkDate__c < :endDate and Account_Name__c=:FBR.KPIInquiryContent__r.Account__c];

List<KPIAccident__c> acc= [SELECT MonthlyGeneratedCount__c,MonthlyPPM__c from KPIAccident__c where Account__c=:FBR.KPIInquiryContent__r.Account__c];   
if(!acc.isEmpty() )
      {
          
          KPIAccident__c accupdate = acc[0];         
          Integer totalcountmonth=Integer.Valueof(countmonth[0].get('coun')); 
          
          accupdate.MonthlyGeneratedCount__c=totalcountmonth;   
         
          Integer totalmonthwork= Integer.Valueof(calmonth[0].get('icount'));
          accupdate.MonthlyPPM__c=(totalmonthwork/totalcountmonth*1000000);
          update accupdate;
      }else 
      {
         KPIAccident__c kpi = new KPIAccident__c();
         List<KPIAccident__c> ToUpdate = new List<KPIAccident__c>(); 
        // kpi.Date__c=FBR.ModifyDate__c;         
          kpi.Account__c=FBR.KPIInquiryContent__r.Account__c;         
        // kpi.itemname__c= FBR.CommodityName__c;     
         
         Integer totalcountmonths=Integer.Valueof(countmonth[0].get('coun'));
         kpi.MonthlyGeneratedCount__c=totalcountmonths; 
         Integer totalmonthworks= Integer.Valueof(calmonth[0].get('icount'));
                    
         kpi.MonthlyPPM__c=(totalmonthworks/totalcountmonths*1000000);
         ToUpdate.add(kpi);
         insert ToUpdate;



}
} }

 

Hello,

 

 

global class ApexScheduledClass Implements Schedulable
            {
                       global void execute(SchedulableContext sc)
                        {
                                    ValAdd();
                        }
 public  static void ValAdd()
  { 
 
List<FBR_Inquiry__c> Inquiry= [SELECT KPIInquiryContent__c,KPIInquiryContent__r.Account__c,CommodityName__c,ModifyDate__c,Status__c from FBR_Inquiry__c  ];
{
FBR_Inquiry__c FBR= Inquiry[0];
Date startDate=FBR.ModifyDate__c.toStartOfMonth();
Date endDate=FBR.ModifyDate__c.toStartOfMonth().addMonths(1);

LIST<AggregateResult> countmonth=[SELECT count(KPIInquiryContent__c) coun from FBR_Inquiry__c where KPIInquiryContent__r.Account__c=:FBR.KPIInquiryContent__r.Account__c and ModifyDate__c >= :startDate AND ModifyDate__c < :endDate and PayoffObject__c=:'○' and Status__c IN('dry' ,'dfjgfj')];

LIST<AggregateResult> calmonth=[Select count(ImportCount__c) icount from WorkResultsMonth__c where WorkDate__c >= :startDate and WorkDate__c < :endDate and Account_Name__c=:FBR.KPIInquiryContent__r.Account__c];

List<KPIAccident__c> acc= [SELECT Date__c,MonthlyGeneratedCount__c,MonthlyPPM__c from KPIAccident__c where  Account_Name__c=:FBR.KPIInquiryContent__r.Account__c and Date__c >= :startDate and Date__c < :endDate];
if(!acc.isEmpty() )
      {
         
          KPIAccident__c accupdate = acc[0];        
          Integer totalcountmonth=Integer.Valueof(countmonth[0].get('coun'));
         
          accupdate.MonthlyGeneratedCount__c=totalcountmonth;  
        
          Integer totalmonthwork= Integer.Valueof(calmonth[0].get('icount'));
          accupdate.MonthlyPPM__c=((totalmonthwork/totalcountmonth)*1000000);
          update accupdate;
      }else
      {
         KPIAccident__c kpi = new KPIAccident__c();
         List<KPIAccident__c> ToUpdate = new List<KPIAccident__c>();
         kpi.Date__c=FBR.ModifyDate__c;        
          kpi.Account__c=FBR.KPIInquiryContent__r.Account__c;        
         kpi.itemname__c= FBR.CommodityName__c;    
        
         Integer totalcountmonths=Integer.Valueof(countmonth[0].get('coun'));
         kpi.MonthlyGeneratedCount__c=totalcountmonths;
         Integer totalmonthworks= Integer.Valueof(calmonth[0].get('icount'));
                   
         kpi.MonthlyPPM__c=((totalmonthworks/totalcountmonths)*1000000);
         ToUpdate.add(kpi);
         insert ToUpdate;

}
}
} }

 

Above is my class, After save this go to Setup->Develop->Apex Classes then clicking on the ‘Schedule Apex’ button. and scheduled my class to run monthly but it doesn't get  start..

 

Is there any wrong what i did,, Please help me solve this

Hello,

 

Here is my code how can i schedule this monthly.. Please help me..

 

 

 

global class FBR_InquiryMonthly{

 

    public  static void ValAdd(Set<Id> InquiryId)
  { 
 
List<FBR_Inquiry__c> Inquiry= [SELECT KPIInquiryContent__c,KPIInquiryContent__r.Account__c,CommodityName__c,ModifyDate__c,Status__c from FBR_Inquiry__c  where Id =:InquiryId];
{
FBR_Inquiry__c FBR= Inquiry[0];
Date startDate=FBR.ModifyDate__c.toStartOfMonth();
Date endDate=FBR.ModifyDate__c.toStartOfMonth().addMonths(1);

 

LIST<AggregateResult> countmonth=[SELECT count(KPIInquiryContent__c) coun from FBR_Inquiry__c where KPIInquiryContent__r.Account__c=:FBR.KPIInquiryContent__r.Account__c and ModifyDate__c >= :startDate AND ModifyDate__c < :endDate and PayoffObject__c=:'○' and Status__c IN('ftyti ,'vinjk')];
 
LIST<AggregateResult> calmonth=[Select count(ImportCount__c) icount from WorkResultsMonth__c where WorkDate__c >= :startDate and WorkDate__c < :endDate and Account_Name__c=:FBR.KPIInquiryContent__r.Account__c];

 

 

List<KPIAccident__c> acc= [SELECT Date__c,MonthlyGeneratedCount__c,MonthlyPPM__c from KPIAccident__c where  Account_Name__c=:FBR.KPIInquiryContent__r.Account__c and Date__c >= :startDate and Date__c < :endDate];    
if(!acc.isEmpty() )
      {
         
          KPIAccident__c accupdate = acc[0];        
          Integer totalcountmonth=Integer.Valueof(countmonth[0].get('coun'));
         
          accupdate.MonthlyGeneratedCount__c=totalcountmonth;  
        
          Integer totalmonthwork= Integer.Valueof(calmonth[0].get('icount'));
          accupdate.MonthlyPPM__c=((totalmonthwork/totalcountmonth)*1000000);
          update accupdate;
      }else
      {
         KPIAccident__c kpi = new KPIAccident__c();
         List<KPIAccident__c> ToUpdate = new List<KPIAccident__c>();
         kpi.Date__c=FBR.ModifyDate__c;        
          kpi.Account__c=FBR.KPIInquiryContent__r.Account__c;        
         kpi.itemname__c= FBR.CommodityName__c;      
         Integer totalcountmonths=Integer.Valueof(countmonth[0].get('coun'));
         kpi.MonthlyGeneratedCount__c=totalcountmonths;
         Integer totalmonthworks= Integer.Valueof(calmonth[0].get('icount'));
                   
         kpi.MonthlyPPM__c=((totalmonthworks/totalcountmonths)*1000000);
         ToUpdate.add(kpi);
         insert ToUpdate;

 

}
}
 }}

 

Hello..

 

There is problem in using Aggregate function, but i dont know whats wrong in this please help me..

 

But it save with out any error

 

public class FBR_InquiryMonthly{

  @future   public  static void ValAdd(Set<Id> InquiryId) {  integer total;     

string accountname;     

List<FBR_Inquiry__c> Inquiry= [SELECT KPIInquiryContent__c,KPIInquiryContent__r.Account__c,CommodityName__c,ModifyDate__c,Status__c from FBR_Inquiry__c where Id =:InquiryId];

FBR_Inquiry__c FBR= Inquiry[0]; Date startDate=FBR.ModifyDate__c.toStartOfMonth();

Date endDate=FBR.ModifyDate__c.toStartOfMonth().addMonths(1);

LIST<AggregateResult> countmonth=[SELECT count(KPIInquiryContent__c) coun from FBR_Inquiry__c where KPIInquiryContent__r.Account__c=:FBR.KPIInquiryContent__r.Account__c and ModifyDate__c >= :startDate AND ModifyDate__c < :endDate and PayoffObject__c=:'○' and Status__c IN('hgj' ,'fyh')];

 

List<KPIAccident__c> acc= [SELECT Date__c,MonthlyGeneratedCount__c,MonthlyPPM__c from KPIAccident__c where Date__c >= :startDate and Date__c < :endDate and Account_Name__c=:FBR.KPIInquiryContent__r.Account__c];

  

LIST<AggregateResult> calmonth=[Select count(ImportCount__c) icount from WorkResultsMonth__c where WorkDate__c >= :startDate and WorkDate__c < :endDate ];

 

if(!acc.isEmpty() )       {                    

KPIAccident__c accupdate = acc[0];                

decimal decimalcountmonth = 0 ;

string strcount= '' +countmonth[0].get('coun') ;           

decimalcountmonth=decimal.ValueOf(strcount);        

  accupdate.MonthlyGeneratedCount__c=decimalcountmonth;           

 decimal totalmonth = 0 ; string strcounts= '' +calmonth[0].get('icount') ;        

   totalmonth=decimal.ValueOf(strcounts);             

  accupdate.MonthlyPPM__c=((decimalcountmonth/totalmonth)*1000000);

          update accupdate;    

   }else       {     

     KPIAccident__c kpi = new KPIAccident__c();        

  List<KPIAccident__c> ToUpdate = new List<KPIAccident__c>();    

      kpi.Date__c=FBR.ModifyDate__c;        

          kpi.Account__c=FBR.KPIInquiryContent__r.Account__c;              

   kpi.itemname__c= FBR.CommodityName__c;       

       decimal decimalcountmonths = 0 ; string strcoun= '' +countmonth[0].get('coun') ;          decimalcountmonths=decimal.ValueOf(strcoun);       

   kpi.MonthlyGeneratedCount__c=decimalcountmonths;    

      decimal totalmonths = 0 ; string strcountss= '' +calmonth[0].get('icount') ;         

 totalmonths=decimal.ValueOf(strcountss);          

    kpi.MonthlyPPM__c=((decimalcountmonths/totalmonths)*1000000);      

   ToUpdate.add(kpi);   

       insert ToUpdate;

} }  }

Please help me to reach above 75% for the below test case..now its only 67%

 

public with sharing class storeInquiryListController {
Public Integer noOfRecords{get; set;}
Public Integer size{get;set;}
public string errormsg{get;set;}
public String status;
Public String contid;
public ApexPages.StandardSetController setCon {
get{ if(setCon == null){
status='';
contid='';
try {
status = ApexPages.currentPage().getParameters().get('status');
if(status!=null)
status = status.trim();
contid=ApexPages.currentPage().getParameters().get('Id');
if(contid!=null)
contid = contid.trim();
} catch (System.StringException e) {
System.debug('Error in param Processing: ' + e);
}
size = 25;
string queryString = 'SELECT Id, Name,KPIInquiryContent__c,Status__c,ModifyDate__c '+
' FROM FBR_Inquiry__c WHERE KPIInquiryContent__c = \''+contid+
'\' AND Status__c = \''+status +'\' Order by Name';

setCon = new ApexPages.StandardSetController(Database.getQueryLocator(queryString));
setCon.setPageSize(size);
noOfRecords = setCon.getResultSize();
if(noOfRecords ==0) {
errormsg='No records to display';
} else {
errormsg='';
}
}
return setCon;
}set;
}
Public List<FBR_Inquiry__c> getStoreInquiryList(){
List<FBR_Inquiry__c> inqList = new List<FBR_Inquiry__c>();
List<FBR_Inquiry__c> castList =(List<FBR_Inquiry__c>)setCon.getRecords();
for(FBR_Inquiry__c a : castList ) //(List<FBR_Inquiry__c>)setCon.getRecords())

inqList.add(a);

return inqList;

}
public pageReference refresh() {
 if( size ==25)
{
string queryString = 'SELECT Id, Name,KPIInquiryContent__c,Status__c,ModifyDate__c '+
' FROM FBR_Inquiry__c WHERE KPIInquiryContent__c = \''+contid+
'\' AND Status__c = \''+status +'\' Order by Name';
setCon = new ApexPages.StandardSetController(Database.getQueryLocator(queryString));
setCon.setPageSize(size); }
if( size ==50)
{
string queryString = 'SELECT Id, Name,KPIInquiryContent__c,Status__c,ModifyDate__c '+
' FROM FBR_Inquiry__c WHERE KPIInquiryContent__c = \''+contid+
'\' AND Status__c = \''+status +'\' Order by Name';
setCon = new ApexPages.StandardSetController(Database.getQueryLocator(queryString));
setCon.setPageSize(size); }
if( size ==100)
{
string queryString = 'SELECT Id, Name,KPIInquiryContent__c,Status__c,ModifyDate__c '+
' FROM FBR_Inquiry__c WHERE KPIInquiryContent__c = \''+contid+
'\' AND Status__c = \''+status +'\' Order by Name';
setCon = new ApexPages.StandardSetController(Database.getQueryLocator(queryString));
setCon.setPageSize(size); }
if( size ==200)
{
string queryString = 'SELECT Id, Name,KPIInquiryContent__c,Status__c,ModifyDate__c '+
' FROM FBR_Inquiry__c WHERE KPIInquiryContent__c = \''+contid+
'\' AND Status__c = \''+status +'\' Order by Name';
setCon = new ApexPages.StandardSetController(Database.getQueryLocator(queryString));
setCon.setPageSize(size); }

return null;
}
public Integer getpage{
get{ integer i;
if(math.mod(noOfRecords,size)==0) {
i=noOfRecords/size;
}else {
i=noOfRecords/size+1;
}
return i;
}
set;}
//Test Case

static testmethod void testPagingstoreInquiryListController()
{

integer noOfRecords;
try{
Test.startTest();
ApexPages.StandardSetController setCon;

storeInquiryListController Si=new storeInquiryListController ();
ID contid='a0hQ0000002yfkK';
ID status='00NQ0000000ouHz';

ApexPages.currentPage().getParameters().put('id', status);
ApexPages.currentPage().getParameters().put('id', contId);

integer size=25;
try
{
String queryString = 'SELECT Id, Name,KPIInquiryContent__c,Status__c,ModifyDate__c '+
' FROM FBR_Inquiry__c WHERE KPIInquiryContent__c = \''+contid+
'\' AND Status__c = \''+status +'\' Order by Name';
setCon = new ApexPages.StandardSetController(Database.getQueryLocator(queryString));
Setcon.setPageSize(size);
if(noOfRecords ==0) {
system.debug('No records to display');
} else {
//errormsg='';
}

}
Catch (Exception e){}

List<FBR_Inquiry__c> inqList = new List<FBR_Inquiry__c>();
FBR_Inquiry__c ob =new FBR_Inquiry__c();
inqList.add(ob);
System.assert(inqList.size()>0);

//ApexPages.StandardSetController controller = new ApexPages.StandardSetController(inqList);
//Si.getStoreInquiryList();
Si.refresh();


if( size ==25)
{

ApexPages.currentPage().getParameters().put('id', status);
ApexPages.currentPage().getParameters().put('id', contId);
string queryString = 'SELECT Id, Name,KPIInquiryContent__c,Status__c,ModifyDate__c '+
' FROM FBR_Inquiry__c WHERE KPIInquiryContent__c = \''+contid+
'\' AND Status__c = \''+status +'\' Order by Name';
setCon = new ApexPages.StandardSetController(Database.getQueryLocator(queryString));
setCon.setPageSize(size); }
if( size ==50)
{
string queryString = 'SELECT Id, Name,KPIInquiryContent__c,Status__c,ModifyDate__c '+
' FROM FBR_Inquiry__c WHERE KPIInquiryContent__c = \''+contid+
'\' AND Status__c = \''+status +'\' Order by Name';
setCon = new ApexPages.StandardSetController(Database.getQueryLocator(queryString));
setCon.setPageSize(size); }
if( size ==100)
{
string queryString = 'SELECT Id, Name,KPIInquiryContent__c,Status__c,ModifyDate__c '+
' FROM FBR_Inquiry__c WHERE KPIInquiryContent__c = \''+contid+
'\' AND Status__c = \''+status +'\' Order by Name';
setCon = new ApexPages.StandardSetController(Database.getQueryLocator(queryString));
setCon.setPageSize(size); }
if( size ==200)
{
string queryString = 'SELECT Id, Name,KPIInquiryContent__c,Status__c,ModifyDate__c '+
' FROM FBR_Inquiry__c WHERE KPIInquiryContent__c = \''+contid+
'\' AND Status__c = \''+status +'\' Order by Name';
setCon = new ApexPages.StandardSetController(Database.getQueryLocator(queryString));
setCon.setPageSize(size); }
Si.getStoreInquiryList();
try
{
Integer i = Si.getpage;
System.assertNotEquals(Si, null);
if(math.mod(noOfRecords,size)==0) {
i=noOfRecords/size;
}else {
i=noOfRecords/size+1;
}

}
catch(Exception E){}
test.stopTest();
}
catch(Exception E){}
}
}

Hi

 

i am displaying standard salesforce reports in customer portal. If records in a report contain name(Eg: Account Name) field of object then it shows hyperlink for that value allowing the user to navigate to that record. I dont want this to happen. I need to remove hyperlink for the records so that no navigation takes place.

 

Plz help me with solution

Thanks.

Hello all,

 

I'm trying to setup a webservice callout in SF. I generated the Apex classes from the WSDL file but when I run it, I get the error:

 

System.CalloutException: Web service callout failed: Unable to parse callout response. Apex type not found for element registrationResponse.


I've been trying to figure out where the problem is but I can't seem to find it.  I tested the WSDL file in soapUI which works perfectly.

 

This is the code I run in the IDE:

 

 

    registrationweb.RegistrationSoap stub = new registrationweb.RegistrationSoap();
    stub.RegisterUserWithAutoId_test(1234, 'abcd', 'abcd', 'test', 'test');

 

This is the Apex class generated  from the WSDL file:

 

 

//Generated by wsdl2apex

public class registrationweb {

    ...

    public class RegistrationSoap {
        public String endpoint_x = 'http://website.com/PartnerRegistrationWebservice/Registration.asmx';
        public Map<String,String> inputHttpHeaders_x;
        public Map<String,String> outputHttpHeaders_x;
        public String clientCertName_x;
        public String clientCert_x;
        public String clientCertPasswd_x;
        public Integer timeout_x;
        private String[] ns_map_type_info = new String[]{'http://website.com/PartnerRegistrationWebservice/registration', 'registrationweb'};
        
        ...
        
        public registrationweb.RegisterUserWithAutoId_testResult_element RegisterUserWithAutoId_test(Integer partnerID,String partnerGuid,String partnerPassword,String clientName,String clientPassword) {
            registrationweb.RegisterUserWithAutoId_test_element request_x = new registrationweb.RegisterUserWithAutoId_test_element();
            registrationweb.RegisterUserWithAutoId_testResponse_element response_x;
            request_x.partnerID = partnerID;
            request_x.partnerGuid = partnerGuid;
            request_x.partnerPassword = partnerPassword;
            request_x.clientName = clientName;
            request_x.clientPassword = clientPassword;
            Map<String, registrationweb.RegisterUserWithAutoId_testResponse_element> response_map_x = new Map<String, registrationweb.RegisterUserWithAutoId_testResponse_element>();
            response_map_x.put('response_x', response_x);
            WebServiceCallout.invoke(
              this,
              request_x,
              response_map_x,
              new String[]{endpoint_x,
              'http://website.com/PartnerRegistrationWebservice/registration/RegisterUserWithAutoId_test',
              'http://website.com/PartnerRegistrationWebservice/registration',
              'RegisterUserWithAutoId_test',
              'http://website.com/PartnerRegistrationWebservice/registration',
              'RegisterUserWithAutoId_testResponse',
              'registrationweb.RegisterUserWithAutoId_testResponse_element'}
            );
            response_x = response_map_x.get('response_x');
            return response_x.RegisterUserWithAutoId_testResult;
        }
    }
    
    ...
    
    public class RegisterUserWithAutoId_test_element {
        public Integer partnerID;
        public String partnerGuid;
        public String partnerPassword;
        public String clientName;
        public String clientPassword;
        private String[] partnerID_type_info = new String[]{'partnerID','http://www.w3.org/2001/XMLSchema','int','1','1','false'};
        private String[] partnerGuid_type_info = new String[]{'partnerGuid','http://www.w3.org/2001/XMLSchema','string','0','1','false'};
        private String[] partnerPassword_type_info = new String[]{'partnerPassword','http://www.w3.org/2001/XMLSchema','string','0','1','false'};
        private String[] clientName_type_info = new String[]{'clientName','http://www.w3.org/2001/XMLSchema','string','0','1','false'};
        private String[] clientPassword_type_info = new String[]{'clientPassword','http://www.w3.org/2001/XMLSchema','string','0','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://website.com/PartnerRegistrationWebservice/registration','true','false'};
        private String[] field_order_type_info = new String[]{'partnerID','partnerGuid','partnerPassword','clientName','clientPassword'};
    }
    public class RegisterUserWithAutoId_testResponse_element {
        public registrationweb.RegisterUserWithAutoId_testResult_element RegisterUserWithAutoId_testResult;
        private String[] RegisterUserWithAutoId_testResult_type_info = new String[]{'RegisterUserWithAutoId_testResult','http://website.com/PartnerRegistrationWebservice/registration','RegisterUserWithAutoId_testResult_element','0','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://website.com/PartnerRegistrationWebservice/registration','true','false'};
        private String[] field_order_type_info = new String[]{'RegisterUserWithAutoId_testResult'};
    }
    public class RegisterUserWithAutoId_testResult_element {
        private String[] apex_schema_type_info = new String[]{'http://website.com/PartnerRegistrationWebservice/registration','true','false'};
        private String[] field_order_type_info = new String[]{};
    }
}

 

Please help!

 

 

  • August 18, 2010
  • Like
  • 0