• dcarmen66
  • NEWBIE
  • 25 Points
  • Member since 2009

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

I'm exploring some situations where we might want different actions depending on if a user is logged in through the UI versus connecting via the API. Is there any way in Apex to determine this?

I am trying to use a web service to connect to an external site and I keep on getting:

 

System.CalloutException: IO Exception: External server did not return any content

 

I was able to successfully import their wsdl and I was trying to do a simple ping operation. I tried the connection in soapUI and it was successful and returned a response.

 

One question I had was if Salesforce handles the <s:any /> complex type correctly. Their wsdl has:

 

      <s:element name="PingResponse">
        <s:complexType>
          <s:sequence>
            <s:element minOccurs="0" maxOccurs="1" name="PingResult">
              <s:complexType mixed="true">
                <s:sequence>
                  <s:any />
                </s:sequence>
              </s:complexType>
            </s:element>
          </s:sequence>
        </s:complexType>
      </s:element>

and the code it generates is:

 

    public class PingResult_element {
        private String[] apex_schema_type_info = new String[]{'YSI.Portal.SeniorHousing.WebServices','true','false'};
        private String[] field_order_type_info = new String[]{};
    }
    public class PingResponse_element {
        public seniorhousingWeb.PingResult_element PingResult;
        private String[] PingResult_type_info = new String[]{'PingResult','YSI.Portal.SeniorHousing.WebServices',null,'0','1','false'};
        private String[] apex_schema_type_info = new String[]{'YSI.Portal.SeniorHousing.WebServices','true','false'};
        private String[] field_order_type_info = new String[]{'PingResult'};
    }

Any help is appreciated!!

I'm looking at using the Account Contact Role functionality in two way - listing the roles a contact has in relation to their account (via the AccountId) and a relation to another account. So account 1 has contact 1, and contact 1 also has a role on account 2. On the account there is a related list of the roles. But on the contact I do not see a related list of all the roles the contact has (if I'm on contact 1 I'd want to see they have roles on both account 1 and account 2). Am I missing anything here? Does this ability not exist in the UI? Thanks!

I was trying to embed a Document as an image as a Letterhead for a Visualforce Email template, since it says you can't use static resources for this. There wasn't a lot of documentation around it, but I did come across something that says to use something like this:

<apex:image id="Logo" value="https://na12.salesforce.com/servlet/servlet.ImageServer?
id=015U00000006rgj&oid=00DU0000000IaH2&lastMod=127057656800"  />

 

When I put that the VF template, the spot where the image should go displays, but the image does not.

Is this the correct way to be doing this? What value should be in the "lastMod" parameter. I don't see anything that described what that should be. I did put the correct values for the id and oid, and for the salesforce instance, but can't find anything for "lastMod".

 

Thanks in advance!

I have functionality in a form so when the users click on the button, the button goes disabled. The only problem I have is that in a <apex:pageBlockButtons> block, where two sets of buttons are created, only the top set of buttons becomes disabled. This was put into place to prevent the users from double-clicking the buttons, however they end up double-clicking the lower set of buttons because those buttons do not become disabled.

 

         <apex:pageBlockButtons id="productButtons">
            <apex:actionStatus rendered="{!NOT(readOnly)}" id="applyButtonStatus">
               <apex:facet name="stop">
                  <apex:commandButton id="applyButtonActive" action="{!calcRevenue}" value="Apply Changes/Calculate Revenue" status="applyButtonStatus" disabled="false" rerender="productTypeSelectionBlock"/>
               </apex:facet>
               <apex:facet name="start">
                  <apex:commandButton id="applyButtonDisabled" action="{!calcRevenue}" value="Applying Changes..." status="applyButtonStatus" disabled="true" rerender="productTypeSelectionBlock"/>
               </apex:facet>
            </apex:actionStatus>
         </apex:pageBlockButtons>

 

Is there any way to get this to work inside of the pageBlockButtons block, or do I just have to create two sets of buttons? If I create two sets, then they'll disable independently of each other, which isn't ideal.

I have a VF page embedded in a page layout, and I'm trying to recreate some of the related list functionality. The issue I'm having is when I create a "View" link, when you click on it it goes to the record within the VF page scope embedded in the main page, when what I really want to do is to redirect the main page to the record. Does anyone have any suggestions on how to do this?

So...

 

Account Page Layout.

VF page as part of the Page Layout that shows a list of related objects.

When I click on a link to view the records, scope remains within the VF page scope, main page doesn't change.

 

Thanks in advance!

We were testing out Cloud Swarm in our sandbox. We have a batch process that runs daily to update the leads. Our batch process is failing because a @future method cannot be called from a batch process. Can the trigger be changed to not use a future call if it's running in a batch? Otherwise we cannot use it.

 

