• FSamorgan
  • NEWBIE
  • 25 Points
  • Member since 2009

  • Chatter
    Feed
  • 0
    Best Answers
  • 2
    Likes Received
  • 0
    Likes Given
  • 6
    Questions
  • 7
    Replies
This is a warning to every Visualforce developer here. Salesforce will clober your javascript at any time with no warning. I experienced a 100% customer outage due to Salesforce updating their Javascript in the middle of the night a couple weeks ago. This was their customer support response from tier 3:


"Customers should be namespacing (well, pseudo-namespacing) their JavaScript code to avoid collisions like this. That's just standard web development method."

"Salesforce libraries are growing faster and we cannot possibly document every global variable/function that we're adding to the JavaScript that is served with Salesforce."
 
I just had Salesforce rudely stomp my app (listed on the AppExchange) last Wednesday (July 6th) because Salesforce added a new Javascript function named Scheduler in their Visualforce Page Javascript. This Javascript function overwrote my object with the same name which caused a service interruption for every single one of our customers. Is it Salesforce's policy to change the Javascript API mid release cycle? Is it possible to get a heads up when the Javascript environment is expected to change on the Visualforce Page platform?
I have a Visualforce page that has javascript that creates urls as var url = '/' + obj.Id; this works fine when accessed in the normal Salesforce context but when this Visualforce page is accessed from a community then the url no longer works. This is because it expects the url to be var url = '/mycommunity/' + obj.Id;
I cannot use the typical solution {!URLFOR()} because the objects are being pulled via Javascript Remoting. Is there a way via Apex or preferrably Javascript to know the community name (if present)? So I can do var url = '/'; if (isCommunity) url += communityName + '/' ; url += obj.Id;
I need a solution that works both in and out of a community using the same Visualforce page.
I have a visualforce page with this code:
<apex:page contentType="application/javascript">
<![CDATA[
for (var i=0; i < 5; i++) {
  console.log('Hello World');
}
]]>
</apex:page>

When I load the page up I get this:
<![CDATA[ for (var i=0; i < 5; i++) {]]><![CDATA[   console.log('Hello World');]]><![CDATA[ }]]><![CDATA[ ]]>

This is obviously incorrect and a bug. The content type is application/javascript and the output is outputting XML. The output should be the CDATA contents.
If I query a SplitField from OpportunitySplitType when I have custom split types I get a result similar to "00N80000004bFXREA2" I would like to get the API name so I can make use of this in a query on the Opportunity object.

SOQL: select SplitField from OpportunitySplitType

I would like to know how to programmatically convert '00N80000004bFXREA2' to 'Product_A__c' using either Apex or Javascript from a Vusualforce Page.
 
I am trying to write an soql that queries owners in opportunities as well as including the opportunities that have those split owners.

For example if I want Opportunities that Angela and Bob own I write:
SELECT Id from Opportunity where OwnerId in (:AngelaId, :BobId);
but I also want to include opportunities that Angela and Bob own as split owners. How do I do this?

a bad example to try to show what I want:
SELECT Id from Opportunity where OwnerId in (:AngelaId, :BobId) or OpportunitySplit.SplitOwnerId in (:AngelaId, :BobId);
This is a warning to every Visualforce developer here. Salesforce will clober your javascript at any time with no warning. I experienced a 100% customer outage due to Salesforce updating their Javascript in the middle of the night a couple weeks ago. This was their customer support response from tier 3:


"Customers should be namespacing (well, pseudo-namespacing) their JavaScript code to avoid collisions like this. That's just standard web development method."

"Salesforce libraries are growing faster and we cannot possibly document every global variable/function that we're adding to the JavaScript that is served with Salesforce."
 
I have a visualforce page with this code:
<apex:page contentType="application/javascript">
<![CDATA[
for (var i=0; i < 5; i++) {
  console.log('Hello World');
}
]]>
</apex:page>

When I load the page up I get this:
<![CDATA[ for (var i=0; i < 5; i++) {]]><![CDATA[   console.log('Hello World');]]><![CDATA[ }]]><![CDATA[ ]]>

This is obviously incorrect and a bug. The content type is application/javascript and the output is outputting XML. The output should be the CDATA contents.
I just had Salesforce rudely stomp my app (listed on the AppExchange) last Wednesday (July 6th) because Salesforce added a new Javascript function named Scheduler in their Visualforce Page Javascript. This Javascript function overwrote my object with the same name which caused a service interruption for every single one of our customers. Is it Salesforce's policy to change the Javascript API mid release cycle? Is it possible to get a heads up when the Javascript environment is expected to change on the Visualforce Page platform?
I have a Visualforce page that has javascript that creates urls as var url = '/' + obj.Id; this works fine when accessed in the normal Salesforce context but when this Visualforce page is accessed from a community then the url no longer works. This is because it expects the url to be var url = '/mycommunity/' + obj.Id;
I cannot use the typical solution {!URLFOR()} because the objects are being pulled via Javascript Remoting. Is there a way via Apex or preferrably Javascript to know the community name (if present)? So I can do var url = '/'; if (isCommunity) url += communityName + '/' ; url += obj.Id;
I need a solution that works both in and out of a community using the same Visualforce page.
I have a visualforce page with this code:
<apex:page contentType="application/javascript">
<![CDATA[
for (var i=0; i < 5; i++) {
  console.log('Hello World');
}
]]>
</apex:page>

When I load the page up I get this:
<![CDATA[ for (var i=0; i < 5; i++) {]]><![CDATA[   console.log('Hello World');]]><![CDATA[ }]]><![CDATA[ ]]>

This is obviously incorrect and a bug. The content type is application/javascript and the output is outputting XML. The output should be the CDATA contents.
If I query a SplitField from OpportunitySplitType when I have custom split types I get a result similar to "00N80000004bFXREA2" I would like to get the API name so I can make use of this in a query on the Opportunity object.

SOQL: select SplitField from OpportunitySplitType

I would like to know how to programmatically convert '00N80000004bFXREA2' to 'Product_A__c' using either Apex or Javascript from a Vusualforce Page.