• gemgem
  • NEWBIE
  • 0 Points
  • Member since 2013

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

Okay, so I have been trying fruitlessly, for awhile now, to wrap my head around the Javascript API that is provided for the Salesforce Sales app. I've opened a number of tickets, scoured StackOverflow, watched a number of videos, read some articles I've found on the main saiesforce website, all to answer a few simple questions. Perhaps I haven't taken the time to fully educate myself on the platform, fine, but given the extreme simplicity of what I'm trying to do, the labyrinthian, outdated developer pages have been a huge pain.

 

With that aside, perhaps someone here can answer the following questions for me.

 

A) What is the current version of the AJAX library? 

 

Admittedly, this is the least of my problems, and hasn't been much of an issue thus far. With that said however, I'm amazed at how difficult finding an answer to this has been. All over the Salesforce documentation, I've found references to different versions in the 

{!REQUIRESCRIPT} statement. A quick Google search brought me to this page: http://www.salesforce.com/us/developer/docs/ajax/ but, when I try to include it, I get a 404 error in the console. 

 

 

B) What on Earth is "{!...}" supposed to mean?

 

I've noticed that any Javascript I write will first be fed through a preprocessor in order to provide more convenient interfaces with the API. Fine. But am I doing with them exactly? What is the difference between the same expression the form of a string "{!Foo.id}" and not {!REQUIRESCRIPT..}? Nowhere in the documentation have I seen this addressed.

 

 

C) How can I modify fields through javascript?

 

This is along the same lines as the previous question. I take it that these "{!...}" expressions will allow me to interface with the api. Specifically, what I would like to do is modify a field value on button click. This has been difficult simply because I don't understand the method in which I can access fields. What is in the global scope? What objects can I access? How do I access them? 

 

I've tried the following:

 

    // Maybe I object is in the global scope

    console.log(Case)

 

    // Oops! Hmm, maybe I can access it with those strange {!...} expressions

    console.log({!Case})

    console.log("{!Case}")

 

    // No dice... but oddly enough "{!Case.id}" works... what the hell?

    // I have to create an "SObject" ...?

    var foo = new sforce.SObject("Case"); // not sure what the parameters are, but all examples I've seen do something similar...

    

    // Okay, now maybe I can access the desired fields from my Object

    > foo.get("MyField__c")

    null

    

     // Drat! Maybe it's expecting the label...

     >foo.get("MyField")

     null

 

Sorry if I've come off a bit rude or irritated, but after speaking with multiple people over the phone, had multiple tickets closed without my input, and hours of searching, I've lost patience.

 

Thanks

 

    

Okay, so I have been trying fruitlessly, for awhile now, to wrap my head around the Javascript API that is provided for the Salesforce Sales app. I've opened a number of tickets, scoured StackOverflow, watched a number of videos, read some articles I've found on the main saiesforce website, all to answer a few simple questions. Perhaps I haven't taken the time to fully educate myself on the platform, fine, but given the extreme simplicity of what I'm trying to do, the labyrinthian, outdated developer pages have been a huge pain.

 

With that aside, perhaps someone here can answer the following questions for me.

 

A) What is the current version of the AJAX library? 

 

Admittedly, this is the least of my problems, and hasn't been much of an issue thus far. With that said however, I'm amazed at how difficult finding an answer to this has been. All over the Salesforce documentation, I've found references to different versions in the 

{!REQUIRESCRIPT} statement. A quick Google search brought me to this page: http://www.salesforce.com/us/developer/docs/ajax/ but, when I try to include it, I get a 404 error in the console. 

 

 

B) What on Earth is "{!...}" supposed to mean?

 

I've noticed that any Javascript I write will first be fed through a preprocessor in order to provide more convenient interfaces with the API. Fine. But am I doing with them exactly? What is the difference between the same expression the form of a string "{!Foo.id}" and not {!REQUIRESCRIPT..}? Nowhere in the documentation have I seen this addressed.

 

 

C) How can I modify fields through javascript?

 

This is along the same lines as the previous question. I take it that these "{!...}" expressions will allow me to interface with the api. Specifically, what I would like to do is modify a field value on button click. This has been difficult simply because I don't understand the method in which I can access fields. What is in the global scope? What objects can I access? How do I access them? 

 

I've tried the following:

 

    // Maybe I object is in the global scope

    console.log(Case)

 

    // Oops! Hmm, maybe I can access it with those strange {!...} expressions

    console.log({!Case})

    console.log("{!Case}")

 

    // No dice... but oddly enough "{!Case.id}" works... what the hell?

    // I have to create an "SObject" ...?

    var foo = new sforce.SObject("Case"); // not sure what the parameters are, but all examples I've seen do something similar...

    

    // Okay, now maybe I can access the desired fields from my Object

    > foo.get("MyField__c")

    null

    

     // Drat! Maybe it's expecting the label...

     >foo.get("MyField")

     null

 

Sorry if I've come off a bit rude or irritated, but after speaking with multiple people over the phone, had multiple tickets closed without my input, and hours of searching, I've lost patience.

 

Thanks