10:02:29.137 (23137852000)|USER_DEBUG|[544]|DEBUG|Error=cloudswarm.leadSwarm: execution of AfterUpdate

caused by: System.AsyncException: Future method cannot be called from a future or batch method: cloudswarm.SwarmHelper.evaluateLeadRulesFuture(LIST<Id>)

 

Thanks!

It looks like the standard Clone button on the Opportunity only clones the fields that are part of the current page layout. Can anyone tell me if I'm correct in that assumption? I have fields on the Opportunity that I need to be cloned that are not part of the layout. Will I need to override the button in order to use the Apex clone method? Has anyone seen this or have any other solutions for this?

Thanks!

Dan

I have a visualforce page with two components. One component queries for data for an Account and Opportunity. The other component is a "date picker" component (allows for the selection of the date, time, and duration) and has a partial page refresh. If the date picker component is on a page by itself (commenting out the first component) the partial page refresh works correctly. With both components on the page, the refresh does not work. Is this a limitation of Visualforce?

Does anyone know if there's a way to export data from a visualforce page (or some other way)? What I'm looking to do is to have a user select an account (and opportunity), and then be able to click a button (or link) on the page that will create an xml file that the user can save to their desktop that contains the information from the account they were viewing. Then the user would be able to take this information and import it into another (desktop) application. I don't know if this can be done directly with a VF page, or if I'd have to use some combination of VF with Javascript. Any help is appreciated!

I'm trying to duplicate some of the User maintenance functions in a visual force page, and I'm running into a bit of a problem. In the normal user form, if a user is a delegated administrator, the picklists for roles and profiles only show what they have access to. In my visual force page, the list comes up with all roles and profiles. Does anyone know how to get the same picklist?

 

For example, our delegated administrator for zone 1 can see the roles for his zone and all roles under the zone. He can also see all profiles defined in the delegated administration form. When I put that field on my form, all roles and profiles display.

 

Any help is appreciated - thanks!

Does anyone have a method for determining the name of the sandbox you're on (sand1 versus sand2) or if you're on a production instance? I can probably look at the username, but that doesn't seem like a solid method to me since you could technically change it to whatever you want. Any help is appreciated!

I'm exploring some situations where we might want different actions depending on if a user is logged in through the UI versus connecting via the API. Is there any way in Apex to determine this?

I am trying to use a web service to connect to an external site and I keep on getting:

 

System.CalloutException: IO Exception: External server did not return any content

 

I was able to successfully import their wsdl and I was trying to do a simple ping operation. I tried the connection in soapUI and it was successful and returned a response.

 

One question I had was if Salesforce handles the <s:any /> complex type correctly. Their wsdl has:

 

      <s:element name="PingResponse">
        <s:complexType>
          <s:sequence>
            <s:element minOccurs="0" maxOccurs="1" name="PingResult">
              <s:complexType mixed="true">
                <s:sequence>
                  <s:any />
                </s:sequence>
              </s:complexType>
            </s:element>
          </s:sequence>
        </s:complexType>
      </s:element>

and the code it generates is:

 

    public class PingResult_element {
        private String[] apex_schema_type_info = new String[]{'YSI.Portal.SeniorHousing.WebServices','true','false'};
        private String[] field_order_type_info = new String[]{};
    }
    public class PingResponse_element {
        public seniorhousingWeb.PingResult_element PingResult;
        private String[] PingResult_type_info = new String[]{'PingResult','YSI.Portal.SeniorHousing.WebServices',null,'0','1','false'};
        private String[] apex_schema_type_info = new String[]{'YSI.Portal.SeniorHousing.WebServices','true','false'};
        private String[] field_order_type_info = new String[]{'PingResult'};
    }

Any help is appreciated!!

It looks like the Code Coverage pages for my apex code now includes blank lines and commented out rows as "Un-covered" and highlights them in red.

 

Is anybody else noticing this? Is it a bug?

 

With thanks,

Andy

I was trying to embed a Document as an image as a Letterhead for a Visualforce Email template, since it says you can't use static resources for this. There wasn't a lot of documentation around it, but I did come across something that says to use something like this:

<apex:image id="Logo" value="https://na12.salesforce.com/servlet/servlet.ImageServer?
id=015U00000006rgj&oid=00DU0000000IaH2&lastMod=127057656800"  />

 

When I put that the VF template, the spot where the image should go displays, but the image does not.

Is this the correct way to be doing this? What value should be in the "lastMod" parameter. I don't see anything that described what that should be. I did put the correct values for the id and oid, and for the salesforce instance, but can't find anything for "lastMod".

 

Thanks in advance!

