• James L.
  • NEWBIE
  • 39 Points
  • Member since 2012

  • Chatter
    Feed
  • 1
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 23
    Questions
  • 24
    Replies
Not sure if it's I have not background or it's a bug. Here how I found out:  In Lead Before Edit trigger StateCode, CountryCode are correct, with expected changed value; but State, Country are incorrect, with unchanged values. State, Country are updated to new values in Lead after edit trigger though. Any idea?

The regular approach to execute batch job is use " Database.executeBatch", can batch.execute be called directly? if so, any special attention needed? say I have a batch class like

 

global without sharing class BatchA implements Database.Batchable <sObject>{
    global Database.QueryLocator start(Database.BatchableContext BC){
      return Database.getQueryLocator([select ID from Account]);
   }


   global void execute(Database.BatchableContext BC, List<sObject> scope){
      ...
   }

   global void finish(Database.BatchableContext BC) {

   }

}

 

Is it safe to call like

 

BatchA myBatch = new BatchA();

myBatch.execute(NULL, [select id from account limit 100]);

Hi,
In visualforce, there's code like

This can be used for string output formatting.

Is there simillar one in Apex, like

Dicimal d = 4000.0;
How can I convert it to a string like '4,000.0'

I tried 2 ways, both failed
1) d.format() , this will be displayed like '4,000'
2) String.format: don't know how to use this API. There's no document from SFDC about this

like 

 

String strSQL = 'select field1, field2, field3, field4, field5, field6 from objecta  ';

 

if the string is too long, and better break into multiple lines.

 

How to write this?

 

James

Hi,

 

I know there is a limit of 50,000 records for SOQL for per apex transcation.

What if an aggregation SOQL is used, and only 5 records are returned; however during aggregation on SFDC side, more than 50,000 records are involved. Will this trigger the 50,000 records limit ?

 

James

Hi,

 

#issue 1: OpportunityTeamMember trigger only fired in some cases 

 

I need a trigger which will update numbers after opportunity team member is added or delete. However, I found in following case, the tirgger will not be fired

 

“Add Default Team” on Opportunity team related list in Opportunity view layout

“Add Account Team” on Opportunity team related list in Opportunity view layout

Delete an opporutinty, which will delete OpportunityTeamMember records also

Undelete an opporutinty, which will undelete OpportunityTeamMember records also

 

Any workaround for these cases?

 

#issue 1: How to get Personal setting

I tried to figure out a workround for “Add Default Team” through overwritting it. I tried to read opportunity owner's personal default opportunity team settings, and add them through apex. But how to retrieve Personal setting, like opportunity team settings, through apex. ?

 

Thanks

James

 

Integer[] arr = new Integer[] {3, 31,6,9};

 

loop 1

for (Integer tmp: arr) {

 

}

 

lopp2

for (Integer i=0; i < arr.size();i++) {

    Integer tmp = arr[i]

}

 

Will those 2 loop follow the same order when iterating the array ?

 

 

Hi,

 

How to create a Hierarchy Custom Settings value at default organization level.

Now when I try to create a Hierarchy Custom Settings value, I have to choose the location as either profile or user. There's nowhere to set it as  default organization level

 

James

If put some system.debug statments in the code and keep them in the production. will that affect performance?

I'm using them to do exception tracking

Hi,

 

This is driving me crazy.  

I already set "General -> Editor -> Text Editor -> Insert Sapce for Tab" in Eclipse + SFDC plugin.

