• 111
  • NEWBIE
  • 0 Points
  • Member since 2008

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 19
    Questions
  • 28
    Replies

select Id from OpportunityLineItem 
            where PricebookEntry.Product2.hozen_rel_flg__c =: Boolean.valueOf('false')

 
error is appeared.
 
how can i make it to be right?
 
public OpportunityLineItem[] selectOpportunity(String sffann){
      opportunityList = [select Id from OpportunityLineItem 
            where PricebookEntry.Product2.hozen_rel_flg__c =: Boolean.valueOf(sffann) for update];
 
}
  • July 02, 2008
  • Like
  • 0

select a.ID from PricebookEntry a   Product2 b where Product2.ProductCode =:productCode    

error is appeared.

unexpected token: Product2 

 

 

how can i make the SOQL[select a.ID from PricebookEntry a   Product2 b where Product2.ProductCode =:productCode ] to be right?

  • July 02, 2008
  • Like
  • 0
public sagyosaki__c[] selectSagyosaki07(String syoriTuubann,String sagyomotoCd,String sagyomotoCdJi,String state){
         

        sagyosaki__c[] sagyosakiList = null;
    

        sagyosakiList = [select ID from sagyosaki__c
            where sagyomoto_cd__c =:sagyomotoCd  and CreatedDate >= Datetime.valueOf(sagyomotoCdJi) and state__c =:state for update];
        
        return sagyosakiList;
    }
 
how can i get the date (  CreatedDate >= Datetime.valueOf(sagyomotoCdJi)  )?
 
CreatedDate >= Datetime.valueOf(sagyomotoCdJi)  is error?
 
 
  • July 01, 2008
  • Like
  • 0
global class gg {
    WebService static Boolean updateDB(OpportunityLineItem[]  opportunityList) {

    Boolean updateFlg = true;
        Database.SaveResult[] SR = database.update(opportunityList,false);
        for(Database.SaveResult lsr:SR){
            if(!lsr.isSuccess()){
                    updateFlg = false;
                    break;
                }
            }          
    }
    return updateFlg;
}
 
     static testMethod void updateDB() {
    
          OpportunityLineItem[] opportunityList = null;
          opportunityList = [select mitosakuban__c from OpportunityLineItem];
          for (OpportunityLineItem opportunity : opportunityList) {
               
             opportunity.mitosakuban__c = '';
            
            }
           System.assertEquals(false, updateDB(opportunityList ));
    }
}
 
 
how can i make the method (database.update(opportunityList,false)) to be error,how can i test it ?
 
now my coverage can't  be 100%?can someone can give a testmethode?
Thankyou
  • June 22, 2008
  • Like
  • 0
why error is appeared?cannot  login in
 
 
To protect all customers from excessive usage and Denial of Service attacks, we limit the number of long-running requests that are processed at the same time by an organization. Your request has been denied because this limit has been exceeded by your organization. Please try your request again later.
  • June 20, 2008
  • Like
  • 0

source:

Product2 p = new Product2(Name='x',ProductCode ='GC1020');
insert p;

 
 
error
 
faultString: System.DmlException: Insert failed. First exception on row 0; first error: STORAGE_LIMIT_EXCEEDED, storage limit exceeded
 
someboby can help me?
  • June 16, 2008
  • Like
  • 0

