• JieMe
  • NEWBIE
  • 25 Points
  • Member since 2011

  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 6
    Questions
  • 15
    Replies

Hi All,

select firstname,lastname,from user , the soql show

firstname  lastname

David         Lee

 

but i wanna the result like this:

firstnamelastname

DavidLee

 

  • March 06, 2013
  • Like
  • 0

sobject method ,clone(),has four parameters,the first " opt_preserve_id" argument
determines whether the ID of the originalobject is preserved or cleared in the duplicate.
If set to true, the ID is copied to theduplicate. The default is false, that is, the IDis cleared.apex api document .
when i set ,clone(true);it does not work .page is showed:account id can not be inserted.


 Savepoint sp = Database.setSavepoint();
         account newacc;
 
         try {
 
              //copy the purchase order - ONLY INCLUDE THE FIELDS YOU WANT TO CLONE
             acc = [select Id, Name from account where id = :acc.id];
             newacc = acc.clone(true);
             insert newacc;
 
             // set the id of the new acc created for testing
               newRecordId = newacc.id;
 
             // copy over the line cons - ONLY INCLUDE THE FIELDS YOU WANT TO CLONE
             List<Contact> cons = new List<Contact>();
             for (Contact con : [Select c.Id,c.Name From Contact c where accountid = :acc.id]) {
                  Contact newcon = con.clone(true);
                  newcon.accountid = newacc.id;
                  cons.add(newcon);
             }
             insert cons;
 
         } catch (Exception e){
             // roll everything back in case of error
            Database.rollback(sp);
            ApexPages.addMessages(e);
            return null;
         }

 

hi guys,did u meet the case?

Thanks!


  • October 30, 2012
  • Like
  • 0

content as follows:

 

<apex:form >
        <apex:commandButton value="删除"  onclick="delMoreIMember()"/>
        <apex:pageBlock >
         <apex:pageBlockButtons location="top">
                <input type="button" class="btn" value=" 删除 " onclick="delMoreIMember()"/>
        </apex:pageBlockButtons>

        <apex:pageBlockTable value="{!existEC}" var="lxr">
            <apex:column >
                <apex:facet name="header">
                    <input type="checkbox" id="allSelectBtn" onclick="selectAll()"/>
                </apex:facet>
                <input type="checkbox" name="ids" value="{!lxr.Id}" onclick="selectOne()" />
            </apex:column>
               <apex:column >
                <apex:facet name="header">电子邮件</apex:facet>
                <apex:outputText value="{!lxr.Field1__r.email__c}"/>
            </apex:column>

        </apex:pageBlockTable>
        </apex:pageBlock>
      
        <script>
            var charray = new Array();
            charray.push("");
            function delMoreIMember(){
                var eids = document.getElementsByName("ids");
           
                var ids = solveParas(eids);
           
                var idslength = ids.length;
                if(idslength<1){
                    alert("请选择至少一条记录");
                    return ;
                }else{
                    var str = charray[0];
                    for(var i=0;i<idslength;i++){
                        str += ids[i]+";";
                    }
                   // alert(str);
                    document.getElementById("{!$Component.gms}").value = str;
                   
                    delMoreItemMember();
                   
                }
                   
            }
        </script>
        <apex:inputHidden value="{!gms}" id="gms"/>
        <apex:actionFunction action="{!delMoreItemMember}" name="delMoreItemMember"/>
      </apex:form>

 

question:  use <apex:commandButton value="删除"  onclick="delMoreIMember()"/>  ,it doesn't  invoke    method delMoreItemMember in the controller.

               but  like this: <apex:pageBlockButtons location="top">
                <input type="button" class="btn" value=" 删除 " onclick="delMoreIMember()"/>
        </apex:pageBlockButtons>

it can work.  why?can anyone can explain.thanks!

  • July 10, 2011
  • Like
  • 0

as follows,content:

 

   <apex:commandButton value="删除" action="{!delOneIM}">
                    <apex:param value="{!lxr.Id}" name="iid"/>
    </apex:commandButton>
  

 like this,in the controller ,get param name's value is null.

but use commandLink ,as follows:

   <apex:commandLink value="删除" action="{!delOneIM}">
                    <apex:param value="{!lxr.Id}" name="iid"/>
    </apex:commandLink>

no problem ,can get param value.

 

why?can anyone explain?thanks!

  • July 10, 2011
  • Like
  • 0

first,when delete a account that standard object  record,associated contacts also are deleted.

 

second,sharing settings page ,contact can be controlled by parent .

 

they must be master-detail relationship,but force.com platform show they are lookup relationship

 

what are standard object account and contact relationship?and how does system bottom implement?

 

can anyone explain bottom principle? thanks!

 

  • June 23, 2011
  • Like
  • 0
Available in: Enterprise, Unlimited, and Developer Editions

 

User Permissions Needed
To enable the Customer Portal:“Customize Application”
To enable the Salesforce Customer Portal:
  1. Click Your Name | Setup | Customize | Customer Portal | Settings.
  2. Click Edit.
  3. Select Enable Customer Portal.
  4. Click Save.
  5. Continue setting up the portal.  

