• tyshock
  • NEWBIE
  • 0 Points
  • Member since 2004

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 6
    Questions
  • 11
    Replies
In the AJAX code, if you set both an onChange, and a onBeforeChange on a property, a logic problem occurs.
 
It seems to me that the onChange shouldn't get fired if the beforeChange returns false.  However, the library allows both to get fired regardless of the beforeChange outcome.
 
 
In Property.prototype.getFormattedValue(), there is a call to undefined function parseDouble().
 
Either this function was left out of the lib, or it should be changed to parseFloat(), which worked correctly for my implementation.
 
 
I was reading Dave's 3.3 beta blog entry, and he mentions the QueryResult.save() method.  However, this method doesn't yet exist in the 3.3 code.  Is this a future enhancement?
 
Also, from the docs i read, it says only a DynaBeans changed props should be sent during a save() call.  However, the save() call appears to always send all set properties for an update.
 
For the time being i'm going to assign onChange events to my editable bean props in order to flag dirty beans.
 
FYI:
 
This *may* be related to the following bit of unreachable code in Dynabean.beanToSObject (elseif block can't be reached......may be intentional since it's still beta):
 
Code:
if (filter != undefined) {
 if (filter == "forupdate") {
  addField = (fldDef.updateable  == true || fldDef.name.toLowerCase() == "id");
 } else if (filter == "forcreate") {
  addField = (fldDef.createable == true);
  if (prop.element != undefined) {
   addField = addField && (prop.dirty == true);
  }
  //addField = (addField && (prop.element != undefined && prop.dirty == true))
 } else if (filter == "forupdate") {
  addField = (fldDef.updateable  == true || fldDef.name.toLowerCase() == "id");
  addField = (addField && fldDef.createable == true);
  addField = (addField && (prop.element != undefined && prop.dirty == true))
 }
}

 
I just wanted to provide some feedback on my experiences with getting up-to-speed with the AJAX toolkit.  A couple of my criticisms stem from the fact that some of the code from blog entry "http://blog.sforce.com/sforce/2006/04/ajax_toolkit_be.html" does not seem to work.
 
I could not get the browsersupport javascript to 'auto-append' when following the instuctions from the referenced blog.  It said I could add a query string variable to the script URL, but I couldn't get that to work.  I had to add a second include statement.  Not a big inconvenience to do this, but it did cost me ~15-20 minutes of time to figure out.
 
 
The Property.bind() calls referenced don't work.  Or, if they do work, they are not straightforward to use.  In the blog, Dave uses:
 
dynaBean.getItem("Name").bind("nameField");
 
This will not work.  Looking at the code, it appears to expect a handle to the actual element as a parameter, ie:
 
dynaBean.getItem("Name").bind(document.getElementById("nameField") );
 
However, that call didn't work either.  I didn't dig any further.
 
Once I figured out how autobinding works, single binds didn't even matter for the task at hand. However, a powerful point on autobinding that I had to 'figure out for myself' was that the fields being bound will use 'introspection' on their target form elements to render themselves. Thus, if I bind a picklist to a text field, it is just a flat field with the current value populated.  But, if I bind a picklist to a select field, it is rendered as a full select list with all picklist options.  I like this!

That's it for now.  I'll provide more feedback in the future as I begin to tackle more complex tasks than simple CRUD operations.
 
Thanks!
I'm finding the current implementation of auto-binding limited if I have > 1 dynabean of the same type that I would like to bind.  For example, if I have 2 Accounts, and 2 fields with ("afBind"="name=FirstName"), then there is no way to reliably auto-bind the 2nd bean, as it would just pick up the same form element that the first bean picked up.  The easy way to solve this is to allow an optional variable such as 'autobindAttr' which will allow you to define the custom autobind attribute name on the bind() call.
 
For example:
 
account1.bind("afBind");
account2.bind("myBind");
etc..........
 
Am I missing another easier way to handle this dilemma?
 
Thanks.
 
 

Hi,

I am trying a proof of concept to show that our dotnet based webapp can access/change info in our salesforce environment.  I am working on a simple example to get everything working.

I modified the basic c# 'quickstart' code to change the name of a salesforce 'opportunity'.  I also made a simple console app as a driver to this class.  I can compile and successfully run the consoleApp&assembly on different machines.   So far so good.