global class ClientWeb11 {

WebService static String sayHelloWorld(Map<String, String>  d) {

 

error : Invalid argument type: MAP:String,String 

map can't be used?

  • June 13, 2008
  • Like
  • 0
there is  getNumDml()-method  for DML exceptions?
 
anyone know the method  to get the Apex-code-Exception' rows?
 
i want to returns the number of failed rows for the Excetion Not DML exceptions. 
 
 
try {
       OpportunityLineItem newAcct = new OpportunityLineItem(Description  ='testdddd');
        insert newAcct;
}catch (Exception e) {
        List<String> listStack = new List<String>();
       
 
        //  method is not getNumDml(Returns the number of failed rows for DML exceptions)
        listStack.add(String.valueOf(   method   ); 
 
       
        listStack.add(e.getTypeName());
}   
  • June 12, 2008
  • Like
  • 0
  • June 10, 2008
  • Like
  • 0
how can i get (!lsr.isSuccess()) == true?
and then i get the updateFlg = false;
 
now i can't get updateFlg = false;
 
 
OpportunityLineItem[] opportunityList
                = BOpportunityLineItemDAO.selectOpportunityLineItem(mitoSakubanBef);
 
 
Database.SaveResult[] SR = database.update(opportunityList);
       
        try{
         
            for(Database.SaveResult lsr:SR){
                //更新失敗の場合
                if(!lsr.isSuccess()){
                 
                    updateFlg = false;
                   
                    break;
                }
            }
        }catch (System.DmlException e) {
         // DmlException例外は呼元へ投る
            throw e;
       
        }catch (System.Exception e) {
            // SFDCシステム例外は呼元へ投る
            throw e;
       
        }
  • June 05, 2008
  • Like
  • 0
how can i throws Exception?
 
i also got the errors  unexpected token: throws 
 
WebService static String sayHelloWorld(String userID, String userName) throws Exception{
  • June 04, 2008
  • Like
  • 0

i got the error

 

 

if(!lsr.isSuccess()){
                 updateFlg = false;
                 throw new Exception('update is false');
                 break;
             }

  • June 04, 2008
  • Like
  • 0

i got the error

  Variable does not exist 

 

if(!lsr.isSuccess()){
                updateFlg = false;
                throw new DmlException('fd');
                break;
            }

  • June 04, 2008
  • Like
  • 0

 

how can i direct throw the errors?

 

for example

 

i got the error

unexpected token: throw

 

global class HelloWorld3 {

WebService static String sayHelloWorld(String userID, String userName) throw Exception{


Account c = [select account.name from account where name =:userName];

 

}

  • June 02, 2008
  • Like
  • 0
for example
 
I got the error :
Invalid return type: MAP:String,String
 
how can i get the return-value,and the return-value's type is   (list or map)?

global class listReturn {
    WebService static Map<String,String> listMethod() {
        Map<String,String> myList = new Map<String,String>();
        myList.put('ID', 'ACOO1');
        myList.put('MSG', 'Message');
        return myList;
    }
}

  • June 02, 2008
  • Like
  • 0
i get the error message
Method is not visible: [s.Message].setM1(String)
 
i got the hello.cls,and then how can i use method of Message.cls?
 
 
 
for example
 
file 1 (hello.cls)
 
global class Hello {
 WebService static String sayHelloWorld() {
       
        Message message = new Message();
        message.setM1('d');
        return  message.getM1();
 }
}
 
 
 
file 2  ( Message.cls)
public class Message {
 String M1 = 'Hello world';
 String M2 = 'Hello USA';
 
 void setM1(String argM1) {
        M1 = argM1;
    }
   
    void setM2(String argM2) {
        M2 = argM2;
    }
   
    String getM1(){
        return M1;
    }
   
    String getM2(){
        return M2;
    }
}
  • May 30, 2008
  • Like
  • 0
String a = 'dafa';
Integer b = 2;
 
String c = a + b.tostring();
 
 
how can I    change  "int-type" to  "string-type" just as java
  • May 28, 2008
  • Like
  • 0
how can make many apex-class to package? then make the many class to WSDL FILE like the Enterprise WSDL FILE?
 
 
can Anyone help me?:smileywink:
  • May 27, 2008
  • Like
  • 0
can someone help me to coding the sample in apex?
Tnank you in advance:smileywink:
  • May 26, 2008
  • Like
  • 0

select Id from OpportunityLineItem 
            where PricebookEntry.Product2.hozen_rel_flg__c =: Boolean.valueOf('false')

 
error is appeared.
 
how can i make it to be right?
 
public OpportunityLineItem[] selectOpportunity(String sffann){
      opportunityList = [select Id from OpportunityLineItem 
            where PricebookEntry.Product2.hozen_rel_flg__c =: Boolean.valueOf(sffann) for update];
 
}
  • July 02, 2008
  • Like
  • 0
public sagyosaki__c[] selectSagyosaki07(String syoriTuubann,String sagyomotoCd,String sagyomotoCdJi,String state){
         

        sagyosaki__c[] sagyosakiList = null;
    

        sagyosakiList = [select ID from sagyosaki__c
            where sagyomoto_cd__c =:sagyomotoCd  and CreatedDate >= Datetime.valueOf(sagyomotoCdJi) and state__c =:state for update];
        
        return sagyosakiList;
    }
 
how can i get the date (  CreatedDate >= Datetime.valueOf(sagyomotoCdJi)  )?
 
CreatedDate >= Datetime.valueOf(sagyomotoCdJi)  is error?
 
 
  • July 01, 2008
  • Like
  • 0
global class gg {
    WebService static Boolean updateDB(OpportunityLineItem[]  opportunityList) {

    Boolean updateFlg = true;
        Database.SaveResult[] SR = database.update(opportunityList,false);
        for(Database.SaveResult lsr:SR){
            if(!lsr.isSuccess()){
                    updateFlg = false;
                    break;
                }
            }          
    }
    return updateFlg;
}
 
     static testMethod void updateDB() {
    
          OpportunityLineItem[] opportunityList = null;
          opportunityList = [select mitosakuban__c from OpportunityLineItem];
          for (OpportunityLineItem opportunity : opportunityList) {
               
             opportunity.mitosakuban__c = '';
            
            }
           System.assertEquals(false, updateDB(opportunityList ));
    }
}
 
 
how can i make the method (database.update(opportunityList,false)) to be error,how can i test it ?
 
now my coverage can't  be 100%?can someone can give a testmethode?
Thankyou
  • June 22, 2008
  • Like
  • 0
why error is appeared?cannot  login in
 
 
To protect all customers from excessive usage and Denial of Service attacks, we limit the number of long-running requests that are processed at the same time by an organization. Your request has been denied because this limit has been exceeded by your organization. Please try your request again later.
  • June 20, 2008
  • Like
  • 0

source:

Product2 p = new Product2(Name='x',ProductCode ='GC1020');
insert p;

 
 
error
 
faultString: System.DmlException: Insert failed. First exception on row 0; first error: STORAGE_LIMIT_EXCEEDED, storage limit exceeded
 
someboby can help me?
  • June 16, 2008
  • Like
  • 0

global class tt {
    WebService static Boolean sayHelloWorld(String name) {
 
        Boolean updateFlg = true;

        Account [] accountList = [Select a.Name from Account a where o.Name = name];

        for(Account oli : accountList ){
            oli.Name = '23';
        }

         Database.SaveResult[] SR = database.update(accountList);
             try{
                         for(Database.SaveResult lsr:SR){
                                if(!lsr.isSuccess()){
                                      updateFlg = false;
                                      break;
                                }
                          }
              }catch (System.Exception e) {

              }


          static testMethod void testHelloWorld() {
                System.assertEquals(false, sayHelloWorld('name1'));
         }
    }
}

i can't get the lsr.isSuccess())==false, how can i get it when update or insert the Datebase.
there is  getNumDml()-method  for DML exceptions?
 
anyone know the method  to get the Apex-code-Exception' rows?
 
i want to returns the number of failed rows for the Excetion Not DML exceptions. 
 
 
try {
       OpportunityLineItem newAcct = new OpportunityLineItem(Description  ='testdddd');
        insert newAcct;
}catch (Exception e) {
        List<String> listStack = new List<String>();
       
 
        //  method is not getNumDml(Returns the number of failed rows for DML exceptions)
        listStack.add(String.valueOf(   method   ); 
 
       
        listStack.add(e.getTypeName());
}   
  • June 12, 2008
  • Like
  • 0
Hi,

I have the following apex code that throws this error:
Inline query has too many rows for direct assignment, use FOR LOOP
Code:
 WebService static Integer processRecordsToInsert(List<ID> pupcid,List<ID> palliid,String preason) {
  Integer success=0;
  Integer failure=1;
 try{
  
 List<Partner_Relationship__c> insertedPR = new List<Partner_Relationship__c>();
 List<Account> insertedAcc = new List<Account>();
     Savepoint sp_insert = Database.setSavepoint(); 
 Partner_Relationship__c prd = new Partner_Relationship__c();

   //Get the list of Card UPCs that are not in Partner Relationship object
   List <Card_UPC__c> lupc=[Select id from Card_Upc__c where id NOT IN :pupcid];
   
   //loop thru each UPC, only 2 UPCs therefore loops only 2 times
   for(Card_UPC__c upcdata:[Select Id from Card_Upc__c where Id IN :pupcid ] ){
    
   //loop thru each Alliance, only 2 Alliances therefore loops only 2 times
    for(Account accdata:[Select id from Account where Id IN :palliid] ){              
     prd = new Partner_Relationship__c(Card_Upc__c=upcdata.Id,Alliance_Account__c=accdata.Id,Status__c='Card Partner Discontinued');
          insertedPR.add(prd);      
    }
   }
   Database.SaveResult[] lsr = Database.insert(insertedPR,true);     
   return success;
 
 }catch (DmlException e) {
   
      throw e;
      return failure;
   }catch (Exception e) {
      throw e;
      return failure;
   }           
   }    

 
Appreciate all your valuable feedbacks on this.
Thanks
  • June 04, 2008
  • Like
  • 0
how can i  make the result.isSuccess() to be false?
i wan to test (result.isSuccess()==false)
 
forexample
 
Stirng updateflag = false
Account[] newAcct = new Account(name = 'Acme', billingcity = 'San Francisco');
for(Database.upsertResult result:Account) {
 if (result.isSuccess()==false){updateflag ==false};
}

 

how can i direct throw the errors?

 

for example

 

i got the error

unexpected token: throw

 

global class HelloWorld3 {

WebService static String sayHelloWorld(String userID, String userName) throw Exception{


Account c = [select account.name from account where name =:userName];

 

}

  • June 02, 2008
  • Like
  • 0
i get the error message
Method is not visible: [s.Message].setM1(String)
 
i got the hello.cls,and then how can i use method of Message.cls?
 
 
 
for example
 
file 1 (hello.cls)
 
global class Hello {
 WebService static String sayHelloWorld() {
       
        Message message = new Message();
        message.setM1('d');
        return  message.getM1();
 }
}
 
 
 
file 2  ( Message.cls)
public class Message {
 String M1 = 'Hello world';
 String M2 = 'Hello USA';
 
 void setM1(String argM1) {
        M1 = argM1;
    }
   
    void setM2(String argM2) {
        M2 = argM2;
    }
   
    String getM1(){
        return M1;
    }
   
    String getM2(){
        return M2;
    }
}
  • May 30, 2008
  • Like
  • 0
for examle;
 
global class foo {
webservice string a;
webservice string b;
}

and then

global class my {
webservice static foo echoFoo(foo f) {
return f;
}
}
 
the WSDL for the ws class was included the definition of foo.
but   when I make the tools( WSDL2Java )to the ws.wsdl ,      foo.class is not appeared.
how can many classes  package into the same WSDL(same.wsdl)?
and then use the java-tools(WSDL2Java)  to the  WSDL(same.wsdl),and then i can find many classes just as api(Enterprise WSDL )?
 
for examle
 
class boy{
    string boymethod(){}
}
 
class girl{
string boymethod(){}
}
class friend{
string friendmethod(){}
}
 
how can i make the classes into the same wsdl,and then and then use the java-tools(WSDL2Java)  to the  WSDL(same.wsdl),i can find many classes (class boy,class girl,class friend).how can do it