• michael_hy
  • NEWBIE
  • 25 Points
  • Member since 2011

  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 10
    Questions
  • 8
    Replies

Hi, all 

 I meet one issue, and need someone's help. Thanks.

 

I write below code and it run well.

But after I change the inputField to dynamicComponent, I find just one dropdown list can be display on the page.

Do anyone can knows how to resolve this.

VF
<apex:page showHeader="false" sidebar="false" id="dynamicComponent" controller="DynamicComponent">
<apex:form id="DetailsForm">
<apex:pageBlock mode="edit" id="PageBlock1">
    <apex:actionStatus startText="Loading data....." id="productTypeStatus">
        <apex:facet name="start">
         Loading_data
        </apex:facet>
    </apex:actionStatus>

    <apex:pageBlockSection id="productTypeSec" columns="1" >
      <apex:selectRadio value="{!MOdetail.Type__c}" label="Type_of_Product" id="type">   
        <apex:actionSupport event="onclick" action="{!onClickRadio}" reRender="PageBlock1" status="productTypeStatus"></apex:actionSupport>
        
        <apex:selectoption itemValue="Life" id="Life" itemLabel="Life" ></apex:selectoption>
        <apex:selectoption itemValue="Annuity" id="Annuity" itemLabel="Annuity" ></apex:selectoption>      
      </apex:selectRadio>
    </apex:pageBlockSection>

    life1:{!EnableLife} + annuity1:{!EnableAnnuity}
    <apex:pageBlockSection id="coverageBlock" title="Select_Desired_Coverage" columns="1" rendered="{!EnableLife}">
    <div class="bottomline"></div>

    <!--<apex:inputField value="{!MOdetail.Name__c}" id="bp" />-->
    <apex:dynamicComponent componentValue="{!dynamicDetail}" id="bp" rendered="{!EnableLife}" />
    life2:{!EnableLife} + annuity2:{!EnableAnnuity}
    </apex:pageBlockSection>

    <apex:pageBlockSection id="annuityOptBlock" title="Select_Annuity_Options" columns="1" rendered="{!EnableAnnuity}">
    <div class="bottomline"></div>
    <!--<apex:inputField value="{!MOdetail.Name__c}" id="bpa"/>-->
    <apex:dynamicComponent componentValue="{!dynamicDetail}" id="bpa" rendered="{!EnableAnnuity}"/>
    life3:{!EnableLife} + annuity3:{!EnableAnnuity}
    </apex:pageBlockSection>
    
</apex:pageBlock>
</apex:form>
</apex:page>

 

Controller:

public with Sharing class DynamicComponent{
public Boolean EnableLife{get;set;}
public Boolean EnableAnnuity{get;set;}
public MyObject__c MOdetail{get;set;}


public DynamicComponent(){
    MOdetail = new MyObject__c();
    EnableLife = false;
    EnableAnnuity = false;
}

public void onClickRadio(){
   
        system.debug('huyu: ' + MOdetail.Type__c);
        if(MOdetail.Type__c == 'Life')
        {
            EnableLife = true;
            EnableAnnuity = false;
            MOdetail.Name__c = 'Life';
        }
        else if(MOdetail.Type__c == 'Annuity')
        {
            EnableLife = false;
            EnableAnnuity = true;
            MOdetail.Name__c = 'Annuity';
        }
        system.debug('enable Life and enable annuity : ' + EnableLife + ' : ' + EnableAnnuity );
    }
    
public component.apex.pageBlockSectionItem getDynamicDetail() {
        system.debug('huyu-invoke getDynamicDetail');
        component.apex.pageBlockSectionItem optpane = new  component.apex.pageBlockSectionItem();
        component.apex.outputLabel label=new component.apex.outputLabel();
        label.value='Payment Frequency*';
        
        component.apex.selectList selList=new component.apex.selectList();
        selList.id='PaymentFrequency';
        selList.size=1;
        selList.childComponents.add(getSelectOption('aaa','value1','key1'));  
        selList.childComponents.add(getSelectOption('bbb','value2','key2'));    
        selList.childComponents.add(getSelectOption('ccc','value3','key3'));    
        //selList.onchange='jsDynamicAllowedValue(this.options[this.selectedIndex].value);';
        
        optpane.childComponents.add(label);
        optpane.childComponents.add(selList);
        
        system.debug(optpane);
        return optpane;
    }  
    
public component.apex.selectOption getSelectOption(String domainName,String label,String value)
    {
        component.apex.selectOption opt=new component.apex.selectOption();
        opt.id='OPT_'+domainName+'_'+value;
        opt.itemLabel=label;
        opt.itemValue=value;
        
        return opt;
    }
}

 