I am trying to use a same VF component more than once in a VF page. I can see that the last used component alone works fine and the others give no response. 

 

Could anyone please tell if there is a problem in using the same component twice? 

 

Below are the generic code with standard objects for your convenience:

 

Component :

 <apex:component controller="ContactEmailController">

<apex:actionFunction action="{!dispFunc}" name="callFunc"/>
<apex:inputField value="{!opp.accountId}" onchange="callFunc();"/>
{!accnt.Name}
</apex:component>

 

Component Controller :

public class ContactEmailController {


public Account accnt{get;set;}
public Opportunity opp{get;set;}

public PageReference dispFunc(){
if(opp.AccountId!=null)
accnt = [select id, name from Account where id=:opp.AccountId];
return null;
}

public ContactEmailController(){
accnt = new Account();
opp = new Opportunity();
}
}

 

Page using the component :

<apex:page >
<apex:form >
<c:ContactEmail />
</apex:form>
<apex:form >
<c:ContactEmail />
</apex:form>
</apex:page>

 

I am trying to get this working for a long time now. Please help.

Thanks in advance. 

 

I have a VF page embedded in a page layout, and I'm trying to recreate some of the related list functionality. The issue I'm having is when I create a "View" link, when you click on it it goes to the record within the VF page scope embedded in the main page, when what I really want to do is to redirect the main page to the record. Does anyone have any suggestions on how to do this?

So...

 

Account Page Layout.

VF page as part of the Page Layout that shows a list of related objects.

When I click on a link to view the records, scope remains within the VF page scope, main page doesn't change.

 

Thanks in advance!

Hello,

I am not able to save my components or refresh my components from Server via Eclipse IDE for Force.com after I updated to Winter 12. I always get Connection Timeout exception. 

 

java.net.SocketTimeoutException: connect timed out
	at java.net.PlainSocketImpl.socketConnect(Native Method)
	at java.net.PlainSocketImpl.doConnect(Unknown Source)
	at java.net.PlainSocketImpl.connectToAddress(Unknown Source)
	at java.net.PlainSocketImpl.connect(Unknown Source)
	at java.net.SocksSocketImpl.connect(Unknown Source)
	at java.net.Socket.connect(Unknown Source)
	at com.sun.net.ssl.internal.ssl.SSLSocketImpl.connect(Unknown Source)
	at sun.net.NetworkClient.doConnect(Unknown Source)
	at sun.net.www.http.HttpClient.openServer(Unknown Source)
	at sun.net.www.http.HttpClient.openServer(Unknown Source)
	at sun.net.www.protocol.https.HttpsClient.<init>(Unknown Source)
	at sun.net.www.protocol.https.HttpsClient.New(Unknown Source)
	at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.getNewHttpClient(Unknown Source)
	at sun.net.www.protocol.http.HttpURLConnection.plainConnect(Unknown Source)
	at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(Unknown Source)
	at sun.net.www.protocol.http.HttpURLConnection.getOutputStream(Unknown Source)
	at sun.net.www.protocol.https.HttpsURLConnectionImpl.getOutputStream(Unknown Source)
	at com.sforce.ws.transport.JdkHttpTransport.connectRaw(JdkHttpTransport.java:133)
	at com.sforce.ws.transport.JdkHttpTransport.connectLocal(JdkHttpTransport.java:97)
	at com.sforce.ws.transport.JdkHttpTransport.connectLocal(JdkHttpTransport.java:92)
	at com.sforce.ws.transport.JdkHttpTransport.connect(JdkHttpTransport.java:88)
	at com.sforce.ws.transport.SoapConnection.send(SoapConnection.java:94)
	at com.sforce.soap.metadata.MetadataConnection.describeMetadata(MetadataConnection.java:345)
	at com.salesforce.ide.core.remote.MetadataStubExt.describeMetadata(MetadataStubExt.java:303)
	at com.salesforce.ide.core.remote.MetadataStubExt.describeMetadata(MetadataStubExt.java:311)
	at com.salesforce.ide.core.remote.MetadataStubExt$$FastClassByCGLIB$$9404e285.invoke(<generated>)
	at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149)
	at org.springframework.aop.framework.Cglib2AopProxy$CglibMethodInvocation.invokeJoinpoint(Cglib2AopProxy.java:700)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
	at org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocationProceedingJoinPoint.java:77)
	at com.salesforce.ide.core.internal.aspects.MetadataOperationsRetryAspect.metadataOperationsRetry(MetadataOperationsRetryAspect.java:22)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:627)
	at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:616)
	at org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:64)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
	at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:90)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
	at org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:635)
	at com.salesforce.ide.core.remote.MetadataStubExt$$EnhancerByCGLIB$$c1ac1f9d.describeMetadata(<generated>)
	at com.salesforce.ide.core.services.MetadataService.getDescribeMetadata(MetadataService.java:54)
	at com.salesforce.ide.core.services.PackageDeployService.adjustDeployOptions(PackageDeployService.java:300)
	at com.salesforce.ide.core.services.PackageDeployService.deployWork(PackageDeployService.java:264)
	at com.salesforce.ide.core.services.PackageDeployService.deploy(PackageDeployService.java:144)
	at com.salesforce.ide.core.services.PackageDeployService.deploy(PackageDeployService.java:127)
	at com.salesforce.ide.core.services.PackageDeployService.deploy(PackageDeployService.java:111)
	at com.salesforce.ide.ui.actions.SaveToServerActionController.deploy(SaveToServerActionController.java:132)
	at com.salesforce.ide.ui.actions.SaveToServerActionController.saveResourcesToServer(SaveToServerActionController.java:114)
	at com.salesforce.ide.ui.actions.SaveToServerAction$1.execute(SaveToServerAction.java:63)
	at org.eclipse.ui.actions.WorkspaceModifyOperation$1.run(WorkspaceModifyOperation.java:106)
	at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2344)
	at org.eclipse.ui.actions.WorkspaceModifyOperation.run(WorkspaceModifyOperation.java:118)
	at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:121)

 Please let me know if anyone has the similar problem.

 

