• takahiro-yonei
  • NEWBIE
  • 0 Points
  • Member since 2011
  • TAO Drive


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

初めて投稿します。基本的な質問でしたら申し訳ありません。

 

apexで、カスタムオブジェクトのタブを開いたときに初めに表示される画面の、URLを取得したいです。

たとえば「会社」というオブジェクトを作ってタブを作り、そのタブをクリックしますと、

登録してある「会社データ」が一覧表示されますが、その一覧表示されている画面です。

 

VisualForceで作成したページから、その画面へのリンクを貼りたいと思っており、

apexで画面遷移ハンドラメソッドを組んで、そのメソッドの中にURLを書く必要があるのですが、

直書きで「/a01/o/」などと書くことは、なるべくしたくないと思っています。

apexのメソッドで一発で、URLが取得できたりしますか?

  • August 17, 2012
  • Like
  • 0

Chatter Workbook page11の下記の実装でNo such columnエラーが発生し、workを進めることができません。

 

アカウントの設定はChatter Workbookに従って Developer Editionを取得して行い、特別な変更は行っていません。

開発はworkbookどおりブラウザのページエディタの、コントローラ編集タブで行っています。

 

ソースコード:

public with sharing class SafeInputController {

    public PageReference go() {
        User user = [select id, CurrentStatus from User where id = :UserInfo.getUserId()];
        user.CurrentStatus = status;
        update user;
        return null;
    }

    public String status { get; set; }
}

 

エラー:

SafeInputController コンパイルエラー: 行 4、列 21 でNo such column 'CurrentStatus' on entity 'User'. If you are attempting to use a custom field, be sure to append the '__c' after the custom field name. Please reference your WSDL or the describe call for the appropriate names.

 

何か設定等でchatter関連開発に必須の手順を飛ばしてしまったか、暗黙の条件を知らずに参照等の制限を外せていない(または手違いで制限してしまった)などがあるだろうかと調べています。

原因、対処方法にお心当たりの方、ぜひご教示ください。どうぞよろしくお願いいたします。

  • June 25, 2012
  • Like
  • 0

いつもお世話になっております。
本日お伺いしたい事は、日付項目のテキストボックスの横に表示されるカレンダーを独自で、HTMLで作成したテキストボックスの隣りに作成したいと考えているのですが可能でしょうか?

分かられる方がいらっしゃいましたら、アドバイスお願い致します。

  • November 11, 2011
  • Like
  • 0
hi,
     here i hav attached my vf and controller code,i hav found the following error... DML requires SObject or SObject list type.....kindly anyone of u help me friends

vf code:
              
<apex:page StandardController="Account" extensions="MultiAdd" id="thePage">
<apex:form >
<apex:pageblock id="pb" >
    <apex:pageBlockButtons >
        <apex:commandbutton value="Add" action="{!Add}" rerender="pb1"/>
        <apex:commandbutton value="Save" action="{!Save}"/>
    </apex:pageBlockButtons>
   
       
        <apex:pageblock id="pb1">
           
        <apex:repeat value="{!lstInner}" var="e1" id="therepeat">
                <apex:panelGrid columns="5">
               
                <apex:panelGrid headerClass="Name">
                    <apex:facet name="header">Del</apex:facet>
                    <apex:commandButton value="X" action="{!Del}" rerender="pb1">
                        <apex:param name="rowToBeDeleted" value="{!e1.recCount}" assignTo="{!selectedRowIndex}"></apex:param>
                    </apex:commandButton>
                </apex:panelGrid>  
               
                <apex:panelGrid title="SPD" >
                    <apex:facet name="header">Country</apex:facet>
                    <apex:inputfield value="{!e1.acct.ShippingCountry}"/>
                </apex:panelGrid>
               
                <apex:panelGrid >
                    <apex:facet name="header">IsActive</apex:facet>
                    <apex:inputfield value="{!e1.acct.Active__c}"/>
                </apex:panelGrid>
               
                <apex:panelGrid >
                    <apex:facet name="header">Name</apex:facet>
                    <apex:inputfield value="{!e1.acct.Name}"/>
                </apex:panelGrid>
            </apex:panelgrid>
        </apex:repeat>
    </apex:pageBlock>
       
