• wintamute
  • NEWBIE
  • 80 Points
  • Member since 2007

  • Chatter
    Feed
  • 3
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 8
    Questions
  • 31
    Replies

I've got a SWF that's embedded in a VF page.  I've set the layout that houses the VF page to be a one-column layout and the page has nothing but the swf embedded in it.  the swf itself has only a form wrapper around the google map.  Why doesn't the Map extend the width of the screen?

 

 

<apex:page standardController="Location__c" extensions="GoogleMapManager">
<apex:flash id="flexSOs" src="{!$Resource.FlexGoogleMap}"

height="100%" width="100%"

flashvars="session_id={!$Api.Session_ID}&server_url={!$Api.Partner_Server_URL_150}&aLoc={!latitude}&zLoc={!longitude}"/>

</apex:page>

 

 

<?xml version="1.0" encoding="utf-8"?>
<mx:Application
    xmlns:mx="http://www.adobe.com/2006/mxml"
    layout="absolute"
creationComplete="init();"
width="100%"
height="100%"
viewSourceURL="srcview/index.html">
<mx:Script>
    <![CDATA[
  
        import com.google.maps.LatLng;
        import com.google.maps.Map;
        import com.google.maps.MapEvent;
        import com.google.maps.MapType;
        import com.google.maps.overlays.Marker;
        import com.google.maps.MapMouseEvent;
        import mx.collections.ArrayCollection;
        import com.google.maps.controls.ScaleControl;
        import com.google.maps.controls.ZoomControl;
        import com.google.maps.controls.MapTypeControl;
       
        [Bindable]
        public var locations:ArrayCollection = new ArrayCollection();
       
        public function init():void{
            Security.allowInsecureDomain("maps.googleapis.com");
        }
       
        private function onMapReady(event:MapEvent):void {
            var lat:Number = parseFloat(parameters.aLoc);
            var lon:Number = parseFloat(parameters.zLoc);
              var latLng:LatLng = new LatLng(lat, lon);
              var marker:Marker = new Marker(latLng);
              map.setCenter(latLng, 17, MapType.NORMAL_MAP_TYPE);
              map.addOverlay(marker);
              map.addControl(new ScaleControl());
              map.addControl(new ZoomControl());
              map.addControl(new MapTypeControl());
        }
    ]]>
    </mx:Script>
        <mx:Form
            width="100%" height="100%"
            borderStyle="solid" borderColor="#D4D4D4"
            dropShadowEnabled="true" dropShadowColor="#B3B3B3"
            shadowDirection="right" shadowDistance="10">
                    <maps:Map xmlns:maps="com.google.maps.*" mapevent_mapready="onMapReady(event)" id="map"
                    key="ABQIAAAAA7aFgeQgFpt9KTUNsnsLOxS_OfvXuFpkKLqWEAhV7rt46ELgZhQqmfKMyH0V6D-GCiomYQVTAEWYSQ"/>
        </mx:Form>       
</mx:Application>

  • April 27, 2009
  • Like
  • 0