My next test was to try to integrate the assembly into our proprietary dotNet based web application.  I added a method to the 'quickstart' class (the class is now renamed PartnerOpportunityRegister)  called testObject() which returns a string ("success").  I can instantiate the class and successfully call this method, so I know the assembly is being loaded/referenced correctly from within our webapp.  However, when I try to access any methods which use sforce objects, I get the following errors:

2004.10.19 15:16:15: failed in doLogin():

Unable to generate a serializer for type PartnerOpportunity.sforce.SetPasswordResult from assembly because the assembly may be dynamic. Save the assembly and load it from disk to use it with XmlSerialization.
  
at System.Xml.Serialization.Compiler.AddImport(Type type)
   at System.Xml.Serialization.TempAssembly..ctor(XmlMapping[] xmlMappings)
   at System.Xml.Serialization.XmlSerializer.FromMappings(XmlMapping[] mappings)
   at System.Web.Services.Protocols.SoapClientType..ctor(Type type)
   at System.Web.Services.Protocols.SoapHttpClientProtocol..ctor()
   at PartnerOpportunity.sforce.SforceService..ctor()
   at PartnerOpportunity.PartnerOpportunityRegister.doLogin()

What does this mean?  I am quite new to dotNet, so I may be ignorant to the obvious here.  Thanks in advance to any responses.

 

 

 

 

hello everyone, i have a question regarding an s-control i've built.  it's a google maps mashup, and im trying to insert a link into the location bubble to view the particular place in google earth.  i've found the correct link format (essentially the location url plus "output=kml"), but i'm having trouble getting the link to work in the s-control.

i'm formatting the bubble like so:

Code:
html += "<TD nowrap><font size=2 face='Arial, Helvetica, nonserif'><B><A HREF='#' onClick='openWindow(\"/" + prop.ID + "\"); return false;'>" + prop.name + "</A>
</B><BR>"+prop.location+"<BR><B><A HREF=' + prop.earth + '>View in Google Earth</A></B><BR>" + prop.status +"<TD><img src='"+ prop.imageURL + " ' height=80></font></TD>";
html += "</TR></BODY>";

My problem is getting the "View in Google Earth" link to launch the url...when I click the link now, it just gives me a message stating that URL doesn't exist within Salesforce.  Any help would be appreciated.

Thanks!

Is there any way to keep IE from popping up this "Alert" when using an Scontrol?



I tried putting the Scontrol in a popup window with no content around it at all... and still I received this alert...
When I click "No" it still works, however it is quite annoying and no matter how much I try to explain it, my customers especially my financial sector customers are very nervous.

-=Bryan

Update
I found out the line that's causing the alert to show up.
It's the sforceClient.init(...)
Also interesting is the order in which the coded alerts show up in.. their display order is denoted by the number at the beginning.

Code:
function initPage() {
  //Initialize the connection to salesforce.com by setting the sessionid and the
  //soap endpoint in the init call
  alert("1 initPage::before sforceClient.setLoginUrl"); 
  sforceClient.setLoginUrl("https://www.salesforce.com/services/Soap/u/7.0");
  alert("2 initPage::before sforceClient.registerInitCallback");
  sforceClient.registerInitCallback(startUp);
  alert("3 initPage::before sforceClient.init");
  sforceClient.init("{!API_Session_ID}", "{!API_Partner_Server_URL_70}", false); //this line throws the security alert
  alert("5 initPage::after sforceClient.init");
}

//=======

function startUp() {
  alert("4 startUp");
}

 

Message Edited by BJames on 05-03-200611:03 AM

I was reading Dave's 3.3 beta blog entry, and he mentions the QueryResult.save() method.  However, this method doesn't yet exist in the 3.3 code.  Is this a future enhancement?
 
Also, from the docs i read, it says only a DynaBeans changed props should be sent during a save() call.  However, the save() call appears to always send all set properties for an update.
 
For the time being i'm going to assign onChange events to my editable bean props in order to flag dirty beans.
 
FYI:
 
This *may* be related to the following bit of unreachable code in Dynabean.beanToSObject (elseif block can't be reached......may be intentional since it's still beta):
 
Code:
if (filter != undefined) {
 if (filter == "forupdate") {
  addField = (fldDef.updateable  == true || fldDef.name.toLowerCase() == "id");
 } else if (filter == "forcreate") {
  addField = (fldDef.createable == true);
  if (prop.element != undefined) {
   addField = addField && (prop.dirty == true);
  }
  //addField = (addField && (prop.element != undefined && prop.dirty == true))
 } else if (filter == "forupdate") {
  addField = (fldDef.updateable  == true || fldDef.name.toLowerCase() == "id");
  addField = (addField && fldDef.createable == true);
  addField = (addField && (prop.element != undefined && prop.dirty == true))
 }
}

 
It's hard to tell from the blog how to use these methods so if someone can provide me an example that would be great.
 