</apex:pageblock>
</apex:form>
</apex:page>

controller:

public class MultiAdd
{
   
    //will hold the account records to be saved
    public List<Account>lstAcct  = new List<Account>();
   
    //list of the inner class
    public List<innerClass> lstInner
    {   get;set;    }
   
    //will indicate the row to be deleted
    public String selectedRowIndex
    {get;set;} 
   
    //no. of rows added/records in the inner class list
    public Integer count = 1;
    //{get;set;}
   
   
    ////save the records by adding the elements in the inner class list to lstAcct,return to the same page
    public PageReference Save()
    {
        PageReference pr = new PageReference('/apex/customlookup');
       
        for(Integer j = 0;j<lstInner.size();j++)
        {
            lstAcct.add(lstInner[j].acct);
        }
        insert lstAcct;
        pr.setRedirect(True);
        return pr;
    }
       
    //add one more row
    public void Add()
    {  
        count = count+1;
        addMore();     
    }
   
    /*Begin addMore*/
    public void addMore()
    {
        //call to the iner class constructor
        innerClass objInnerClass = new innerClass(count);
       
        //add the record to the inner class list
        lstInner.add(objInnerClass);   
        system.debug('lstInner---->'+lstInner);           
    }/* end addMore*/
   
    /* begin delete */
    public void Del()
    {
        system.debug('selected row index---->'+selectedRowIndex);
        lstInner.remove(Integer.valueOf(selectedRowIndex)-1);
        count = count - 1;
       
    }/*End del*/
   
   
   
    /*Constructor*/
    public MultiAdd(ApexPages.StandardController ctlr)
    {
   
        lstInner = new List<innerClass>();
        addMore();
        selectedRowIndex = '0';
       
    }/*End Constructor*/
       


    /*Inner Class*/
    public class innerClass
    {      
        /*recCount acts as a index for a row. This will be helpful to identify the row to be deleted */
        public String recCount
        {get;set;}
       
       
        public Account acct
        {get;set;}
       
        /*Inner Class Constructor*/
        public innerClass(Integer intCount)
        {
            recCount = String.valueOf(intCount);       
           
            /*create a new account*/
            acct = new Account();
           
        }/*End Inner class Constructor*/   
    }/*End inner Class*/
}/*End Class*/


                                                                                                    thanks in advance!!!!!!!!!!!!!
はじめまして。
apex開発初心者です。

今回、拡張コントローラのテストに苦戦しております。
いろいろなサイトを参考の上、visualforceページをカレントページにしたり、標準コントローラ、拡張コントローラをインスタン化するテストはできました。

が、最後のsaveと次ページに移るテストの記述方法がわかりません。

saveは、標準のSaveメソッドを呼び、最後にまた別のvisualforceページに遷移したいと思っています。

どなたかご教授お願いいたします。



↓以下が未テスト部分です。
public PageReference save() {

controller.save();    //標準の Saveメソッド
PageReference prevPage = new PageReference('/apex/ABCpage'); 
return prevPage;

}


  • October 22, 2012
  • Like
  • 0

SOQLにて、親オブジェクト(Account)に対する子オブジェクトをサブクエリで取得しようと試みているのですが、

                              ^
ERROR at Row:1:Column:52
Didn't understand relationship '* in FROM part of query call. If you are attempting to use a custom relationship, be sure to append the '__r' after the custom relationship name. Please reference your WSDL or the describe call for the appropriate names.

 

のようなエラーが出て、取得することができません。

 

実行しようとしているSOQLは以下になります。

 

Select Name, (SELECT Name FROM Children) From Account

 

ChildrenオブジェクトはAccountの「カスタム項目 & リレーション」で子リレーション名「Children」を定義しています。

 

