• china.leaf
  • NEWBIE
  • 0 Points
  • Member since 2008

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 13
    Questions
  • 16
    Replies

Is there any limition for the apex class send email

 

 

Thanks very much! 

Hi All,

 

I Can't add the task trigger to my package?

 

 

when "Component Type" selected "apex trigger", the task trigger doesn't in the trigger list, why?

 

Thank you!

 

 

I want to override the report tab , isn't it possible

I want to know whether a datetime is holiday through the setting of holiday?

 

thank you!

var _handleFailure = function(error){alert(error); };

var _parseXml = function(response){

     alert(response);

};

$(document).ready(function(){

    sforce.connection.remoteFunction({

          url : 'https://emea.salesforce.com/servlet/servlet.ReportList?sessionid={!$Api.Session_ID}'

        , onSuccess : _parseXml

        , onFailure : _handleFailure

        , async : true });

});

 

 

Return this message:


<?xml version="1.0" ?>
<result>
Invalid session.
</result>

 

Why?How to set the session?

I want to get the report list in apex class, is it possible?

system.debug(System.Encodingutil.urlEncode('你好', 'gb2312'));

output  "%C4%E3%BA%C3"

 

system.debug(System.Encodingutil.urlEncode('你好', 'utf-8'));

output  "%E4%BD%A0%E5%A5%BD"

 

 

Page:

<apex:inputTextarea value="{!fchrMsg}" id="fchrMsg"/>

class:

    public string fchrMsg{
        get{
            if(fchrMsg == null){
                string fchrTmpMsg = ApexPages.currentPage().getParameters().get('msg');
                if(fchrTmpMsg != null)
                    fchrMsg = System.Encodingutil.urlDecode(fchrTmpMsg, 'gb2312');
                else
                    fchrMsg = '';
            }
            return fchrMsg;
        }
        set{
            fchrMsg = value;
        }
    }

I want to receive parameter by the url "mypage?msg=%C4%E3%BA%C3"

 

but i get a null value

 

Who can help me!

Message Edited by china.leaf on 05-12-2009 12:54 AM
Message Edited by china.leaf on 05-12-2009 01:27 AM

system.debug(System.Encodingutil.urlEncode('你好', 'gb2312'));

output  "%C4%E3%BA%C3"

 

system.debug(System.Encodingutil.urlEncode('你好', 'utf-8'));

output  "%E4%BD%A0%E5%A5%BD"

 

 

Page:

<apex:inputTextarea value="{!fchrMsg}" id="fchrMsg"/>

class:

    public string fchrMsg{
        get{
            if(fchrMsg == null){
                string fchrTmpMsg = ApexPages.currentPage().getParameters().get('msg');
                if(fchrTmpMsg != null)
                    fchrMsg = System.Encodingutil.urlDecode(fchrTmpMsg, 'gb2312');
                else
                    fchrMsg = '';
            }
            return fchrMsg;
        }
        set{
            fchrMsg = value;
        }
    }

I want to receive parameter by the url "mypage?msg=%C4%E3%BA%C3"

 

but i get a null value

 

Who can help me!

 

 

Message Edited by china.leaf on 05-12-2009 12:53 AM
Message Edited by china.leaf on 05-12-2009 01:27 AM

I am getting this error while creating apex from WSDL.

 

Unable to find schema for element; {http://www.w3.org/2001/XMLSchema}string

 

this is my wsdlfrom axis2 web service), someone help me?

 

<wsdl:definitions xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://www.example.org/isms/" targetNamespace="http://www.example.org/isms/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
<wsdl:types>
<s:schema targetNamespace="http://www.example.org/isms/">
<s:element name="isms">
<s:complexType>
<s:sequence>
<s:element name="in" type="s:string"/>
</s:sequence>
</s:complexType>
</s:element>
<s:element name="ismsResponse" type="s:string" />
<s:element name="ismsRequest" type="s:string" />
</s:schema>
</wsdl:types>
<wsdl:message name="ismsRequest">
<wsdl:part name="parameters" element="tns:ismsRequest">
</wsdl:part>
</wsdl:message>
<wsdl:message name="ismsResponse">
<wsdl:part name="parameters" element="tns:ismsResponse">
</wsdl:part>
</wsdl:message>
<wsdl:portType name="isms">
<wsdl:operation name="isms">
<wsdl:input message="tns:ismsRequest">
</wsdl:input>
<wsdl:output message="tns:ismsResponse">
</wsdl:output>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="ismsSOAP" type="tns:isms">
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="isms">
<soap:operation soapAction="http://www.example.org/isms/isms"/>
<wsdl:input>
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="isms">
<wsdl:port name="ismsSOAP" binding="tns:ismsSOAP">
<soap:address location="http://172.168.2.235:8080/axis2/services/isms/"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>

 