This works if I hit TAB key. However in following case

 

    public class UIOppGrp {

 

If I hit ENTER after I input "{", the editor will do the auto-indentation and create a new line. But the new line starts with TAB, instead of space.

 

I found there's Indentation option for Java. But looks like that does not work with Eclipse + SFDC plugin

 

Thanks

James

Hi,

 

Let's say at 9:00AM, I create a change set which includes file A, but I don't uploaded right away. I make some furthur changes to file A; and then at 10:00AM, I upload this change set to another Org. Is the change set as static as 9:00AM, or does it include changes after 9:00AM?

 

Thanks,

James

Hi,

Right now we are rolling up new features, which will involve add a new tab and remove an old one. This change first is updated in all profiles & app setting, but then there's problem, how to add new Tab to all user's personal tab settings. If don't do this, every user, if they already have their own tab setting, will have to add this tab by themselves manually.

 

I checked all objects, looks like there 's no object saving this setting. So where is this preference data saved ? how to access/update it?

 

Thanks

 

James

Hi,

After creating a new formular field, will the newly-created formular field automaticaly take effect for existing data ?

Or do I need to mannually trigger record-editing (like using Data loader to export then import) to make this new formlar effect for exiting data?

 

James

Hi,

 

Apex limit: Total number of records retrieved by SOQL queries: 50,000

 

for  SOQL like [select ID, Account.name from Contact]; from limit perspective, every returned row contributes to the Max limit as one record or 2 records?    the "2 records" ideas came from "The returned result is actually composed from 2 backend tables"

 

James

Hi,

 

I read about this uniqueness before, just want to double check again.

If I create a new role or profile in developer sandbox, and later one deplay this new role or profile to production org. The ID will keep the same, right ?

 

James

Here's my sample code.

 

AddFields, if located in constructor, works; if not, will cause exception:

System.SObjectException: SObject row was retrieved via SOQL without querying the requested field: 

 

<apex:page standardController="account" extensions="LearnVFaddFields" recordSetVar="accounts">
   <apex:form >
   <apex:commandButton value="Change" action="{!changeFields}"/>
   <apex:pageblock >
       <apex:pageblockTable value="{!accounts}" var="acct">
           <apex:repeat value="{!fields}" var="f">
               <apex:column value="{!acct[f]}"/>
           </apex:repeat>
       </apex:pageblockTable>
   </apex:pageblock>
   </apex:form>
</apex:page>



public with sharing class LearnVFaddFields {
    ApexPages.StandardSetController controller;

    public List <String> fields {
        get;
        private set;
    }

    public LearnVFaddFields(ApexPages.StandardSetController controller) {
        List <String> fields = new List <String>{'Name', 'Rating'};
        this.controller = controller;
        updateRows(fields);
    }
    
    private void updateRows(List <String> fields) {
        this.fields = fields;
        controller.reset(); 
        controller.AddFields(fields);        
    }
    
    public PageReference changeFields() {
        List <String> fields = new List <String>{'Phone', 'type'};
        updateRows(fields);
        return null;
    }
}

 


Hi,

Any where to find Standard SFDC styles reference documents.

I can only find some orginal CSS file like dStandard.css.

 

like in case below 

<apex:messages/>

 I don't know which standard SFDC style to apply to it to make it look better.

 

James

Hi,

Anyone can give some use scenaria to show apex:message/apex:pagemessage are for which case?

James

Hi,

 

Any examples of getting Session Id for Oauth by cURL command line.

 

James

In my code stuff below, ID mapped from $Component.xxx is always blank in Javascript.
I tried all the below options. none of them worked
alert('{!$Component.studentName}')
alert('"{!$Component.studentName}"')

however it's mapped correctly in Visualforce code stuff, like
<apex:outputLabel value="{!$Component.studentName}"/>

any idea how to use $Component.xxx correctly in Javascript?

here's the sample code

 

<apex:page controller="LearnWebService1">
<apex:form >
<apex:pageblock >
<apex:messages />
<apex:pageBlockSection columns="1">
<apex:pageBlockSectionItem >
<apex:outputLabel value="{!$Component.studentName}"/> <apex:inputText id="studentName"/>
</apex:pageBlockSectionItem>
</apex:pageBlockSection>
<apex:pageBlockButtons >
<apex:commandButton value="Create Through Ajax Call" onclick="alert('{!$Component.studentName}')"/>
</apex:pageBlockButtons>
</apex:pageblock>
</apex:form>
</apex:page>

 

Hi,
In visualforce, there's code like

This can be used for string output formatting.

Is there simillar one in Apex, like

Dicimal d = 4000.0;
How can I convert it to a string like '4,000.0'

I tried 2 ways, both failed
1) d.format() , this will be displayed like '4,000'
2) String.format: don't know how to use this API. There's no document from SFDC about this

The regular approach to execute batch job is use " Database.executeBatch", can batch.execute be called directly? if so, any special attention needed? say I have a batch class like

 

global without sharing class BatchA implements Database.Batchable <sObject>{
    global Database.QueryLocator start(Database.BatchableContext BC){
      return Database.getQueryLocator([select ID from Account]);
   }


   global void execute(Database.BatchableContext BC, List<sObject> scope){
      ...
   }

   global void finish(Database.BatchableContext BC) {

   }

}

 

Is it safe to call like

 