以上、よろしくお願いします。

初めて投稿します。基本的な質問でしたら申し訳ありません。

 

apexで、カスタムオブジェクトのタブを開いたときに初めに表示される画面の、URLを取得したいです。

たとえば「会社」というオブジェクトを作ってタブを作り、そのタブをクリックしますと、

登録してある「会社データ」が一覧表示されますが、その一覧表示されている画面です。

 

VisualForceで作成したページから、その画面へのリンクを貼りたいと思っており、

apexで画面遷移ハンドラメソッドを組んで、そのメソッドの中にURLを書く必要があるのですが、

直書きで「/a01/o/」などと書くことは、なるべくしたくないと思っています。

apexのメソッドで一発で、URLが取得できたりしますか?

  • August 17, 2012
  • Like
  • 0

Chatter Workbook page11の下記の実装でNo such columnエラーが発生し、workを進めることができません。

 

アカウントの設定はChatter Workbookに従って Developer Editionを取得して行い、特別な変更は行っていません。

開発はworkbookどおりブラウザのページエディタの、コントローラ編集タブで行っています。

 

ソースコード:

public with sharing class SafeInputController {

    public PageReference go() {
        User user = [select id, CurrentStatus from User where id = :UserInfo.getUserId()];
        user.CurrentStatus = status;
        update user;
        return null;
    }

    public String status { get; set; }
}

 

エラー:

SafeInputController コンパイルエラー: 行 4、列 21 でNo such column 'CurrentStatus' on entity 'User'. If you are attempting to use a custom field, be sure to append the '__c' after the custom field name. Please reference your WSDL or the describe call for the appropriate names.

 

何か設定等でchatter関連開発に必須の手順を飛ばしてしまったか、暗黙の条件を知らずに参照等の制限を外せていない(または手違いで制限してしまった)などがあるだろうかと調べています。

原因、対処方法にお心当たりの方、ぜひご教示ください。どうぞよろしくお願いいたします。

  • June 25, 2012
  • Like
  • 0

Visualforceで作り込んだページにルックアップ付きの入力フォームを組み込みたいと考えています。

 

これを実現するためのApexタグ(<apex:???>)は提供されているでしょうか。

また、提供されていない場合、どのようにすれば実現できるでしょうか。

 

http://boards.developerforce.com/t5/Visualforce-Development/Lookup-button-in-Visualforce-Page/m-p/123275#M12029

 

のあたりを参考にしてみていますが、上手くいかず。。。

 

何かご存知の方、おられましたら、よろしくお願いします。

主従関係のデータ取得についてお尋ねします。

 

SOQLではカスタムオブジェクトであっても、「子オブジェクトから親オブジェクトへのリレーション」と「親オブジェクトから子オブジェクトへのリレーション」が可能だと理解しています。

そこで、Force.com SOQL and SOSL Reference (http://www.salesforce.com/us/developer/docs/soql_sosl/Content/sforce_api_calls_soql_select_examples.htm)のRelationship query: child-to parent with custom objectsの項目に記載されている例文を試してみたのですが、エラーになってます。子オブジェクトから親オブジェクトに遡ってデータを取得することはできないのでしょうか?

 

該当のSOQL:

SELECT Id, FirstName__c, Mother_of_Child__r.FirstName__c FROM Daughter__c WHERE Mother_of_Child__r.LastName__c LIKE 'C%'

いつもお世話になっております。
本日お伺いしたい事は、日付項目のテキストボックスの横に表示されるカレンダーを独自で、HTMLで作成したテキストボックスの隣りに作成したいと考えているのですが可能でしょうか?

分かられる方がいらっしゃいましたら、アドバイスお願い致します。

  • November 11, 2011
  • Like
  • 0

本当に初歩的な質問で申し訳ないのですが、
HTMLはVisualforce。
ではjavascriptはコントローラにプログラムを組めばいいのでしょうか?

 

  • November 04, 2011
  • Like
  • 0