Message Edited by china.leaf on 04-23-2009 01:48 AM
Message Edited by china.leaf on 04-23-2009 02:15 AM
Message Edited by china.leaf on 04-23-2009 02:16 AM
for example:AutoNumber, Checkbox,DateTime,…… and so on.

thank you very much!
Error: Unable to start the Softphone XML subsystem. Please contact your Salesforce.com administrator to rectify this issue.

There is only one machine appear the problem, other machines works well

who can help me?

thank you
A : List<Account> flstAccount = new List<Account>([select id from account]);
B: List<Account> flstAccount = [select id from account];

 What is the difference between A and B?

thank you.


Message Edited by china.leaf on 01-12-2009 11:24 PM
this is my code:

List<string> flstImport = new List<string>();

//add items to flstImport

List<InventoryCheckItem__c> flstInventoryCheckItem = [Select i.ImportId__c, i.Id From InventoryCheckItem__c i where i.ImportId__c in : flstImport];

it works well in sandbox, when deploy, i get the error message:

caused by: System.QueryException: Non-selective query against large object type (more than 100000 rows). Consider an indexed filter or contact salesforce.com about custom indexing.

Even if a field is indexed a filter might still not be selective when:

1. The filter value includes null (for instance binding with a list that contains null)

2. Data skew exists whereby the number of matching rows is very large (for instance, filtering for a particular foreign key value that occurs many times)

Note:

1.there are 402965 records in table InventoryCheckItem__c.
2.i already set ImportId__c "external ID"

My English is very poor, who can help me!~~~~~




Hi,

we have trigger for monitoring the events and Tasks. Earlier these used to get listed when we are building the package. suddendly they stopped listed when i go to "apex trigger" component type while adding triggers to package.

 

Has some behaviour changes from salesforce end regarding the task and event triggers. any info on this will be very helpful.

 

Thank you

surya 

Hi All,

 

I Can't add the task trigger to my package?

 

 

when "Component Type" selected "apex trigger", the task trigger doesn't in the trigger list, why?

 

Thank you!

 

 

I have this controller extension:

 

