• aka
  • NEWBIE
  • 0 Points
  • Member since 2011

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 5
    Replies

Please tell me

 

 

 public CustomObject3__c  getProducts() {  ...

 

The above records are returned in an OK

 

 public  list<CustomObject3__c>  getProducts() { ....


I expect to have multiple records are returned above, please tell me the hint error occurs

 

code------------------------------------------------------------------------------------

    CustomObject1__c  names;
    CustomObject3__c fee_new;
    public  list<CustomObject3__c>  getProducts() {
        integer i =1;
        List<CustomObject3__c> fee_dat = new CustomObject3__c[]{};
   //     list dis_fee = new CustomObject3__c();
        fee_new = new CustomObject3__c();
        for (list <CustomObject1__c >  names :
            [SELECT id,name,Field4__c
                , (SELECT link__c,Field6__c from link4U59__r )
                FROM CustomObject1__c
                WHERE Field4__c = null and Field6__c <= '2011'
                order by name,Field6__c]
            )
         {   List<CustomObject1__c> idname =  [select id  from CustomObject1__c where name =: names[i].name LIMIT 1 ];
                fee_new.link__c = idname[0].id;
                fee_new.Field6__c = null;
                fee_new.Field2__c =  null;
                fee_new.Field5__c = 0;
               fee_dat.[i]=fee_new;              /* error occurece */
              i++;
            }
        return fee_dat;
    }

I expect to have multiple records are returned above, please tell me the hint error occurs

errormessege-------------------------------------------------------------------------------------------------

 System.ListException: List index out of bounds: 1

 

  • February 23, 2011
  • Like
  • 0

いかは、画面で入力されたデータを新規に
CustomObject1__c とCustomObject3__c
登録するプロセスですが

CustomObject1__c を登録したのち
CustomObject3__c のlink__cはCustomObject1__cへのlookup項目ですので
 List<CustomObjec・・・
IDを取得後
CustomObject3__c のlink__cへ代入すると

f_new.link__c =  idname;

Illegal assignment from LIST<oac__CustomObject1__c> to Id
というエラーが出ます

解決方法がわかりません

教えてください

public class new_kain {

    CustomObject1__c k_new;
    CustomObject3__c f_new;

    public PageReference save() {
         // Add the account to the database.  
         insert k_new;
       
         List<CustomObject1__c>idname=  [select id  from CustomObject1__c where Name =: k_new.name LIMIT 1 ];

         id.f_new.link__c =  idname;


 

  • February 08, 2011
  • Like
  • 0

public class in the
       AggregateResult [] gr =
            [select count (name) kazu, sum (Field5__c) ttl
            from CustomObject3__c
            group by Field4__c
            order by Field4__c DESC];
The results of the above
<apex:pageBlock>
Please tell me how do I know what I want to use the display.

help me!

  • January 27, 2011
  • Like
  • 0

Please tell me

 

 

 public CustomObject3__c  getProducts() {  ...

 

The above records are returned in an OK

 

 public  list<CustomObject3__c>  getProducts() { ....


I expect to have multiple records are returned above, please tell me the hint error occurs

 

code------------------------------------------------------------------------------------

    CustomObject1__c  names;
    CustomObject3__c fee_new;
    public  list<CustomObject3__c>  getProducts() {
        integer i =1;
        List<CustomObject3__c> fee_dat = new CustomObject3__c[]{};
   //     list dis_fee = new CustomObject3__c();
        fee_new = new CustomObject3__c();
        for (list <CustomObject1__c >  names :
            [SELECT id,name,Field4__c
                , (SELECT link__c,Field6__c from link4U59__r )
                FROM CustomObject1__c
                WHERE Field4__c = null and Field6__c <= '2011'
                order by name,Field6__c]
            )
         {   List<CustomObject1__c> idname =  [select id  from CustomObject1__c where name =: names[i].name LIMIT 1 ];
                fee_new.link__c = idname[0].id;
                fee_new.Field6__c = null;
                fee_new.Field2__c =  null;
                fee_new.Field5__c = 0;
               fee_dat.[i]=fee_new;              /* error occurece */
              i++;
            }
        return fee_dat;
    }

I expect to have multiple records are returned above, please tell me the hint error occurs

errormessege-------------------------------------------------------------------------------------------------

 System.ListException: List index out of bounds: 1

 

  • February 23, 2011
  • Like
  • 0

いかは、画面で入力されたデータを新規に
CustomObject1__c とCustomObject3__c
登録するプロセスですが

CustomObject1__c を登録したのち
CustomObject3__c のlink__cはCustomObject1__cへのlookup項目ですので
 List<CustomObjec・・・
IDを取得後
CustomObject3__c のlink__cへ代入すると

f_new.link__c =  idname;

Illegal assignment from LIST<oac__CustomObject1__c> to Id
というエラーが出ます

解決方法がわかりません

教えてください

public class new_kain {

    CustomObject1__c k_new;
    CustomObject3__c f_new;

    public PageReference save() {
         // Add the account to the database.  
         insert k_new;
       
         List<CustomObject1__c>idname=  [select id  from CustomObject1__c where Name =: k_new.name LIMIT 1 ];

         id.f_new.link__c =  idname;


 

  • February 08, 2011
  • Like
  • 0

public class in the
       AggregateResult [] gr =
            [select count (name) kazu, sum (Field5__c) ttl
            from CustomObject3__c
            group by Field4__c
            order by Field4__c DESC];
The results of the above
<apex:pageBlock>
Please tell me how do I know what I want to use the display.

help me!

  • January 27, 2011
  • Like
  • 0