under enterprise editon,i can't see customer portal,why?

 

my profile is system admin,the permission is no problem.

 

can anyone help me ,thanks!

  • June 21, 2011
  • Like
  • 0

Hi All,

select firstname,lastname,from user , the soql show

firstname  lastname

David         Lee

 

but i wanna the result like this:

firstnamelastname

DavidLee

 

  • March 06, 2013
  • Like
  • 0

sobject method ,clone(),has four parameters,the first " opt_preserve_id" argument
determines whether the ID of the originalobject is preserved or cleared in the duplicate.
If set to true, the ID is copied to theduplicate. The default is false, that is, the IDis cleared.apex api document .
when i set ,clone(true);it does not work .page is showed:account id can not be inserted.


 Savepoint sp = Database.setSavepoint();
         account newacc;
 
         try {
 
              //copy the purchase order - ONLY INCLUDE THE FIELDS YOU WANT TO CLONE
             acc = [select Id, Name from account where id = :acc.id];
             newacc = acc.clone(true);
             insert newacc;
 
             // set the id of the new acc created for testing
               newRecordId = newacc.id;
 
             // copy over the line cons - ONLY INCLUDE THE FIELDS YOU WANT TO CLONE
             List<Contact> cons = new List<Contact>();
             for (Contact con : [Select c.Id,c.Name From Contact c where accountid = :acc.id]) {
                  Contact newcon = con.clone(true);
                  newcon.accountid = newacc.id;
                  cons.add(newcon);
             }
             insert cons;
 
         } catch (Exception e){
             // roll everything back in case of error
            Database.rollback(sp);
            ApexPages.addMessages(e);
            return null;
         }

 

hi guys,did u meet the case?

Thanks!


  • October 30, 2012
  • Like
  • 0

content as follows:

 

<apex:form >
        <apex:commandButton value="删除"  onclick="delMoreIMember()"/>
        <apex:pageBlock >
         <apex:pageBlockButtons location="top">
                <input type="button" class="btn" value=" 删除 " onclick="delMoreIMember()"/>
        </apex:pageBlockButtons>

        <apex:pageBlockTable value="{!existEC}" var="lxr">
            <apex:column >
                <apex:facet name="header">
                    <input type="checkbox" id="allSelectBtn" onclick="selectAll()"/>
                </apex:facet>
                <input type="checkbox" name="ids" value="{!lxr.Id}" onclick="selectOne()" />
            </apex:column>
               <apex:column >
                <apex:facet name="header">电子邮件</apex:facet>
                <apex:outputText value="{!lxr.Field1__r.email__c}"/>
            </apex:column>

        </apex:pageBlockTable>
        </apex:pageBlock>
      
        <script>
            var charray = new Array();
            charray.push("");
            function delMoreIMember(){
                var eids = document.getElementsByName("ids");
           
                var ids = solveParas(eids);
           
                var idslength = ids.length;
                if(idslength<1){
                    alert("请选择至少一条记录");
                    return ;
                }else{
                    var str = charray[0];
                    for(var i=0;i<idslength;i++){
                        str += ids[i]+";";
                    }
                   // alert(str);
                    document.getElementById("{!$Component.gms}").value = str;
                   
                    delMoreItemMember();
                   
                }
                   
            }
        </script>
        <apex:inputHidden value="{!gms}" id="gms"/>
        <apex:actionFunction action="{!delMoreItemMember}" name="delMoreItemMember"/>
      </apex:form>

 

question:  use <apex:commandButton value="删除"  onclick="delMoreIMember()"/>  ,it doesn't  invoke    method delMoreItemMember in the controller.

               but  like this: <apex:pageBlockButtons location="top">
                <input type="button" class="btn" value=" 删除 " onclick="delMoreIMember()"/>
        </apex:pageBlockButtons>

it can work.  why?can anyone can explain.thanks!

  • July 10, 2011
  • Like
  • 0

as follows,content:

 

   <apex:commandButton value="删除" action="{!delOneIM}">
                    <apex:param value="{!lxr.Id}" name="iid"/>
    </apex:commandButton>
  

 like this,in the controller ,get param name's value is null.

but use commandLink ,as follows:

   <apex:commandLink value="删除" action="{!delOneIM}">
                    <apex:param value="{!lxr.Id}" name="iid"/>
    </apex:commandLink>

no problem ,can get param value.

 

why?can anyone explain?thanks!

  • July 10, 2011
  • Like
  • 0

first,when delete a account that standard object  record,associated contacts also are deleted.

 

second,sharing settings page ,contact can be controlled by parent .

 

they must be master-detail relationship,but force.com platform show they are lookup relationship

 

what are standard object account and contact relationship?and how does system bottom implement?

 

can anyone explain bottom principle? thanks!

 

  • June 23, 2011
  • Like
  • 0
Available in: Enterprise, Unlimited, and Developer Editions

 