Thanks.
I'm just starting out with this API, so forgive me if my question doesn't even make sense.
 
How do I access the "current" Opportunity object. I assume that I could do a retrieve command passing in the current Opportunity_ID, but I was wondering if there was already a handle to that object available.
 
Thanks
I just wanted to provide some feedback on my experiences with getting up-to-speed with the AJAX toolkit.  A couple of my criticisms stem from the fact that some of the code from blog entry "http://blog.sforce.com/sforce/2006/04/ajax_toolkit_be.html" does not seem to work.
 
I could not get the browsersupport javascript to 'auto-append' when following the instuctions from the referenced blog.  It said I could add a query string variable to the script URL, but I couldn't get that to work.  I had to add a second include statement.  Not a big inconvenience to do this, but it did cost me ~15-20 minutes of time to figure out.
 
 
The Property.bind() calls referenced don't work.  Or, if they do work, they are not straightforward to use.  In the blog, Dave uses:
 
dynaBean.getItem("Name").bind("nameField");
 
This will not work.  Looking at the code, it appears to expect a handle to the actual element as a parameter, ie:
 
dynaBean.getItem("Name").bind(document.getElementById("nameField") );
 
However, that call didn't work either.  I didn't dig any further.
 
Once I figured out how autobinding works, single binds didn't even matter for the task at hand. However, a powerful point on autobinding that I had to 'figure out for myself' was that the fields being bound will use 'introspection' on their target form elements to render themselves. Thus, if I bind a picklist to a text field, it is just a flat field with the current value populated.  But, if I bind a picklist to a select field, it is rendered as a full select list with all picklist options.  I like this!

That's it for now.  I'll provide more feedback in the future as I begin to tackle more complex tasks than simple CRUD operations.
 
Thanks!
Hi all,

Given I have the Session ID and Server ID, how do I access Salesforce data?

I want to access some data from my company website. I have the following code, but it gives me a "responseDOM has no properties" error.

"<script src="https://www.salesforce.com/services/lib/ajax/beta3.3/sforceclient.js" type="text/javascript"></script>"

function initPage() {
    var session = document.getElementById("session").value;
    var server = document.getElementById("server").value;
  
    //Get Salesforce connection based on users current session id
    sforceClient.init(session, server);

    if (sforceClient.getSessionId().indexOf("!API_Session_ID") != - 1){
        alert("Could not login using API");
        return ;
    }
}

What am I missing?
  • April 28, 2006
  • Like
  • 0

Hi,

I am trying a proof of concept to show that our dotnet based webapp can access/change info in our salesforce environment.  I am working on a simple example to get everything working.

I modified the basic c# 'quickstart' code to change the name of a salesforce 'opportunity'.  I also made a simple console app as a driver to this class.  I can compile and successfully run the consoleApp&assembly on different machines.   So far so good.

My next test was to try to integrate the assembly into our proprietary dotNet based web application.  I added a method to the 'quickstart' class (the class is now renamed PartnerOpportunityRegister)  called testObject() which returns a string ("success").  I can instantiate the class and successfully call this method, so I know the assembly is being loaded/referenced correctly from within our webapp.  However, when I try to access any methods which use sforce objects, I get the following errors:

2004.10.19 15:16:15: failed in doLogin():

Unable to generate a serializer for type PartnerOpportunity.sforce.SetPasswordResult from assembly because the assembly may be dynamic. Save the assembly and load it from disk to use it with XmlSerialization.
  
at System.Xml.Serialization.Compiler.AddImport(Type type)
   at System.Xml.Serialization.TempAssembly..ctor(XmlMapping[] xmlMappings)
   at System.Xml.Serialization.XmlSerializer.FromMappings(XmlMapping[] mappings)
   at System.Web.Services.Protocols.SoapClientType..ctor(Type type)
   at System.Web.Services.Protocols.SoapHttpClientProtocol..ctor()
   at PartnerOpportunity.sforce.SforceService..ctor()
   at PartnerOpportunity.PartnerOpportunityRegister.doLogin()

What does this mean?  I am quite new to dotNet, so I may be ignorant to the obvious here.  Thanks in advance to any responses.