Hi, So far I have an issue about dynamicComponent.
Hope someone can spend time on this. Thanks.

 

I have a page as below.

<apex:pageBlockSection columns="1" id="billingDetails">
      <apex:inputField id="billingFreq" value="{!objBillingPayerInfoController.payerInfo.Billing_Frequency__c}"/>
      <apex:inputField id="billingMeth" styleClass="billingpayerSelect" value="{!objBillingPayerInfoController.payerInfo.Billing_Method__c}">
      <!--<apex:dynamicComponent id="billingFreq" componentValue="{!DynamicAllowedValueServiceControllerObj.BillingFrequency}"/>-->
      <!--<apex:dynamicComponent id="billingMeth" componentValue="{!DynamicAllowedValueServiceControllerObj.BillingMethod}" />-->
      <apex:actionSupport event="onchange" action="{!objBillingPayerInfoController.loadBillingMethodSection}" rerender="billingDetails,eftAcctSec,creditCardSec" status="payerUpdateAction" />
      </apex:inputField>
 
                 
                  
                  <apex:pageBlockSection columns="1" collapsible="false" title="Credit Card Details" id="creditCardSec" rendered="{!objBillingPayerInfoController.showCreditCardDetails}">
                  <apex:inputField id="creditCardType" value="{!objBillingPayerInfoController.creditCardDetails.CreditCardType__c}" />
                  <apex:inputField id="creditCardNum" value="{!objBillingPayerInfoController.creditCardDetails.Card_Number__c}" />  
                  <apex:inputField id="cardHoldNum" value="{!objBillingPayerInfoController.creditCardDetails.NameOnCard__c}" />
                  <apex:inputField id="expiryDate" value="{!objBillingPayerInfoController.creditCardDetails.ExpiryDate__c}" />
                   
                  </apex:pageBlockSection> 
                   
                  <div class="bottomline"></div>
      </apex:pageBlockSection>   

loadBillingMethodSection() method is used to set showEftAccountSec property.

So the second pageBlockSection can display when I change the value in dropdown list.

 

 It run well if I use the apex:inputField label.

But after I change the inputField to dynamicComponent, the event onchange() cann't be invoke.

Do anyone knows how to resolve this?

Hi, guys.

 I met one issue on our project. 

ApplicantInformationController is a Apex class and loadHomeInfo() is a method in ApplicantInformationController.

So far when I click the checkbox, I want to invoke the loadHomeInfo(), but cannot successful.

 

Below is my code. Please help on this. thanks.

 

PS: the alert can popup, but CallActionFunctionForAddressSync is not run successful.

 

When first load the page, and click the checkbox, CallActionFunctionForAddressSync cannot run, but when click twice, CallActionFunctionForAddressSync can run successful.

 

Do anyone know why the method cannot run at first load?

 

<apex:inputCheckbox value="{!objApplicantInformationController.workAddress.IsSameAsHomeAddress__c}" id="IsSameAsHomeAddress" onclick="deselectOther(this);">      
                    </apex:inputCheckbox>  
                    
                    <apex:actionFunction name="CallActionFunctionForAddressSync" action="{!objApplicantInformationController.loadHomeInfo}" rerender="psec3" status="addressUpdateAction" oncomplete="alert('hi');">
                        <apex:param name="WorkIsHome" value=""/>
                    </apex:actionFunction>


<script type="text/javascript">

function deselectOther(chkBox)
    {  
        alert("checkBox_clicked");
        alert(chkBox.checked);
        var id;
        if(chkBox.checked)
        {
            id=chkBox.id;
            CallActionFunctionForAddressSync(1);
        }
        else
        {
            CallActionFunctionForAddressSync(2);
        }
        alert("deselect_other_complete");     
    }
</script>   

 

Hi, Guys.

 So far I have an issue on VF extensions.

 