User Permissions Needed
To enable the Customer Portal:“Customize Application”
To enable the Salesforce Customer Portal:
  1. Click Your Name | Setup | Customize | Customer Portal | Settings.
  2. Click Edit.
  3. Select Enable Customer Portal.
  4. Click Save.
  5. Continue setting up the portal.  

under enterprise editon,i can't see customer portal,why?

 

my profile is system admin,the permission is no problem.

 

can anyone help me ,thanks!

  • June 21, 2011
  • Like
  • 0

Hi,

 

I am working on Enterprise WSDL and I took WSDL from SFDC platform,

 

I am getting the following error while generating apex classes from WSDL : 

 

Error: sobjectEnterpriseSoapSforceCom


Error: Invalid type: enterpriseSoapSforceCom.QueryResult at 40:16


Error: enterpriseSoapSforceCom


Error: unexpected token: 'delete' at 507:54


please suggest the solution.

 

Thanks,

I have a piece of code that iterates over a list of strings and changes the strings. Strange thing is that in the end the list has not changed at all, although the modified string is clearly visible in the Debug log within the iteration.

 

I think I know a way around this with a second list, but I am still wondering why it does not work within the list. Don't we do it with sObjects all the time and it works (like iterating over Trigger.New)?

 

code (execute anonymous):

 

		String[] CCAddresses = new string[]{ 'first1.last1@gmail.com','first2.last2@gmail.com'};     
        System.debug('Address List:::::::::::: ' + CCAddresses);

        for (string address:CCAddresses)
        {
        	System.Debug('One Address::::::::::::: ' + address);
        	if(!address.endsWith('@company.com')) 
        	{
        		String newAddress = address + '.full';
        		address = newAddress;
				//address += '.full'; // this doesn't work either
        	}
        	System.Debug('One Address::::::::::::: ' + address);
        }
		
        System.debug('Address List::::::::::::' + CCAddresses);

 

 

Debug Log:

 

Anonymous execution was successful.

18.0 APEX_CODE,FINE;APEX_PROFILING,INFO;CALLOUT,INFO;DB,INFO;VALIDATION,INFO;WORKFLOW,INFO
12:20:13.162|EXECUTION_STARTED
12:20:13.162|CODE_UNIT_STARTED|[EXTERNAL]execute_anonymous_apex
12:20:13.165|METHOD_ENTRY|[3,9]|System.debug(String)
12:20:13.165|USER_DEBUG|[3,9]|DEBUG|Address List:::::::::::: (first1.last1@gmail.com, first2.last2@gmail.com)
12:20:13.165|METHOD_EXIT|[3,9]|debug(ANY)
12:20:13.165|METHOD_ENTRY|[7,10]|System.Debug(String)
12:20:13.165|USER_DEBUG|[7,10]|DEBUG|One Address::::::::::::: first1.last1@gmail.com
12:20:13.165|METHOD_EXIT|[7,10]|debug(ANY)
12:20:13.165|METHOD_ENTRY|[8,14]|String.endsWith(String)
12:20:13.165|METHOD_EXIT|[8,14]|endsWith(String)
12:20:13.165|METHOD_ENTRY|[14,10]|System.Debug(String)
12:20:13.165|USER_DEBUG|[14,10]|DEBUG|One Address::::::::::::: first1.last1@gmail.com.full
12:20:13.165|METHOD_EXIT|[14,10]|debug(ANY)
12:20:13.165|METHOD_ENTRY|[7,10]|System.Debug(String)
12:20:13.165|USER_DEBUG|[7,10]|DEBUG|One Address::::::::::::: first2.last2@gmail.com
12:20:13.165|METHOD_EXIT|[7,10]|debug(ANY)
12:20:13.165|METHOD_ENTRY|[8,14]|String.endsWith(String)
12:20:13.165|METHOD_EXIT|[8,14]|endsWith(String)
12:20:13.165|METHOD_ENTRY|[14,10]|System.Debug(String)
12:20:13.165|USER_DEBUG|[14,10]|DEBUG|One Address::::::::::::: first2.last2@gmail.com.full
12:20:13.165|METHOD_EXIT|[14,10]|debug(ANY)
12:20:13.165|METHOD_ENTRY|[17,9]|System.debug(String)
12:20:13.165|USER_DEBUG|[17,9]|DEBUG|Address List::::::::::::(first1.last1@gmail.com, first2.last2@gmail.com)
12:20:13.165|METHOD_EXIT|[17,9]|debug(ANY)
12:20:13.165|CUMULATIVE_LIMIT_USAGE
12:20:13.165|LIMIT_USAGE_FOR_NS|(default)|

 

 

 

 

I am trying to access JAR files from within salesforce. I uploaded them as static resources but can't seem to find any examples as to how they can be accessed. The VF doc mentions that we can upload JARs also although the examples are only for file types that actually go with html/ apex tag attributes (ex: js, images). I would be grateful for any examples including S-Control instead of VF.
Thanks!



Message Edited by rawiswar on 12-24-2008 10:21 AM