BatchA myBatch = new BatchA();

myBatch.execute(NULL, [select id from account limit 100]);

Hi,
In visualforce, there's code like

This can be used for string output formatting.

Is there simillar one in Apex, like

Dicimal d = 4000.0;
How can I convert it to a string like '4,000.0'

I tried 2 ways, both failed
1) d.format() , this will be displayed like '4,000'
2) String.format: don't know how to use this API. There's no document from SFDC about this

Hi,

 

I know there is a limit of 50,000 records for SOQL for per apex transcation.

What if an aggregation SOQL is used, and only 5 records are returned; however during aggregation on SFDC side, more than 50,000 records are involved. Will this trigger the 50,000 records limit ?

 

James

Hi,

 

#issue 1: OpportunityTeamMember trigger only fired in some cases 

 

I need a trigger which will update numbers after opportunity team member is added or delete. However, I found in following case, the tirgger will not be fired

 

“Add Default Team” on Opportunity team related list in Opportunity view layout

“Add Account Team” on Opportunity team related list in Opportunity view layout

Delete an opporutinty, which will delete OpportunityTeamMember records also

Undelete an opporutinty, which will undelete OpportunityTeamMember records also

 

Any workaround for these cases?

 

#issue 1: How to get Personal setting

I tried to figure out a workround for “Add Default Team” through overwritting it. I tried to read opportunity owner's personal default opportunity team settings, and add them through apex. But how to retrieve Personal setting, like opportunity team settings, through apex. ?

 

Thanks

James

 

Hi,

 

How to create a Hierarchy Custom Settings value at default organization level.

Now when I try to create a Hierarchy Custom Settings value, I have to choose the location as either profile or user. There's nowhere to set it as  default organization level

 

James

If put some system.debug statments in the code and keep them in the production. will that affect performance?

I'm using them to do exception tracking

Hi,

Right now we are rolling up new features, which will involve add a new tab and remove an old one. This change first is updated in all profiles & app setting, but then there's problem, how to add new Tab to all user's personal tab settings. If don't do this, every user, if they already have their own tab setting, will have to add this tab by themselves manually.

 

I checked all objects, looks like there 's no object saving this setting. So where is this preference data saved ? how to access/update it?

 

Thanks

 

James

Hi,

 

Apex limit: Total number of records retrieved by SOQL queries: 50,000

 

for  SOQL like [select ID, Account.name from Contact]; from limit perspective, every returned row contributes to the Max limit as one record or 2 records?    the "2 records" ideas came from "The returned result is actually composed from 2 backend tables"

 

James

Hi,

 

I read about this uniqueness before, just want to double check again.

If I create a new role or profile in developer sandbox, and later one deplay this new role or profile to production org. The ID will keep the same, right ?

 

James

Hi,

 

Any examples of getting Session Id for Oauth by cURL command line.

 

James

In my code stuff below, ID mapped from $Component.xxx is always blank in Javascript.
I tried all the below options. none of them worked
alert('{!$Component.studentName}')
alert('"{!$Component.studentName}"')

however it's mapped correctly in Visualforce code stuff, like
<apex:outputLabel value="{!$Component.studentName}"/>

any idea how to use $Component.xxx correctly in Javascript?

here's the sample code

 

<apex:page controller="LearnWebService1">
<apex:form >
<apex:pageblock >
<apex:messages />
<apex:pageBlockSection columns="1">
<apex:pageBlockSectionItem >
<apex:outputLabel value="{!$Component.studentName}"/> <apex:inputText id="studentName"/>
</apex:pageBlockSectionItem>
</apex:pageBlockSection>
<apex:pageBlockButtons >
<apex:commandButton value="Create Through Ajax Call" onclick="alert('{!$Component.studentName}')"/>
</apex:pageBlockButtons>
</apex:pageblock>
</apex:form>
</apex:page>

 

Hi All,

 

I want to do certification on salesforce.If any one know which material is usefu Plz guide me.

If any dumps are there plz send me those links.Plz guide me in properway.

 

Thanks in advance,

Manu

  • June 22, 2010
  • Like
  • 0
Anyone knows if it is possible to use the label of a standardbutton to a custom button, something like:

 


<!--This does not work, anyone knows if it is possible? -->
<apex:commandButton value="{!$Action.Account.Save.label}" action="{!save}"/>

 

 

 

  • September 03, 2009
  • Like
  • 0