i am running WIndows 7 professional, Eclipse Indigo R1 and have latest Force.com IDE plugin available.

 

 

Dear guys ,

I have an issue in eclipse When I run test to any test class I cant see the class in Apex Test Runner.

 

Please help me out its bery urgent...

 

 

 

Hi everyone,

 

Today I faced with one issue related to displaying test coverage in Apex Test Runner tab in IDE. It worked today but after PC reboot it stoped.

Actually it is working in interesting maner. It shows TRIGGERs coverage but not CLASSes. It was showing today class coverage but now it isn't. I just downloaded Windowse's updates and reboot my PC. No changes in Salesforce environment or IDE.

If I run the same test class from browser it shows classes coverage as ussual.

What can be the problem?

 

Update: I just tested run test on other's developer PC and there is the same situation - no class coverage.

 

Update 2: if I click Run Tests on classes folder it shows me apex classes code coverage. If I click Run Tests on ONE particular class then no. But yesterday it showed my code coverage for classes if I click Run Tests on one particular class. What is going on?

  • October 27, 2011
  • Like
  • 0

Hi,

 

Can i add a new value to a pickList field.

 

eg: I have a field say Status. One value is there Open. When i call the trigger i want to add one more value say Closed.

 

When i try to update the existing value gets replaced.

 

Thanks

Hari G S

 

i have a custom object called as asset__c in that i have a field called as Allocated_amount__c(Roll-Up Summary (SUM GoalAssetAssociation) in my sandbox

 

but when i am deploying to production it  get deployed but the custom field called as Allocated_amount__c does not apper over there

 

so what will the problem or is their some specific way to deploy

Hi all,

 

How to Find the Attachment object.....................

 

 

Thanking you,

Anjireddy

Hi All,

 

I have a pop-up page which sends email to end user, I have done validation on server side and want to show Apexpagemessages on VFP through server side validations but unfortunately I am not able to show page messages when I use actionstatus and command button action.

Below is my Visualforce page code snippet to this:

 

<apex:pageMessages id="errors"/>
<apex:pageBlockButtons rendered="{!showButtons}" id="buttons"> <apex:commandButton action="{!Send}" value="Send" rerender="buttons" status="closer"/> <apex:commandButton value="Cancel" onclick="javascript&colon;closeWindow()"/> <apex:actionStatus startText="(Sending...)" stopText="" onStop="window.close();" id="closer"/> </apex:pageBlockButtons>

Please let me know your thoughts/suggestions on this.

Thank you!

 

Regards,

Lakshman

I have seen some forum saying to use @future to get around this, but I'm not sure how to accomplish that

Below is my trigger, it is short and sweet (well at least I think so). Please have a look and let me know how to fix this.

Thanks!!!!

trigger Touch_Imp on User (after insert) {
if(trigger.isInsert){
    Set<String> usercontactid = new Set<String>(); 
    for (User u : Trigger.new) {
        usercontactid.add(u.contactid);
    }
    if([SELECT COUNT() FROM implementation__c WHERE implementation__c.implementation_contact__c IN :usercontactid]>0){
        Implementation__c[] updateimp = [SELECT id from Implementation__c WHERE implementation__c.implementation_contact__c IN :usercontactid];
        Database.update(updateimp);
    }
}
}