I'm befuddled and puzzled.  I just got the Google Maps API for Flex to embed properly in SF and now I am trying to get a data grid to fill with SF data in the same SWF.  I've gotten data out of Salesforce in the past using the as3salesforce.swc library but it doesn't seem to work anymore.  I've been following threads about the appropriate server_url (which I've now replaced with v15 to no avail).  Anybody else noticing problems with the toolkit?

 

<apex:page standardController="Location__c">
<apex:form >
<apex:pageBlock title="Flex implementation">
<apex:flash id="flexSOs" src="{!$Resource.SFFlex}" height="100%" width="100%"
flashvars="session_id={!$Api.Session_ID}&server_url={!$Api.Partner_Server_URL_150}"/>
</apex:pageBlock>
</apex:form>
</apex:page>

 Here's the mxml code:

 

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
xmlns:salesforce="http://www.salesforce.com/"
creationComplete="login(event)"
viewSourceURL="srcview/index.html">
    <salesforce:Connection id="connection"/>
   
    <mx:Script>
    <![CDATA[
    import com.salesforce.objects.SObject;
    import com.salesforce.results.QueryResult;
    import com.salesforce.AsyncResponder;
    import com.salesforce.objects.LoginRequest;
    import mx.core.IUIComponent;
    import mx.managers.DragManager;
    import mx.events.DragEvent;
    import mx.collections.ArrayCollection;
    import flash.external.ExternalInterface;
   
    [Bindable]
    public var selectedItem:Object;
    [Bindable]
    public var selectedSOs:ArrayCollection = new ArrayCollection();;

    private function login(event:Event):void {
                var lr:LoginRequest = new LoginRequest();
                lr.server_url = parameters.server_url;
                lr.session_id = parameters.session_id;
                lr.callback = new AsyncResponder(getCandidateSOs);
                connection.login(lr);
            }
   
    private function getCandidateSOs(o:Object=null):void{
        connection.query("Select Id, A_Loc__c from Service_Order__c"
        , new AsyncResponder(
        function (qr:QueryResult):void {
            candidateSOs.dataProvider = qr.records;
        }));

    }
    ]]>
    </mx:Script>

<mx:Form id="frmPrintSO"
            width="100%" height="75%"
            borderStyle="solid" borderColor="#D4D4D4"
            dropShadowEnabled="true" dropShadowColor="#B3B3B3"
            shadowDirection="right" shadowDistance="10">
    <mx:FormHeading label="Signature SOs"     />
    <mx:HBox>
        <mx:VBox>
            <mx:Label text="Candidate SOs"/>
            <mx:DataGrid id="candidateSOs"
                allowMultipleSelection="true"
                dragEnabled="true"
                dropEnabled="true"
                dragMoveEnabled="true">
                <mx:columns>
                    <mx:DataGridColumn dataField="Name"/>
                    <mx:DataGridColumn dataField="A_Loc__c"/>
                </mx:columns>   
            </mx:DataGrid>
        </mx:VBox>
    </mx:HBox>
</mx:Form>
</mx:Application>

  • April 27, 2009
  • Like
  • 0

I have created a Flex component that I've now deployed as both an S-Control and a Visualforce page.  The Flex code attempts to use the session id and server url for logins. These values are passed in as Flash variables. When this code is invoked from the S-Control the login succeeeds.  However the login fails when invoked from the Visualforce page. (I can also login with username and password from the page).


The html body for the S-Control:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head></head>
<body scroll="no" >
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
id="FlexSalesforce" width="100%" height="100%"
codebase="https://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab">
<param name="movie" value="{!Scontrol.JavaArchive}" />
<param name="quality" value="high" /><param name="play" value="true" />
<param name="bgcolor" value="#f3f3ec" />
<param name="allowScriptAccess" value="always" />
<param name="flashvars"
value="session_id={!API.Session_ID}&server_url={!API.Partner_Server_URL_140}" />
<embed src="{!Scontrol.JavaArchive}" play="true" bgcolor="#f3f3ec"
width="100%" height="700" name="FlexSalesforce" align="middle"
flashvars="session_id={!API.Session_ID}&server_url={!API.Partner_Server_URL_140}&externalURL=https://na6.salesforce.com/resource/123XXXX89000/salesforceRSL"
loop="false" allowScriptAccess="always" type="application/x-shockwave-flash"
pluginspage="http://www.adobe.com/go/getflashplayer">
</embed>
</object>
</body>
</html>



The syntax of my page is:

<apex:page sidebar="true" showheader="true">
<apex:flash src="{!$Resource.Example5}" height="500" width="100%"
         flashvars="session_id={!$Api.SESSION_ID}&server_url={!$Api.Partner_Server_URL_140}&externalURL={!$Resource.salesforceRSL}"/>
</apex:page>

 

Within my Flash component, the following code snippet gets called:

 

               var connection:Connection = new Connection();

                var sessionId:String = Application.application.parameters[SESSION_ID];
                var serverUrl:String = Application.application.parameters[SERVER_URL];
                if (sessionId != null && serverUrl != null)
                {
                    LOG.debug("Using session id for login");
                    lr.server_url = serverUrl;
                    lr.session_id = sessionId;
                    loginResponder = new AsyncResponder(loginCallback);
                    lr.callback = loginResponder;

                    //connection.protocol = "https";   //tried with and without setting these
                    //connection.serverUrl = serverUrl;

                    connection.login(lr);
                }

 

I've noticed that the sessionId's are different for the page vs. the S-Control even though they are invoked from the same browser moments apart. I've also noticed that the URLs for the control use "https://na6.visual.force.com" vs. "https://c.na6.visual.force.com" for the page.


I'm seeing the following output in my logs for the page case:

 

Starting login
Using session id for login

loginWithSessionId(
 sid: 510600  [....]  _p4DIBpWrGf
 surl: https://c.na6.visual.force.com/services/Soap/u/14.0/510600D80000000ZTCY
);
App Domain = c.na6.visual.force.com
Api Server name = c.na6.visual.force.com
_internalServerUrl = https://c.na6.visual.force.com/services/Soap/u/14.0/510600D80000000ZTCY
loading the policy file: https://c.na6.visual.force.com/services/Soap/cross-domain.xml
Your application must be running on a https server in order to use https to communicate with salesforce.com!
invoke getUserInfo
intServerUrl is null
intServerUrl = https://c.na6.visual.force.com/services/Soap/u/14.0/510600D80000000ZTCY
_invoke getUserInfo
'0078EE29-37C1-427B-78E0-AE6DF3EE2F28' producer set destination to 'DefaultHTTPS'.
Method name is: getUserInfo
'direct_http_channel' channel endpoint set to http://c.na6.visual.force.com/resource/1235576467000/
'0078EE29-37C1-427B-78E0-AE6DF3EE2F28' producer sending message 'B769C4FE-87A6-A2E6-F4DA-AE6DF3FD5ABB'
'direct_http_channel' channel sending message:
(mx.messaging.messages::HTTPRequestMessage)#0
  body = "<se:Envelope xmlns:se="http://schemas.xmlsoap.org/soap/envelope/"><se:Header xmlns:sfns="urn:partner.soap.sforce.com"><sfns:SessionHeader><sessionId>510600D80000  [...]        dDV1hVMr_p4DIBpWrGf</sessionId></sfns:SessionHeader></se:Header><se:Body><getUserInfo xmlns="urn:partner.soap.sforce.com" xmlns:ns1="sobject.partner.soap.sforce.com"/></se:Body></se:Envelope>"
  clientId = (null)
  contentType = "text/xml; charset=UTF-8"
  destination = "DefaultHTTPS"
  headers = (Object)#1
  httpHeaders = (Object)#2
    Accept = "text/xml"
    SOAPAction = """"
    X-Salesforce-No-500-SC = "true"
  messageId = "B769C4FE-87A6-A2E6-F4DA-AE6DF3FD5ABB"
  method = "POST"
  recordHeaders = false
  timestamp = 0
  timeToLive = 0
  url = "https://c.na6.visual.force.com/services/Soap/u/14.0/510600D80000000ZTCY"
'0078EE29-37C1-427B-78E0-AE6DF3EE2F28' producer connected.
Method name is: getUserInfo
'0078EE29-37C1-427B-78E0-AE6DF3EE2F28' producer acknowledge of 'B769C4FE-87A6-A2E6-F4DA-AE6DF3FD5ABB'.
responseType: Fault
Saleforce Soap Fault: sf:INVALID_SESSION_ID
INVALID_SESSION_ID: Invalid Session ID found in SessionHeader: Illegal Session
(com.salesforce.results::Fault)#0
  context = (null)
  detail = (Object)#1
    UnexpectedErrorFault = (Object)#2
      exceptionCode = "INVALID_SESSION_ID"
      exceptionMessage = "Invalid Session ID found in SessionHeader: Illegal Session"
      xsi:type = "sf:UnexpectedErrorFault"
  faultcode = "sf:INVALID_SESSION_ID"
  faultstring = "INVALID_SESSION_ID: Invalid Session ID found in SessionHeader: Illegal Session"
Error: Ignoring policy file requested from https://c.na6.visual.force.com/crossdomain.xml because a cross-domain redirect to https://na6.salesforce.com/crossdomain.xml occurred.
Warning: Domain c.na6.visual.force.com does not explicitly specify a meta-policy, but Content-Type of policy file https://c.na6.visual.force.com/services/Soap/cross-domain.xml is 'text/x-cross-domain-policy'.  Applying meta-policy 'by-content-type'.
 

 

Thanks in advance for your help.

David



Hi,

 

I'm encountering an odd problem and I'm not sure if I'm doing something wrong or hitting a bug.

I have a managed package which includes workflow rules and translations to various languages.

 

We're using the Trialforce DOT process to create new orgs with that package already installed.

 

Now if one of these orgs changes the default language to something other than "English" and then upgrades the package, the workflow rules still have entry criteria like 'somefield__c equals "true"' for a checkbox field which is of course not editable because it's a managed package.

However, since the org uses a different language, it seems that it expects the workflow rule to check for the localized value of 'true', i.e. 'wahr' in a German org.

So the workflow rules don't work anymore. And since they cannot be edited, one has to deactivate and clone them, using the correct language.

 

Any ideas what the issue might be here? I'm at a loss..

 

Thanks,

Andreas

Hi,

 

We got an issue with accessing data from a Visualforce page contained in Sites. The data that should be displayed is from a custom object contained in a licensed managed package. This worked fine until the package was upgraded to a new version which required licesing.

My guess it's something related to the sites user not having a license for that package (doesn't show in the user list for assigning licenses).

 

The Problem: the visualforce page called when normally loged in with a licensed user works as expected (via /apex/Pagename). When called from outside via domainname.force.com/Pagename it shows only empty values. The page iterates over a list of objects with apex:repeat. I get as many empty objects as I should get, so that part works. Just the values are missing, using {!object.field__c} syntax.

 

Any hints, pointers? Maybe a bug? I couldn't find anything regarding that odd bevavior.

 

The page code:

 

<apex:page cache="false" controller="XMLlistingController" contentType="application/xml"><?xml version="1.0" encoding="UTF-8"?>
<LocationList>
<apex:repeat value="{!locations}" var="location">
<Location__c>
<Id><apex:outputText value="{!location.Id}" /></Id>
<Name><apex:outputText value="{!location.Name}" /></Name>
</Location__c>
</apex:repeat>
</LocationList>
</apex:page>

 

The controller simply queries for the Location__c custom object and returns a list.

 

Output from /apex/LocationPage

 

<LocationList>
<Location__c>
<Id>
a0B80000003uOfiEAE
</Id>
<Name>
Example Location
</Name>
</Location__c>
</LocationList>

 

output from domainname.force.com/LocationPage:

 

<LocationList>
<Location__c>
<Id/>
<Name/>
</Location__c>
</LocationList>

 

edit: Just to underline it's not a basic permission problem:

The sites user has all necessary permissions on that object, also field level security settings are fine. It worked before licesing for that package was turned on.

 

 

 

 

 

Message Edited by wintamute on 09-18-2009 01:06 PM
Message Edited by wintamute on 09-18-2009 02:07 PM

When trying to change the recordtype of a person account to normal business account, I get the following error: "insufficient access rights on cross-reference id".

 

However, it works fine when I change it to a different person account record type. According to the documentation, it should also work across recordtype families.

I do have access to the recordtype I want to change to in the profile settings and can create a account with that recordtype manually in the GUI and with apex, so it's not an actual access rights issue as the error message suggests.

 

Any ideas what could be the problem here?

 

Thanks

Since using the new release of the IDE (version 14) I get enormous amounts of debug output, no matter what log level are set. These settings seem to get ignored, the same seems to happen in the browser output when running tests.
I set the various log levels for each category, basically disabling everything except apex code, but each test case gets several thousand (!) lines of output. So the debug log only contains output for 3 test methods before all further output gets truncated.
This makes it pretty much impossible to use the output for debugging since it misses most of the other test methods and is totally bloated with information I didn't want to see in the first place.
Any ideas what's going on here? Are the log levels just broken? Anything I can do to get useful debug log output?
Hi,

When creating new custom profiles in a sandbox via the browser, I can clone either license types "salesforce" or "salesforce platform" (when platform licenses are enabled that is).
However, when trying to deploy theses profiles to the production org with the IDE (or ant tool), they will be created as type "salesforce" and are not available for platform users. When looking at the profile in the IDE, there is no way to distinguish both types.

So instead of deploying them, I have to re-create them manually in the production org which is time consuming and error prone.

Is this expected behavior or a bug?

Thanks,
Andreas
Hi,
the latest flex toolkit contains a bug when doing a DescribeLayout Call and the editLayoutSection contains only a single section. DescribeLayout throws a null-pointer error in this case.
Since the source is available, I did a quick fix so the maintainer of the toolkit can add it to the respository.

Code:
Index: /Users/andi/Documents/workspace33/Salesforce Flex sdk/src/com/salesforce/results/DescribeLayout.as
===================================================================
--- /Users/andi/Documents/workspace33/Salesforce Flex sdk/src/com/salesforce/results/DescribeLayout.as (revision 722)
+++ /Users/andi/Documents/workspace33/Salesforce Flex sdk/src/com/salesforce/results/DescribeLayout.as (working copy)
@@ -27,9 +27,8 @@
 */
 package com.salesforce.results
 {
+ import mx.collections.ArrayCollection;
  import mx.utils.ObjectProxy;
- import mx.collections.ArrayCollection;
- import com.salesforce.results.*;
   /**
    * Returned in the response to describeLayout(), contains detailed information on the custom or standard object page layout
    * 
@@ -51,9 +50,11 @@
      // one of detailLayoutSections, editLayoutSections, relatedList
      if (key == "detailLayoutSections" || key == "editLayoutSections") {
       this[key] = new ArrayCollection();
-      for (var i:int = 0;i<(val as ArrayCollection).length;i++) { 
-       this[key].addItem( new DescribeLayoutSection((val as ArrayCollection)[i]) );
-      }  
+      if(val is ArrayCollection) {
+       for (var i:int = 0;i<(val as ArrayCollection).length;i++) { 
+        this[key].addItem( new DescribeLayoutSection((val as ArrayCollection)[i]) );
+       }
+      } else this[key].addItem( new DescribeLayoutSection((val as ObjectProxy)));
      } else if (key == "relatedLists") {
       this[key] = new ArrayCollection();
       for (var i2:int = 0;i2<(val as ArrayCollection).length;i2++) { 

 cheers,
Andi

Hi,

this is all the documentation has to say about Integer formatting:

Table 2. Integer Instance Methods
NameArgumentsReturn TypeDescription
format  StringReturns the integer as a string

Obviously, this isn't much. However, I noticed that the returned String changes depending on the users locale setting, e.g

Integer testInt = 1000;
String intStr = testInt.format();
intStr now is either 1,000 or 1.000, depending on the locale. (I only tested 2 settings).

This itself doesn't bother me, but it should be mentioned in the documenation.
What I would like to see though are formatting options like in Java, so I can surpress grouping seperators or have leading zeros and so on.

Thanks
Hi,
The Force.com IDE improves with every release, which is great. However, one odd thing I noticed is that the syntax coloring seems to be case sensitive.
For example, if one types
Map<Id,String> ... no coloring happens, where as if you use lowercase for map as in "map<Id,String>", map gets colored nicely. This doesn't really improve readability and somehow defeats the purpose of syntax coloring. Same is true for DML statements like select vs SELECT.
Please make the coloring case insensitive and maybe add data types to the coloring too when you're at it.
That would improve the IDE a lot.
Thanks,
Andreas

I wasn't sure if this should go to Ideas or not, so I posted it here.

Hi,

 

I'm encountering an odd problem and I'm not sure if I'm doing something wrong or hitting a bug.

I have a managed package which includes workflow rules and translations to various languages.

 

We're using the Trialforce DOT process to create new orgs with that package already installed.

 

Now if one of these orgs changes the default language to something other than "English" and then upgrades the package, the workflow rules still have entry criteria like 'somefield__c equals "true"' for a checkbox field which is of course not editable because it's a managed package.

However, since the org uses a different language, it seems that it expects the workflow rule to check for the localized value of 'true', i.e. 'wahr' in a German org.

So the workflow rules don't work anymore. And since they cannot be edited, one has to deactivate and clone them, using the correct language.

 

Any ideas what the issue might be here? I'm at a loss..

 

Thanks,

Andreas

Hi to everybody,

we use a Professional Edition of SalesForce.com and we have to develop new VF pages for Opportunty to our sales department.

After we "deploy" this pages it seems the sharing rules are no more respected,indeed every standard user could access and modify every opportunity.

 

I post the "detail page" 

 

Thank you for support

 

Regards 

Marco

 

 

 

<apex:page standardController="Opportunity" tabStyle="Opportunity" id="viewOpp" showHeader="true">
    <script> 
        function confirmCancel() {
            var isCancel = confirm("Sei sicuro di voler annullare?");
            if (isCancel) return true;
                return false;
        }
    </script>
    <apex:sectionHeader title="Dettaglio Opportunità" help="Guida per questa pagina" />
 
    <apex:form id="oppForm">
        <apex:pageBlock title="Dettaglio Opportunità" mode="detail" id="oppFirstPage" >
            <apex:pageBlockButtons >
                <apex:commandButton action="{!edit}" value="Modifica" rendered="{!$ObjectType.opportunity.updateable}"/>
                <apex:commandButton action="{!cancel}" value="Cancella" onclick="return confirmCancel()" immediate="true"/>
            </apex:pageBlockButtons>
            <apex:pageBlockSection title="Informazioni Opportunità" id="oppInfo">
                <!-- Within a pageBlockSection, outputFields always display with their
                corresponding output label. -->
                <apex:outputField id="opportunityOwner" value="{!opportunity.ownerId}"/>
                <apex:outputField id="opportunityCloseDate" value="{!opportunity.closeDate}"/>
                <apex:outputField id="opportunityName" value="{!opportunity.name}"/>
                <apex:outputField id="opportunityStageName" value="{!opportunity.stageName}" />
                <apex:outputField id="opportunityAccount" value="{!opportunity.accountId}" />
                <apex:outputField id="opportunityStageProbability" value="{!opportunity.probability}"/>
                <apex:outputField id="opportunityType" value="{!opportunity.type}"/>
                <apex:outputField id="opportunityAmount" value="{!opportunity.amount}"/>
                <apex:outputField id="opportunityProduct" value="{!opportunity.Prodotto__c}" />
            </apex:pageBlockSection>
            <apex:pageBlockSection title="Informazioni Descrizione">
                <apex:outputField id="opportunityDescription" value="{!opportunity.description}"/>
                 <apex:outputField id="opportunityCreator" value="{!opportunity.CreatedById}"/>
                <apex:outputField id="opportunityLastModifier" value="{!opportunity.LastModifiedById}"/>
            </apex:pageBlockSection>
            <apex:pageBlockSection title="Informazioni Aggiuntive">
                <apex:outputField id="opportunityNextStep" value="{!opportunity.nextStep}"/>
                <apex:outputField id="opportunityLeadSource" value="{!opportunity.leadSource}"/>
            </apex:pageBlockSection>
            <apex:pageBlockSection id="FASTInvoiceSummary" title="Sommario FAST.Invoice" columns="2" rendered="{!opportunity.Prodotto__c = 'FAST.Invoice'}">
                <apex:outputField id="opportunityAmmontarePotenziale" value="{!opportunity.Ammontare_a_Regime__c}"/>
                <apex:outputField id="opportunityAmmontarePrevisto" value="{!opportunity.Ammontare_1_Anno__c}"/>
                <apex:outputField id="opportunityFattureAttiveAmmPotenziale" value="{!opportunity.Ammontare_Fatture_Attive_a_Regime__c}"/>
                <apex:outputField id="opportunityFattureAttiveAmmPrevisto" value="{!opportunity.Ammontare_Fatture_Attive_1_Anno__c}"/>
                <apex:outputField id="opportunityFatturePassiveAmmPotenziale" value="{!opportunity.Ammontare_Fatture_Passive_a_Regime__c}"/>
                <apex:outputField id="opportunityFatturePassiveAmmPrevisto" value="{!opportunity.Ammontare_Fatture_Passive_1_Anno__c}"/>
                <apex:outputField id="opportunityFatturePostalizzateAmmPotenziale" value="{!opportunity.Ammontare_Posta_ne_a_Regime__c}"/>
                <apex:outputField id="opportunityFatturePostalizzateAmmPrevisto" value="{!opportunity.Ammontare_Posta_ne_1_Anno__c}"/>
                <apex:outputField id="opportunityFattureConservateAmmPotenziale" value="{!opportunity.Ammontare_Conservazione_a_Regime__c}"/>
                <apex:outputField id="opportunityFattureConservateAmmPrevisto" value="{!opportunity.Ammontare_Conservazione_1_Anno__c}"/>
                <apex:outputField id="opportunityDocumentiPregressoAmmPotenziale" value="{!opportunity.Ammontare_Potenziale_Pregresso__c}"/>
                <apex:outputField id="opportunityDocumentiPregressoAmmPrevisto" value="{!opportunity.Ammontare_Pregresso__c}"/>
            </apex:pageBlockSection>
            <apex:pageBlockSection id="FASTInvoice" title="Informazioni FAST.Invoice" columns="2" rendered="{!opportunity.Prodotto__c = 'FAST.Invoice'}">
                <apex:outputField id="opportunityUnaTantum" value="{!opportunity.Una_Tantum_Integrazione__c}"/>
                <apex:outputField id="opportunityCanoneAnno" value="{!opportunity.Canone_Annuo__c}"/>
               
                <apex:outputField id="opportunityFattureAttiveAnno" value="{!opportunity.Fatture_Attive_Anno__c}"/>
                <apex:outputField id="opportunityFattureAttivePrevisteAnno" value="{!opportunity.Fatture_Attive_Previste_Anno__c}"/>
                <apex:outputField id="opportunityFeeFatturaAttiva" value="{!opportunity.Fee_fattura_attiva__c}"/>
               
                <apex:outputField id="opportunityFatturePassiveAnno" value="{!opportunity.Fatture_Passive_Anno__c}"/>
                <apex:outputField id="opportunityFatturePassivePrevisteAnno" value="{!opportunity.Fatture_Passive_Previste_Anno__c}"/>
                <apex:outputField id="opportunityFeeFatturaPassiva" value="{!opportunity.Fee_Fattura_Passiva__c}"/>
              
                <apex:outputField id="opportunityFatturePostalizzateAnno" value="{!opportunity.Fatture_Postalizzate_Anno__c}"/>
                <apex:outputField id="opportunityFatturePostalizzatePrevisteAnno" value="{!opportunity.Fatture_Postalizzate_Previste_Anno__c}"/>
                <apex:outputField id="opportunityFeeFatturaPostalizzata" value="{!opportunity.Fee_Fattura_Postalizzata__c}"/>
               
                <apex:outputField id="opportunityDocumentiPregressoAnno" value="{!opportunity.Numero_Documenti_Pregresso__c}"/>
                <apex:outputField id="opportunityDocumentiPregressoPrevisteAnno" value="{!opportunity.Numero_Documenti_Pregresso_Previsti__c}"/>
                <apex:outputField id="opportunityFeeDocumentiPregresso" value="{!opportunity.Fee_Documenti_Pregressi__c}"/>
             
                <apex:outputField id="opportunityDocumentiConservazioneAnno" value="{!opportunity.Documenti_per_Conservazione_Anno__c}"/>
                <apex:outputField id="opportunityDocumentiConservazionePrevisteAnno" value="{!opportunity.Documenti_Conservazione_Previsti_Anno__c}"/>
                <apex:outputField id="opportunityFeeDocumentoConservazione" value="{!opportunity.Fee_Documenti_Conservati__c}"/>
            </apex:pageBlockSection>
        </apex:pageBlock>
       </apex:form>
      
    <apex:relatedList subject="{!opportunity}" id="actList" list="OpenActivities"/>
   
    <apex:relatedList subject="{!opportunity}" id="actHistList" list="ActivityHistories" />
   
    <apex:relatedList subject="{!opportunity}" id="contList" list="OpportunityContactRoles" />

    <apex:relatedList subject="{!opportunity}" id="partList" list="OpportunityPartnersFrom" />
   
    <apex:relatedList subject="{!opportunity}" id="compList" list="OpportunityCompetitors" />
 
    <apex:relatedList subject="{!opportunity}" id="histList" list="OpportunityHistories" />

    <apex:relatedList subject="{!opportunity}" id="notList" list="NotesAndAttachments" />
       
</apex:page>

  • September 29, 2009
  • Like
  • 0

Hi,

 

We got an issue with accessing data from a Visualforce page contained in Sites. The data that should be displayed is from a custom object contained in a licensed managed package. This worked fine until the package was upgraded to a new version which required licesing.

My guess it's something related to the sites user not having a license for that package (doesn't show in the user list for assigning licenses).

 

The Problem: the visualforce page called when normally loged in with a licensed user works as expected (via /apex/Pagename). When called from outside via domainname.force.com/Pagename it shows only empty values. The page iterates over a list of objects with apex:repeat. I get as many empty objects as I should get, so that part works. Just the values are missing, using {!object.field__c} syntax.

 

Any hints, pointers? Maybe a bug? I couldn't find anything regarding that odd bevavior.

 

The page code:

 

<apex:page cache="false" controller="XMLlistingController" contentType="application/xml"><?xml version="1.0" encoding="UTF-8"?>
<LocationList>
<apex:repeat value="{!locations}" var="location">
<Location__c>
<Id><apex:outputText value="{!location.Id}" /></Id>
<Name><apex:outputText value="{!location.Name}" /></Name>
</Location__c>
</apex:repeat>
</LocationList>
</apex:page>

 

The controller simply queries for the Location__c custom object and returns a list.

 

Output from /apex/LocationPage

 

<LocationList>
<Location__c>
<Id>
a0B80000003uOfiEAE
</Id>
<Name>
Example Location
</Name>
</Location__c>
</LocationList>

 

output from domainname.force.com/LocationPage:

 

<LocationList>
<Location__c>
<Id/>
<Name/>
</Location__c>
</LocationList>

 

edit: Just to underline it's not a basic permission problem:

The sites user has all necessary permissions on that object, also field level security settings are fine. It worked before licesing for that package was turned on.

 

 

 

 

 

Message Edited by wintamute on 09-18-2009 01:06 PM
Message Edited by wintamute on 09-18-2009 02:07 PM

My Visual force page is using custom components created in the same org. Till yesterday the page was working fine but all of sudden today I am getting this error when I open this page.

 

Tag Library supports namespace: http://salesforce.com/standard/components/apex, but no tag was defined for name: attribute

 

 

Another trivial but strange thing thats happening is that, I can't open a component in view mode. On trying to view the component from Setup > Develop > Components. Following salesforce error comes, though we can edit the component :)

 
An internal server error has occurred An error has occurred while processing your request. The salesforce.com support team has been notified of the problem. If you believe you have additional information that may be of help in reproducing or correcting the error, please contact support@salesforce.com. Please indicate the URL of the page you were requesting, any error id shown on this page as well as any other related information. We apologize for the inconvenience.

Thank you again for your patience and assistance. And thanks for using Salesforce!

Error ID: 299154357-472 (-607383983)

 

I am getting couple of these wierd errors recently, like I get same error on "Run All Tests".

 

Does this means that latest salesforce upgrades are not stable and worth installing ?? I tried removing the custom components, still the error is coming.

 

Please help !

I've got a SWF that's embedded in a VF page.  I've set the layout that houses the VF page to be a one-column layout and the page has nothing but the swf embedded in it.  the swf itself has only a form wrapper around the google map.  Why doesn't the Map extend the width of the screen?

 

 

<apex:page standardController="Location__c" extensions="GoogleMapManager">
<apex:flash id="flexSOs" src="{!$Resource.FlexGoogleMap}"

height="100%" width="100%"

flashvars="session_id={!$Api.Session_ID}&server_url={!$Api.Partner_Server_URL_150}&aLoc={!latitude}&zLoc={!longitude}"/>

</apex:page>

 

 

<?xml version="1.0" encoding="utf-8"?>
<mx:Application
    xmlns:mx="http://www.adobe.com/2006/mxml"
    layout="absolute"
creationComplete="init();"
width="100%"
height="100%"
viewSourceURL="srcview/index.html">
<mx:Script>
    <![CDATA[
  
        import com.google.maps.LatLng;
        import com.google.maps.Map;
        import com.google.maps.MapEvent;
        import com.google.maps.MapType;
        import com.google.maps.overlays.Marker;
        import com.google.maps.MapMouseEvent;
        import mx.collections.ArrayCollection;
        import com.google.maps.controls.ScaleControl;
        import com.google.maps.controls.ZoomControl;
        import com.google.maps.controls.MapTypeControl;
       
        [Bindable]
        public var locations:ArrayCollection = new ArrayCollection();
       
        public function init():void{
            Security.allowInsecureDomain("maps.googleapis.com");
        }
       
        private function onMapReady(event:MapEvent):void {
            var lat:Number = parseFloat(parameters.aLoc);
            var lon:Number = parseFloat(parameters.zLoc);
              var latLng:LatLng = new LatLng(lat, lon);
              var marker:Marker = new Marker(latLng);
              map.setCenter(latLng, 17, MapType.NORMAL_MAP_TYPE);
              map.addOverlay(marker);
              map.addControl(new ScaleControl());
              map.addControl(new ZoomControl());
              map.addControl(new MapTypeControl());
        }
    ]]>
    </mx:Script>
        <mx:Form
            width="100%" height="100%"
            borderStyle="solid" borderColor="#D4D4D4"
            dropShadowEnabled="true" dropShadowColor="#B3B3B3"
            shadowDirection="right" shadowDistance="10">
                    <maps:Map xmlns:maps="com.google.maps.*" mapevent_mapready="onMapReady(event)" id="map"
                    key="ABQIAAAAA7aFgeQgFpt9KTUNsnsLOxS_OfvXuFpkKLqWEAhV7rt46ELgZhQqmfKMyH0V6D-GCiomYQVTAEWYSQ"/>
        </mx:Form>       
</mx:Application>

  • April 27, 2009
  • Like
  • 0

I'm befuddled and puzzled.  I just got the Google Maps API for Flex to embed properly in SF and now I am trying to get a data grid to fill with SF data in the same SWF.  I've gotten data out of Salesforce in the past using the as3salesforce.swc library but it doesn't seem to work anymore.  I've been following threads about the appropriate server_url (which I've now replaced with v15 to no avail).  Anybody else noticing problems with the toolkit?

 

<apex:page standardController="Location__c">
<apex:form >
<apex:pageBlock title="Flex implementation">
<apex:flash id="flexSOs" src="{!$Resource.SFFlex}" height="100%" width="100%"
flashvars="session_id={!$Api.Session_ID}&server_url={!$Api.Partner_Server_URL_150}"/>
</apex:pageBlock>
</apex:form>
</apex:page>

 Here's the mxml code:

 

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
xmlns:salesforce="http://www.salesforce.com/"
creationComplete="login(event)"
viewSourceURL="srcview/index.html">
    <salesforce:Connection id="connection"/>
   
    <mx:Script>
    <![CDATA[
    import com.salesforce.objects.SObject;
    import com.salesforce.results.QueryResult;
    import com.salesforce.AsyncResponder;
    import com.salesforce.objects.LoginRequest;
    import mx.core.IUIComponent;
    import mx.managers.DragManager;
    import mx.events.DragEvent;
    import mx.collections.ArrayCollection;
    import flash.external.ExternalInterface;
   
    [Bindable]
    public var selectedItem:Object;
    [Bindable]
    public var selectedSOs:ArrayCollection = new ArrayCollection();;

    private function login(event:Event):void {
                var lr:LoginRequest = new LoginRequest();
                lr.server_url = parameters.server_url;
                lr.session_id = parameters.session_id;
                lr.callback = new AsyncResponder(getCandidateSOs);
                connection.login(lr);
            }
   
    private function getCandidateSOs(o:Object=null):void{
        connection.query("Select Id, A_Loc__c from Service_Order__c"
        , new AsyncResponder(
        function (qr:QueryResult):void {
            candidateSOs.dataProvider = qr.records;
        }));

    }
    ]]>
    </mx:Script>

<mx:Form id="frmPrintSO"
            width="100%" height="75%"
            borderStyle="solid" borderColor="#D4D4D4"
            dropShadowEnabled="true" dropShadowColor="#B3B3B3"
            shadowDirection="right" shadowDistance="10">
    <mx:FormHeading label="Signature SOs"     />
    <mx:HBox>
        <mx:VBox>
            <mx:Label text="Candidate SOs"/>
            <mx:DataGrid id="candidateSOs"
                allowMultipleSelection="true"
                dragEnabled="true"
                dropEnabled="true"
                dragMoveEnabled="true">
                <mx:columns>
                    <mx:DataGridColumn dataField="Name"/>
                    <mx:DataGridColumn dataField="A_Loc__c"/>
                </mx:columns>   
            </mx:DataGrid>
        </mx:VBox>
    </mx:HBox>
</mx:Form>
</mx:Application>

  • April 27, 2009
  • Like
  • 0

 

<apex:includeScript value="/soap/ajax/15.0/connection.js"/><apex:includeScript value="/soap/ajax/15.0/apex.js"/>sforce.connection.sessionId = '{!$Api.Session_ID}';

I have the above code in a visualforce page.

As per document, the AJAX toolkit supposed to handle the session Id by itself with no extra work.

But i get invalid sessionID error, if i dont set it onload of the page.

 

Is there something i'm missing?

Is using Controller the alternative to avoid this?

 

Thanks

KK 

 

 

I have created a Flex component that I've now deployed as both an S-Control and a Visualforce page.  The Flex code attempts to use the session id and server url for logins. These values are passed in as Flash variables. When this code is invoked from the S-Control the login succeeeds.  However the login fails when invoked from the Visualforce page. (I can also login with username and password from the page).


The html body for the S-Control:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head></head>
<body scroll="no" >
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
id="FlexSalesforce" width="100%" height="100%"
codebase="https://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab">
<param name="movie" value="{!Scontrol.JavaArchive}" />
<param name="quality" value="high" /><param name="play" value="true" />
<param name="bgcolor" value="#f3f3ec" />
<param name="allowScriptAccess" value="always" />
<param name="flashvars"
value="session_id={!API.Session_ID}&server_url={!API.Partner_Server_URL_140}" />
<embed src="{!Scontrol.JavaArchive}" play="true" bgcolor="#f3f3ec"
width="100%" height="700" name="FlexSalesforce" align="middle"
flashvars="session_id={!API.Session_ID}&server_url={!API.Partner_Server_URL_140}&externalURL=https://na6.salesforce.com/resource/123XXXX89000/salesforceRSL"
loop="false" allowScriptAccess="always" type="application/x-shockwave-flash"
pluginspage="http://www.adobe.com/go/getflashplayer">
</embed>
</object>
</body>
</html>



The syntax of my page is:

<apex:page sidebar="true" showheader="true">
<apex:flash src="{!$Resource.Example5}" height="500" width="100%"
         flashvars="session_id={!$Api.SESSION_ID}&server_url={!$Api.Partner_Server_URL_140}&externalURL={!$Resource.salesforceRSL}"/>
</apex:page>

 

Within my Flash component, the following code snippet gets called:

 

               var connection:Connection = new Connection();

                var sessionId:String = Application.application.parameters[SESSION_ID];
                var serverUrl:String = Application.application.parameters[SERVER_URL];
                if (sessionId != null && serverUrl != null)
                {
                    LOG.debug("Using session id for login");
                    lr.server_url = serverUrl;
                    lr.session_id = sessionId;
                    loginResponder = new AsyncResponder(loginCallback);
                    lr.callback = loginResponder;

                    //connection.protocol = "https";   //tried with and without setting these
                    //connection.serverUrl = serverUrl;

                    connection.login(lr);
                }

 

I've noticed that the sessionId's are different for the page vs. the S-Control even though they are invoked from the same browser moments apart. I've also noticed that the URLs for the control use "https://na6.visual.force.com" vs. "https://c.na6.visual.force.com" for the page.


I'm seeing the following output in my logs for the page case:

 

Starting login
Using session id for login

loginWithSessionId(
 sid: 510600  [....]  _p4DIBpWrGf
 surl: https://c.na6.visual.force.com/services/Soap/u/14.0/510600D80000000ZTCY
);
App Domain = c.na6.visual.force.com
Api Server name = c.na6.visual.force.com
_internalServerUrl = https://c.na6.visual.force.com/services/Soap/u/14.0/510600D80000000ZTCY
loading the policy file: https://c.na6.visual.force.com/services/Soap/cross-domain.xml
Your application must be running on a https server in order to use https to communicate with salesforce.com!
invoke getUserInfo
intServerUrl is null
intServerUrl = https://c.na6.visual.force.com/services/Soap/u/14.0/510600D80000000ZTCY
_invoke getUserInfo
'0078EE29-37C1-427B-78E0-AE6DF3EE2F28' producer set destination to 'DefaultHTTPS'.
Method name is: getUserInfo
'direct_http_channel' channel endpoint set to http://c.na6.visual.force.com/resource/1235576467000/
'0078EE29-37C1-427B-78E0-AE6DF3EE2F28' producer sending message 'B769C4FE-87A6-A2E6-F4DA-AE6DF3FD5ABB'
'direct_http_channel' channel sending message:
(mx.messaging.messages::HTTPRequestMessage)#0
  body = "<se:Envelope xmlns:se="http://schemas.xmlsoap.org/soap/envelope/"><se:Header xmlns:sfns="urn:partner.soap.sforce.com"><sfns:SessionHeader><sessionId>510600D80000  [...]        dDV1hVMr_p4DIBpWrGf</sessionId></sfns:SessionHeader></se:Header><se:Body><getUserInfo xmlns="urn:partner.soap.sforce.com" xmlns:ns1="sobject.partner.soap.sforce.com"/></se:Body></se:Envelope>"
  clientId = (null)
  contentType = "text/xml; charset=UTF-8"
  destination = "DefaultHTTPS"
  headers = (Object)#1
  httpHeaders = (Object)#2
    Accept = "text/xml"
    SOAPAction = """"
    X-Salesforce-No-500-SC = "true"
  messageId = "B769C4FE-87A6-A2E6-F4DA-AE6DF3FD5ABB"
  method = "POST"
  recordHeaders = false
  timestamp = 0
  timeToLive = 0
  url = "https://c.na6.visual.force.com/services/Soap/u/14.0/510600D80000000ZTCY"
'0078EE29-37C1-427B-78E0-AE6DF3EE2F28' producer connected.
Method name is: getUserInfo
'0078EE29-37C1-427B-78E0-AE6DF3EE2F28' producer acknowledge of 'B769C4FE-87A6-A2E6-F4DA-AE6DF3FD5ABB'.
responseType: Fault
Saleforce Soap Fault: sf:INVALID_SESSION_ID
INVALID_SESSION_ID: Invalid Session ID found in SessionHeader: Illegal Session
(com.salesforce.results::Fault)#0
  context = (null)
  detail = (Object)#1
    UnexpectedErrorFault = (Object)#2
      exceptionCode = "INVALID_SESSION_ID"
      exceptionMessage = "Invalid Session ID found in SessionHeader: Illegal Session"
      xsi:type = "sf:UnexpectedErrorFault"
  faultcode = "sf:INVALID_SESSION_ID"
  faultstring = "INVALID_SESSION_ID: Invalid Session ID found in SessionHeader: Illegal Session"
Error: Ignoring policy file requested from https://c.na6.visual.force.com/crossdomain.xml because a cross-domain redirect to https://na6.salesforce.com/crossdomain.xml occurred.
Warning: Domain c.na6.visual.force.com does not explicitly specify a meta-policy, but Content-Type of policy file https://c.na6.visual.force.com/services/Soap/cross-domain.xml is 'text/x-cross-domain-policy'.  Applying meta-policy 'by-content-type'.
 

 

Thanks in advance for your help.

David



hi
 
how can i give the where clause in SOQL for a multipicklist type field.
I would like to create a Trigger that captures a user's attempt to delete a record and instead mark that record as "Inactive" and cancel the delete request.
 
I have attempted to use the beforeDelete and afterDelete triggers, as well as attempted to allow the delete and then undelete the record afterwards.  I keep running into various walls.
 
I imagine that this is something that is probably fairly common yet I can't find any examples of how best to do this. 
Can anyone give me some ideas or otherwise point me in the right direction?
 
 
Thanks
Jon
 
Is there any way to check if a list contains a certain element?  I looked at the List functions and did not see any contain() function like Java has, so I was wondering how other people are handling this.
 
Thanks
In the latest version of the eclipse IDE:

Generally speaking, if I right click a folder, do Force.com>Refresh from Server, it seems to actually refresh those elements that have changed.

However, I just tried that on the objects folder, and some of my changes were not updated.  Specifically, I made some changes to fields in the Contact object, but those changes were not refreshed to the IDE.

Is this a bug?   Or is there some rhyme or reason to what refreshes when, and what doesn't?

Thanks very much!


Update: I can get those Contact changes to refresh by specifically refreshing the Contact object, as opposed to the Objects folder.  But it sure would be nice to refresh folders and have the confidence that all changes will show up.  So my question still stands.  Thanks!


Message Edited by sparky on 11-18-2008 10:11 AM
  • November 18, 2008
  • Like
  • 0
Since using the new release of the IDE (version 14) I get enormous amounts of debug output, no matter what log level are set. These settings seem to get ignored, the same seems to happen in the browser output when running tests.
I set the various log levels for each category, basically disabling everything except apex code, but each test case gets several thousand (!) lines of output. So the debug log only contains output for 3 test methods before all further output gets truncated.
This makes it pretty much impossible to use the output for debugging since it misses most of the other test methods and is totally bloated with information I didn't want to see in the first place.
Any ideas what's going on here? Are the log levels just broken? Anything I can do to get useful debug log output?
I recently heard that packaging up apex classes that utilise dynamic apex breaks the code.  I was wondering whether this was an outstanding issue, or it has been resolved.

Dynamic Apex seems to work fine for me when packaging, but using Schema.getGlobalDescribe() only seems to get me one custom object - I only have one custom object in my account at the moment, which is being packaged up.  Before packaging, I had access to all objects (i.e. Accounts, Opportunities etc.)

Maybe the Schema.getGlobalDescribe() method is only getting objects in my package?  Migrating my code using ANT into a totally new salesforce account seems to fix my current issue.

Can we expect a fix for this soon?


Message Edited by XactiumBen on 11-14-2008 11:33 AM
Hi,

When creating new custom profiles in a sandbox via the browser, I can clone either license types "salesforce" or "salesforce platform" (when platform licenses are enabled that is).
However, when trying to deploy theses profiles to the production org with the IDE (or ant tool), they will be created as type "salesforce" and are not available for platform users. When looking at the profile in the IDE, there is no way to distinguish both types.

So instead of deploying them, I have to re-create them manually in the production org which is time consuming and error prone.

Is this expected behavior or a bug?

Thanks,
Andreas
Hi,
the latest flex toolkit contains a bug when doing a DescribeLayout Call and the editLayoutSection contains only a single section. DescribeLayout throws a null-pointer error in this case.
Since the source is available, I did a quick fix so the maintainer of the toolkit can add it to the respository.

Code:
Index: /Users/andi/Documents/workspace33/Salesforce Flex sdk/src/com/salesforce/results/DescribeLayout.as
===================================================================
--- /Users/andi/Documents/workspace33/Salesforce Flex sdk/src/com/salesforce/results/DescribeLayout.as (revision 722)
+++ /Users/andi/Documents/workspace33/Salesforce Flex sdk/src/com/salesforce/results/DescribeLayout.as (working copy)
@@ -27,9 +27,8 @@
 */
 package com.salesforce.results
 {
+ import mx.collections.ArrayCollection;
  import mx.utils.ObjectProxy;
- import mx.collections.ArrayCollection;
- import com.salesforce.results.*;
   /**
    * Returned in the response to describeLayout(), contains detailed information on the custom or standard object page layout
    * 
@@ -51,9 +50,11 @@
      // one of detailLayoutSections, editLayoutSections, relatedList
      if (key == "detailLayoutSections" || key == "editLayoutSections") {
       this[key] = new ArrayCollection();
-      for (var i:int = 0;i<(val as ArrayCollection).length;i++) { 
-       this[key].addItem( new DescribeLayoutSection((val as ArrayCollection)[i]) );
-      }  
+      if(val is ArrayCollection) {
+       for (var i:int = 0;i<(val as ArrayCollection).length;i++) { 
+        this[key].addItem( new DescribeLayoutSection((val as ArrayCollection)[i]) );
+       }
+      } else this[key].addItem( new DescribeLayoutSection((val as ObjectProxy)));
      } else if (key == "relatedLists") {
       this[key] = new ArrayCollection();
       for (var i2:int = 0;i2<(val as ArrayCollection).length;i2++) { 

 cheers,
Andi