Customer Controller 1

public  with sharing class DateTimeController1 {
     
    public DateTimeController1() {}
    public DateTimeController1(DateTimeController2 controller) {}
  
    DateTime t1;
    transient DateTime t2;
    String t3 ='Test111';

    public String getT1() {
        if (t1 == null) t1 = DateTime.parse('9/11/2012 11:16 AM');
        return ('' + t1).replace(' ','%20');
    }

    public String getT2() {
        if (t2 == null) t2 = System.now();
        return '' + t2;
    }

    public String getT3() {
        return '' + t3;
    }
}

 Customer Controller 2

public  with sharing class DateTimeController2 {
    String t1{get;set;}
    String t2{get;set;}
    String t3;
       
    public DateTimeController2() {}
    
    public DateTimeController2(String t1, String t2, String t3) {
        setT3(t3);
    }
    
    public PageReference search() {
    
        system.debug('DDDDDT1:' + t1);
        system.debug('DDDDDT2:' + t2);
        system.debug('DDDDDT3:' + t3);

//String str1 = 'SELECT Id, Name, CurrentTime__c from DateTimeTest__c where CurrentTime__c = :t1';
        //List<DateTimeTest__c> L1 = Database.query(str1);
        //for (DateTimeTest__c dt1 : L1){
        //    system.debug(dt1);
       //} return null; } public void setT3(String t3){ this.t3 = t3; } }

VF page:

<apex:page id="testDateTime" showHeader="false" controller="DateTimeController2" extensions="DateTimeController1">
  

  <apex:form >
  T1: <apex:outputText id="t1" value="{!t1}"></apex:outputText><br/>
  T2: <apex:outputText id="t2" value="{!t2}"></apex:outputText><br/>
  T3: <apex:outputText id="t3" value="{!t3}"></apex:outputText><br/><br/>

    <apex:commandLink value="refresh"/><br/><br/>
    <apex:commandButton action="{!search}" value="Search the Date Time"/>
  </apex:form>
</apex:page>

 When I access this VF page. I can see the data display on the page.

But when I click the button and see the debug log.

I can see the search() method has been invoked.

But both t1, t2, and t3 are null.

Why can't set the data to controller2? 

And How to transfe the data between two Customer Controller?

Thanks.

Hi, friends

  I have two Visualforce apps deploy on the salesforce.com.

They are in the different instance and use different accounts to login.

So far I need link one to another.

How to share login credentials without login again?

Thanks.

Hi friends:

About this I have a scenerio: if we are not log in to our application or the application is not active, someone sends me a message. The next time, I success to login or the application is active, the message should be displayed as a push notification on the device.

 

So far I can get message by using ChatterMessage Object.

http://www.salesforce.com/us/developer/docs/api/Content/sforce_api_objects_chattermessage.htm

But this object do not have a field to know whether this message has been read. And if we want to use SentDate to judge it, We also donot know when the user has offline.

How to resolve this, do anybody can help about this.

Thanks.

Hello guys

I want to use Apex code to search the chatter history.

I find a standard object "ChatterMessage " at below link, but when I get some search it has an error.

http://www.salesforce.com/us/developer/docs/api/Content/sforce_api_objects_chattermessage.htm

And I'm also unable to edit the  "Manage Chatter Messagespermission on my System Administrator profile, should this be so? Could anybody can help me about this?

 

String userid='00590000000laxMAAQ';
String str = 'SELECT Body, ConversationId, SentDate FROM ChatterMessage WHERE SenderId= :userid';
LIST<SObject> L = Database.query(str);

 

 

EXCEPTION: System.QueryException: sObject type 'ChatterMessage' is not supported.
STACKTRACE: AnonymousBlock: line 3, column 1
LINE: 3 COLUMN: 1

 


Hello.

So far I want to use Apex class to send chatter message,

And use my mobile app to invoke this Aapex class.

Could anybody can help me about how to do this in Apex?

Is there some Object about chatter message in Apex?

 

Hello guys

I have a question about the chatter.

so far, I want to use chatter rest API to sent real time message to the users.

After do some research, I know it is easy to do this on the web page

But how to do the same things from the Android app?

below link is to show how to send message from the web page.

Could anybody can help me about this. thanks so much.

 

ps: in other hand, I can use mobile app to invoke the APEX class,

Know how to send real time message in APEX class also can resolve my question.

 

send chatter message from web page

 

Hello
I have a task that need to use our own help text on the customer object by click the Help for this Page
I know there has a Context-Sensitive Help Setting to use s-control or Visualforce page to instand standard Help & Training.

Now I have a zip file named webHelp.zip, in this file have some htm(index.htm and a lot of others topic.htm), css, js and gif file.
The main page is index.htm
so could I upload this zip file to Static Resources and use index.htm in Visualforce page?
I need to go though the others page via index.htm.How to write this visualforce page?
Did anyone can help on this problem?


Thanks!

what if we dont have connected app in our create new app as i want to use canvas app into my saleforce sandbox.

 

 

can anyone tell me how to create that in sandbox.

 

Hi, Guys.

 So far I have an issue on VF extensions.

 

Customer Controller 1

public  with sharing class DateTimeController1 {
     
    public DateTimeController1() {}
    public DateTimeController1(DateTimeController2 controller) {}
  
    DateTime t1;
    transient DateTime t2;
    String t3 ='Test111';

    public String getT1() {
        if (t1 == null) t1 = DateTime.parse('9/11/2012 11:16 AM');
        return ('' + t1).replace(' ','%20');
    }

    public String getT2() {
        if (t2 == null) t2 = System.now();
        return '' + t2;
    }

    public String getT3() {
        return '' + t3;
    }
}

 Customer Controller 2

public  with sharing class DateTimeController2 {
    String t1{get;set;}
    String t2{get;set;}
    String t3;
       
    public DateTimeController2() {}
    
    public DateTimeController2(String t1, String t2, String t3) {
        setT3(t3);
    }
    
    public PageReference search() {
    
        system.debug('DDDDDT1:' + t1);
        system.debug('DDDDDT2:' + t2);
        system.debug('DDDDDT3:' + t3);

//String str1 = 'SELECT Id, Name, CurrentTime__c from DateTimeTest__c where CurrentTime__c = :t1';
        //List<DateTimeTest__c> L1 = Database.query(str1);
        //for (DateTimeTest__c dt1 : L1){
        //    system.debug(dt1);
       //} return null; } public void setT3(String t3){ this.t3 = t3; } }

VF page:

<apex:page id="testDateTime" showHeader="false" controller="DateTimeController2" extensions="DateTimeController1">
  

  <apex:form >
  T1: <apex:outputText id="t1" value="{!t1}"></apex:outputText><br/>
  T2: <apex:outputText id="t2" value="{!t2}"></apex:outputText><br/>
  T3: <apex:outputText id="t3" value="{!t3}"></apex:outputText><br/><br/>

    <apex:commandLink value="refresh"/><br/><br/>
    <apex:commandButton action="{!search}" value="Search the Date Time"/>
  </apex:form>
</apex:page>

 When I access this VF page. I can see the data display on the page.

But when I click the button and see the debug log.

I can see the search() method has been invoked.

But both t1, t2, and t3 are null.

Why can't set the data to controller2? 

And How to transfe the data between two Customer Controller?

Thanks.

Hello all,

 

I am working in adding a dynamic component to a vf page that loads a field set and some other stuff into a page section at the bottom of the mentioned VF page. The idea is that when the user focuses on a picklist field that is part of a row of records displayed in a pageblock table, the dynamic component should update with the correct set of field sets on a pageblocksection below the table. The thing is that it is not doing this because I cannot ge tthe current record id (the row in the table where the user is focusing) to be passed to the controller and therefore it is getting NULL Since the code in the controller has a validation to return null IF hte current record is null, nothing is happening. Yet if I perform changes to other fields on the row the record id is passed just fine back to the controller. can someone assist! Below is the VF page, the controller nad the debug result, where I highlight the relevant parts.

 

Thanks!

 

Debug log:

15:08:28.452 (452150000)|USER_DEBUG|[317]|DEBUG|#### DETCOMP- CurrSOI: null

 

VF PAGE:

<apex:page controller="VF_SalesDoc_CreateDoc_Controller_MR" tabStyle="SCRB_SalesOrder__c" >
<!--I'VE REMOVED PART OF THE PAGE DUE TO SIZE RESTRICTIONS ON THE POST, BUT IT IS NOT RELEVANT TO THE ISSUE>
<apex:sectionHeader title="Create Sales Document" subtitle="{!Account.Name}"/>
<apex:messages />
<apex:form id="theForm">

<apex:pageblock title="Sales Order Items" tabStyle="SCRB_SalesOrder__c" >
<apex:pageBlockButtons location="top" >
<apex:commandButton action="{!AddSOI}" value="Add New Item" rerender="tablePnl" disabled="{!NOT(SOsaved)}" id="btnAddSOI" />
</apex:pageBlockButtons>

<apex:outputPanel id="tablePnl">
<apex:pageblockTable value="{!SOItems}" var="SOI" id="SOIList" columnsWidth="25px, 50px, 100px, 100px, 25px, 25px, 50px, 50px, 50px, 50px, 50px, 25px" columns="12" >

<apex:column headerValue="Action">
<apex:commandLink value="Del" action="{!del}" rerender="tablePnl" style="font-weight:bold" >&nbsp;|&nbsp;
<apex:param name="delname" value="{!SOI.id}" assignTo="{!currSOIid}"/>
<apex:outputLink title="" value="/{!SOI.id}" style="font-weight:bold" target="_blank" >View</apex:outputLink>
</apex:commandLink>
</apex:column>

<apex:column headerValue="Line type">
<apex:actionRegion id="lnTypeRgn">
<apex:inputField value="{!SOI.Line_Type__c}" id="fLineType">
<apex:actionSupport event="onblur" reRender="detailBlock" action="{!loadSOIDetComponent}">
<apex:param name="currSOIid" value="{!SOI.Id}" assignTo="{!currSOIid}"/>
</apex:actionSupport>
</apex:inputField>
{!SOI.id}
</apex:actionRegion>
</apex:column>


<apex:column headerValue="Product">
<apex:actionRegion id="prodRgn">
<apex:inputField value="{!SOI.ProductId__c}" id="fProd">
<apex:commandLink id="lknProduct" action="{!updateSOIProductData}" value="Refresh" reRender="tablePnl,fDiscAmt,fTotalPrice,fProfit,colProfit">
<apex:param name="currSOI" value="{!SOI.Id}" assignTo="{!currSOIid}"/>
</apex:commandLink>
</apex:inputField>
</apex:actionRegion>
</apex:column>

<apex:column headerValue="Description">
<apex:inputField value="{!SOI.Description__c}" id="fDescr" />
</apex:column>

<apex:column headerValue="Quantity">
<apex:actionRegion >
<apex:inputField value="{!SOI.Quantity__c}" id="fQTY">
<apex:actionSupport event="onchange" rerender="fDiscAmt,fTotalPrice,fProfi,colProfit" action="{!calculateTotalPrice}">
<apex:param name="currSOIQty" value="{!SOI.Id}" assignTo="{!currSOIid}"/>
</apex:actionSupport>
</apex:inputField>
</apex:actionRegion>
</apex:column>
<apex:column headerValue="Unit Cost" >
<apex:inputField value="{!SOI.Unit_Cost__c}" id="fUnitCost" />
</apex:column>
<apex:column headerValue="Sales Price ex VAT">
<apex:inputField value="{!SOI.SalesPrice__c}" id="fSalesPrice" >
<apex:actionSupport event="onchange" rerender="fDiscAmt,fTotalPrice,fProfit,colProfit" action="{!calculateTotalPrice}">
<apex:param name="currSOISlsPr" value="{!SOI.Id}" assignTo="{!currSOIid}"/>
</apex:actionSupport>
</apex:inputField>
</apex:column>
<apex:column headerValue="Line Disc Pct.">
<apex:inputField value="{!SOI.Line_Discount_Pct__c}" id="fDiscPct">
<apex:actionSupport event="onchange" rerender="fDiscAmt,fTotalPrice,fProfit,colProfit" action="{!calculateTotalPrice}">
<apex:param name="currSOIPct" value="{!SOI.Id}" assignTo="{!currSOIid}"/>
</apex:actionSupport>
</apex:inputField>
</apex:column>
<apex:column headerValue="Line Disc Amt.">
<apex:inputField value="{!SOI.Line_Discount_Amount__c}" id="fDiscAmt">
<apex:actionSupport event="onchange" rerender="fDiscAmt,fTotalPrice,fProfit,colProfit" action="{!calculateTotalPrice}">
<apex:param name="currSOIPAmt" value="{!SOI.Id}" assignTo="{!currSOIid}"/>
</apex:actionSupport>
</apex:inputField>
</apex:column>
<apex:column headerValue="Profit" id="colProfit" >
<apex:outputField value="{!SOI.Profit__c}" id="fProfit"/>

</apex:column>
<apex:column headerValue="Total Price">
<apex:inputField value="{!SOI.TotalPrice__c}" id="fTotalPrice">
<apex:actionSupport event="onchange" rerender="fDiscAmt,fTotalPrice,fProfit,colProfit" action="{!calculateTotalPrice}">
<apex:param name="currSOIPct" value="{!SOI.Id}" assignTo="{!currSOIid}"/>
</apex:actionSupport>
</apex:inputField>
</apex:column>
<apex:column headerValue="Line Status" >
<apex:outputField value="{!SOI.Line_Status__c }" id="fLineStatus" />
</apex:column>
</apex:pageBlockTable>
</apex:outputPanel>

<!--Dynamic ajax rerender section that depends on above selected values for the table row. TO COMPLETE-->
<apex:outputPanel id="detailBlock">
<apex:dynamicComponent componentValue="{!SOIDetComponent}" />
</apex:outputPanel>

</apex:pageblock>

</apex:form>
</apex:page>

 

 

CONTROLLER CODE: PART OF THE CODE HAS BEEN REMOVED TO SIZE RESTRICTIONS

public class VF_SalesDoc_CreateDoc_Controller_MR {


//custom exceptions
public class SalesOrderItemsException extends Exception {}
public class SalesOrderItemDetailException extends Exception {}

//class variables
private salesOrderManager som; // TODO: MOVE ALL THE CODE RELEVANT TO THIS CLASS: SOQLs, DMLs and getter/setter methods for SO, SOIs and SOIDetails
private SCRB_SalesOrder__c so;
private List<SCRB_SalesOrderLineItem__c> SOIs = new List<SCRB_SalesOrderLineItem__c>();
public List<SCRB_SalesOrderLineItem__c> forDeletion = new List<SCRB_SalesOrderLineItem__c>();
private SCRB_SalesOrderLineItem__c currSOI;
private PriceBookEntry pbEntry;
public List <Sales_Order_Item_Detail__c> SOIDetails;
public Component.Apex.PageBlockSection SOIdetSection;

//page parameters //
private String PageAction;
private String DocType;
private Id accountId;
private Id contactId;
public String mPricebook;

public Account account {get; private set;}
public Opportunity opportunity {get; private set;}

public String getcurrLineType() {
return currSOI.Line_Type__c;
}

public String currSOIid {
get{
return currSOI.id;}
set {
if(value <> null ){
for(SCRB_SalesOrderLineItem__c soi: SOIs) {
if (soi.id == value) {
currSOI = soi;
}
}
} else {
currSOI = null;}
}
}


public PageReference cancel() {
PageReference sop= new ApexPages.StandardController(so).view();
sop.setRedirect(true);
return sop;
}

//**Controller constructor**///////////////////////////////////
public VF_SalesDoc_CreateDoc_Controller_MR() {
//check if its a new action, if so prepopulate fields:
Id id = ApexPages.currentPage().getParameters().get('id');
PageAction = ApexPages.currentPage().getParameters().get('PageAction');
DocType = ApexPages.currentPage().getParameters().get('DocType');
accountId = ApexPages.currentPage().getParameters().get('aId');
contactId = ApexPages.currentPage().getParameters().get('cId');

//create a Sales Order Manager and load new/existing Sales Order
som = new SalesOrderManager();
try{
so = loadSalesOrder(id);
}catch (Exception e) {
ApexPages.addMessages(e);
}
if (PageAction != null) {
if (PageAction == 'New') {
// we arrived from account so we load this account into the header
account = som.loadAccount(accountid);
this.populateSOwithAccount(account);
so.Pricebook__c = 'Standard Price Book';
}
}else {
//if SO exists then load SOIs
SOIs = som.loadSOIs (this.so.id);
for(SCRB_SalesOrderLineItem__c soi: SOIs){
if(soi.Productid__c <> null ) {
Product2 pProd = [Select id, name, ProductCode,Description, IsActive, Unit_Cost__c, Product_Type__c, License_Type__c From Product2 where id = :soi.Productid__c];
PriceBook2 pb = [SELECT Id,IsStandard,Name FROM Pricebook2 WHERE IsStandard = True Limit 1];
pbEntry = [SELECT Id,Pricebook2Id,Product2Id,ProductCode,UnitPrice FROM PricebookEntry WHERE Product2Id = :pProd.Id AND PriceBook2Id = :pb.id Limit 1];
soi.SalesPrice__c = pbEntry.UnitPrice;
soi.Unit_Cost__c = pProd.Unit_Cost__c;
soi.Description__c = pProd.Description;
}
}
}
}
//**end of controller constructor**////////////////////////////

 




//Sales Order Item Detail Methods://////////////////////////////////////

public component.Apex.PageBlockSection getSOIDetComponent () {
return SOIdetSection;
}
public PageReference loadSOIDetComponent() {
//Create teh dynamic component to populate with other components depending on the selected LineType
Component.Apex.PageBlockSection section = new Component.Apex.PageBlockSection (collapsible = True,title = 'Sales Order Item Details: ',showHeader = True);
List<Sales_Order_Item_Detail__c> SOIdets;
system.debug('#### DETCOMP- CurrSOI: ' + currSOI);

if(currSOI <> null) {
//get curr LineType
String lnType = getcurrLineType();
System.debug('#### currLineType: ' + getcurrLineType());
//validate which line type is selected and create the correct components:
if(lnType == 'Course') {
//load the required fields and also component to add contacts(course registrations)
Component.apex.PageBlockSectionItem pbsi = new Component.apex.PageBlockSectionItem ();
List<Schema.FieldSetMember> fs = SObjectType.SCRB_SalesOrderLineItem__c.FieldSets.Courses.getFields();
for(Schema.FieldSetMember f :fs ){
Component.apex.inputField ff = new Component.apex.inputField(value = f.getFieldPath());
section.childComponents.add(ff);
}
SOIdetSection = section;
}else if (lnType == 'Resource'){
SOIdetSection = section;
}else if (lnType == 'Item'){
SOIdetSection = section;
}
}
//it is a new Sales Order and therefore no SOIs loaded, send back null section
return null;
}
}

Hello guys

I want to use Apex code to search the chatter history.

I find a standard object "ChatterMessage " at below link, but when I get some search it has an error.

http://www.salesforce.com/us/developer/docs/api/Content/sforce_api_objects_chattermessage.htm

And I'm also unable to edit the  "Manage Chatter Messagespermission on my System Administrator profile, should this be so? Could anybody can help me about this?

 

String userid='00590000000laxMAAQ';
String str = 'SELECT Body, ConversationId, SentDate FROM ChatterMessage WHERE SenderId= :userid';
LIST<SObject> L = Database.query(str);

 

 

EXCEPTION: System.QueryException: sObject type 'ChatterMessage' is not supported.
STACKTRACE: AnonymousBlock: line 3, column 1
LINE: 3 COLUMN: 1

 


Hello guys

I have a question about the chatter.

so far, I want to use chatter rest API to sent real time message to the users.

After do some research, I know it is easy to do this on the web page

But how to do the same things from the Android app?

below link is to show how to send message from the web page.

Could anybody can help me about this. thanks so much.

 

ps: in other hand, I can use mobile app to invoke the APEX class,

Know how to send real time message in APEX class also can resolve my question.

 

send chatter message from web page

 

Hello
I have a task that need to use our own help text on the customer object by click the Help for this Page
I know there has a Context-Sensitive Help Setting to use s-control or Visualforce page to instand standard Help & Training.

Now I have a zip file named webHelp.zip, in this file have some htm(index.htm and a lot of others topic.htm), css, js and gif file.
The main page is index.htm
so could I upload this zip file to Static Resources and use index.htm in Visualforce page?
I need to go though the others page via index.htm.How to write this visualforce page?
Did anyone can help on this problem?


Thanks!