public class OpportunityClosedLost { public Opportunity opp; public apexpages.standardController controller {get; set;} public opportunityClosedLost(ApexPages.StandardController stdController) { // constructor controller = stdController; this.opp= (Opportunity)stdController.getRecord(); Opportunity opps = (Opportunity)stdController.getRecord(); opps = [SELECT RecordTypeId, StageName FROM Opportunity WHERE id=:system.currentpageReference().getparameters().get('id')]; //VRC opportunity if(opps.RecordTypeId =='012700000009RIb'){ isVrc = true; } //vRad Alliance Opportunity if(opps.RecordTypeId =='012T00000000JJD'){ isAlliance = true; } //EC Opportinity if(opps.RecordTypeId =='012700000005KwS'){ isEc = true; } } public List<SelectOption> getStageOptions(){ List<SelectOption> options = new List<SelectOption>(); options.add(new SelectOption('null','-- Select One --')); Schema.DescribeFieldResult oppStage = Schema.sObjectType.Opportunity.fields.StageName; for (Schema.PickListEntry oppPickVal : oppStage.getPicklistValues()){ // create a selectoption for each pickval options.add(new SelectOption(oppPickVal.getValue(),oppPickVal.getLabel())); } return options; } public Boolean isVrc{ get{ if(isVrc == null){ isVrc = false; } return isVrc; } set; } public Boolean isAlliance{ get{ if(isAlliance == null){ isAlliance = false; } return isAlliance; } set; } public Boolean isEc{ get{ if(isEc == null){ isEc = false; } return isEc; } set; } }

I have written a test class and it is only catching the true situations for the boolean properties colored in blue I am not sure how to test the false condition. I am also unsure how to test the SelectList portion of the code that is red.

 

Here is my test class so far:

 

 

public with sharing class OpportunityClosedLostTest { static testMethod void OpportunityClosedLostTest(){ Opportunity opp1 = new Opportunity(Name = 'Opportunity1', Probability = 20.00, CloseDate = Date.newInstance(System.now().year(),10,10), StageName = 'Prospect', RecordTypeId = '012700000009RIb'); insert opp1; Opportunity opp2 = new Opportunity(Name = 'Opportunity2', Probability = 70.00, CloseDate = Date.newInstance(System.now().year(),12,31), StageName = 'Quote Requested', RecordTypeId = '012700000005KwS'); insert opp2; Opportunity opp3 = new Opportunity(Name = 'Opportunity3', Probability = 50.00, CloseDate = Date.newInstance(System.now().year(),9,18), StageName = 'Competitive Situation', RecordTypeId = '012T00000000JJD'); insert opp3; //Test Opportunity Edit Page VRC Test.SetCurrentPageReference(New PageReference('Page.ClosedOpp')); ApexPages.Standardcontroller sc1 = New ApexPages.StandardController(opp1); System.CurrentPageReference().getParameters().put('id',opp1.Id); OpportunityClosedLost cOpp1 = new OpportunityClosedLost(sc1); System.debug(cOpp1.isVrc); update opp1; //Test Opportunity Detail Page VRC Test.setCurrentPageReference(New PageReference('Page.ClosedOppView')); ApexPages.StandardController sc2 = New ApexPages.StandardController(opp1); System.CurrentPageReference().getParameters().put('id',opp1.id); OpportunityClosedLost cOpp2 = new OpportunityClosedLost(sc2); System.debug(cOpp2.isVrc); update opp1; //Test Opportunity Edit Page EC Test.SetCurrentPageReference(New PageReference('Page.ClosedOpp')); ApexPages.StandardController sc3 = New ApexPages.StandardController(opp2); System.CurrentPageReference().getParameters().put('id', opp2.id); OpportunityClosedLost cOpp3 = new OpportunityClosedLost(sc3); System.debug(cOpp3.isEc); update opp2; //Test Opportunity Detail Page EC Test.SetCurrentPageReference(New PageReference('Page.ClosedOppView')); ApexPages.StandardController sc4 = New ApexPages.StandardController(opp2); System.CurrentPageReference().getParameters().put('id', opp2.id); OpportunityClosedLost cOpp4 = new OpportunityClosedLost(sc4); System.debug(cOpp4.isEc); update opp2; //Test Opportunity Edit Page vRad Alliance Test.SetCurrentPageReference(New PageReference('Page.ClosedOpp')); ApexPages.Standardcontroller sc5 = new ApexPages.Standardcontroller(opp3); System.currentPageReference().getParameters().put('id', opp3.id); OpportunityClosedLost cOpp5 = new OpportunityClosedLost(sc5); System.debug(cOpp5.isAlliance); update opp3; //Test Opportunity Detail Page vRad Alliance Test.setCurrentPageReference(New PageReference('Page.ClosedOppView')); ApexPages.StandardController sc6 = new ApexPages.StandardController(opp3); System.currentPageReference().getParameters().put('id', opp3.id); OpportunityClosedLost cOpp6 = new OpportunityClosedLost(sc6); System.debug(cOpp6.isAlliance); update opp3; } }

 

  • August 31, 2009
  • Like
  • 0

I want to know whether a datetime is holiday through the setting of holiday?

 

thank you!

I have overriden the View button of a custom object to load a custom edit form directly instead of going throught the normal view->edit mode. In this form I created a controller extension where I have a mysave method, which the forms calls instead of save, in this method I want to call the basecontroller save and go back to the list.

 

I found out how to save, but I can't find how to go back to the list of items.

 

I already spent 3 hours on this and I am about to throw the !@###$@ computer thru the window, please help!

Hi all,

 

I think this is simple, but can't quite figure it out. Here's the use case:

 

A teacher has links to lesson plans (an object), 1-10, each residing in a different area of the page. Each lesson plan link sends the following to a new page:

 

Curriculum ID (Lesson_Plans lookup relation), Contact (owner) and number (1-10, since each renders a different template). 

 

I'm trying to build a controller extension so that Lessons either loads the right detail view (pre-populated with the right information, if it exists) OR creates a new record with the information in the URL string, e.g., curriculum ID, contact owner and lesson number. 

 

Any ideas / suggestions on how to make this happen? 

 

Thanks!
--Dave

Hi,

 

We have a scontrol that calls an apex webservice by the API an it was working fine until some days ago that it started to retrieve the following error message (not all the time):

 

 

ERROR: ........... {faultcode:'soapenv:Server', faultstring:'Unable to deserialize inputstream', }

 

This is the summary of the scontrol code:

 

 

<script src="/soap/ajax/13.0/connection.js"></script>
<script src="/soap/ajax/13.0/apex.js"></script>
<Script language="JavaScript">
// here goes another code
function callWS(){
var process = sforce.apex.execute('MyApexWebservice', 'Method1',{param1:1, starting: var_mystart, param2: var_for_param2, param3: var_for_param3 },
function(result){
// here is another logic according to the received result.
if(result[0]!='0'){
// If process hasn´t finished yet it is recalled for next iteration
var_mystart = result[0];
settimeout("callWS();",90);
}
});
}
</script>

 

 

 So now,

 

1: I would like to know what does that error message means? It seems to be a Server side problem.

2. Is there any possible way to catch that error? I already tried to add the "try catch" sentence to the scontrol and to the apex webservice but in none place it is catched.

 

I'd like to catch that kind of error message so I could implement a RETRY method.

 

Thanks to all of you who could help me.

 

Regards,

 

Wilmer

system.debug(System.Encodingutil.urlEncode('你好', 'gb2312'));

output  "%C4%E3%BA%C3"

 

system.debug(System.Encodingutil.urlEncode('你好', 'utf-8'));

output  "%E4%BD%A0%E5%A5%BD"

 

 

Page:

<apex:inputTextarea value="{!fchrMsg}" id="fchrMsg"/>

class:

    public string fchrMsg{
        get{
            if(fchrMsg == null){
                string fchrTmpMsg = ApexPages.currentPage().getParameters().get('msg');
                if(fchrTmpMsg != null)
                    fchrMsg = System.Encodingutil.urlDecode(fchrTmpMsg, 'gb2312');
                else
                    fchrMsg = '';
            }
            return fchrMsg;
        }
        set{
            fchrMsg = value;
        }
    }

I want to receive parameter by the url "mypage?msg=%C4%E3%BA%C3"

 

but i get a null value

 

Who can help me!

Message Edited by china.leaf on 05-12-2009 12:54 AM
Message Edited by china.leaf on 05-12-2009 01:27 AM

system.debug(System.Encodingutil.urlEncode('你好', 'gb2312'));

output  "%C4%E3%BA%C3"

 

system.debug(System.Encodingutil.urlEncode('你好', 'utf-8'));

output  "%E4%BD%A0%E5%A5%BD"

 

 

Page:

<apex:inputTextarea value="{!fchrMsg}" id="fchrMsg"/>

class:

    public string fchrMsg{
        get{
            if(fchrMsg == null){
                string fchrTmpMsg = ApexPages.currentPage().getParameters().get('msg');
                if(fchrTmpMsg != null)
                    fchrMsg = System.Encodingutil.urlDecode(fchrTmpMsg, 'gb2312');
                else
                    fchrMsg = '';
            }
            return fchrMsg;
        }
        set{
            fchrMsg = value;
        }
    }

I want to receive parameter by the url "mypage?msg=%C4%E3%BA%C3"

 

but i get a null value

 

Who can help me!

 

 

Message Edited by china.leaf on 05-12-2009 12:53 AM
Message Edited by china.leaf on 05-12-2009 01:27 AM
Hi
I have Create Custom Object Matter and it's name field is Matter Name.
In matter Layout i have used this field once and when i saw preview if this page then it appears correct.
I have create MatterDetails Page but when i saw it in details section on Matter Details then it appears twice.
Can anyone help me ?
Hi,

I have 2 Tables.
Oppurtunity object is the Parent of Job object.

Iam Querying something like this

String sSql ='SELECT Opportunity__r.Channel__c  FROM Job__c where Id=\'a008000000BxwsS\'';

List <SObject> s = Database.query(sSql);
       
     for (Sobject s1 : s){
            
          Object O1 = s1.get('Opportunity__r.Channel__c');
          Channel = (String)O1;
          }

But It gives me error message

System.SObjectException: Invalid field Opportunity__r.Channel__c for Job__c

I know the field exists and I am able to see it in relationship. But I am unable to retrieve the field using Dynamic Apex "get" method.

Any Help is appreciated.

Thanks

Vinod
this is my code:

List<string> flstImport = new List<string>();

//add items to flstImport

List<InventoryCheckItem__c> flstInventoryCheckItem = [Select i.ImportId__c, i.Id From InventoryCheckItem__c i where i.ImportId__c in : flstImport];

it works well in sandbox, when deploy, i get the error message:

caused by: System.QueryException: Non-selective query against large object type (more than 100000 rows). Consider an indexed filter or contact salesforce.com about custom indexing.

Even if a field is indexed a filter might still not be selective when:

1. The filter value includes null (for instance binding with a list that contains null)

2. Data skew exists whereby the number of matching rows is very large (for instance, filtering for a particular foreign key value that occurs many times)

Note:

1.there are 402965 records in table InventoryCheckItem__c.
2.i already set ImportId__c "external ID"

My English is very poor, who can help me!~~~~~