Object meta: Object objects: Array[4]     0: Object     id: 19222     leaguevine_url: "https://www.leaguevine.com/tournaments/19389/autumn-2013/pools/#19222"     name: "D"     resource_uri: "https://api.leaguevine.com/v1/pools/19222/"     standings: Array[4]         0: Object         1: Object         games_played: 0         losses: 0         plus_minus: 0         points_allowed: 0         points_scored: 0         team: Object         id: 21195         leaguevine_url: "https://www.leaguevine.com/teams/21195/smokum/"         name: "Smokum"         resource_uri: "https://api.leaguevine.com/v1/teams/21195/"         short_name: ""         __proto__: Object         team_id: 21195         wins: 0         __proto__: Object         2: Object         3: Object             length: 4     __proto__: Array[0]     start_time: "2013-10-21T09:00:00+02:00"     team_ids: Array[4]     time_between_rounds: 120     time_created: "2013-09-30T09:30:46.577758+00:00"     time_last_updated: "2013-09-30T09:30:46.577791+00:00"     tournament: Object     tournament_id: 19389     __proto__: Object     1: Object     2: Object     3: Object   These are the JSON Objects I get from the Leaguevine API. How can I acces the Team name "Smokum"?  Besides using the Transparancy micro library to render my JSON objects to my HTML, but I don't know how to access objects in objects with Javascript.
46847
I've looked on Wikipedia and Googled it and read the official documentation, but I still haven't got to the point where I really understand what JSON is, and why I'd use it. I have been building applications using PHP, MySQL and JavaScript / HTML for a while, and if JSON can do something to make my life easier or my code better or my user interface better, then I'd like to know about it. Can someone give me a succinct explanation?
41144
As made clear in update 3 on , this notation: var hash = {}; hash[X]  does not actually hash the object X; it actually just converts X to a string (via .toString() if it's an object, or some other built-in conversions for various primitive types) and then looks that string up, without hashing it, in &quot;hash&quot;. Object equality is also not checked - if two different objects have the same string conversion, they will just overwrite each other. Given this - are there any efficient implementations of hashmaps in JavaScript? (For example, the second Google result of  yields an implementation which is O(n) for any operation. Various other results ignore the fact that different objects with equivalent string representations overwrite each other.
23417
I am loading a JavaScript object between Lightning Components   var model = {} model.user = {} model.caller = {} model.caller.name = 'Batman'; model.other = {} // etc   And then into component attributes.  &lt;aura:attribute name="model" type="Object" /&gt; &lt;aura:attribute name="caller" type="Object" /&gt;  cmp.set("v.model", model); cmp.set("v.caller", model.caller);   Then I use then like this:  &lt;lightning:input value="{!v.caller.name }" label="Caller name" /&gt;   Then I get data back out:  model.caller = cmp.get("v.caller");      My question is:  Why do my JavaScript object sub-objects sometimes get set to Proxy when I inspect them in the console:  caller: Proxy [[Handler]]: e [[Target]]: Object [[IsRevoked]]: false   And other times I get the values I expect...  caller { name : "Bruce Wayne" }
2961
I have a JavaScript object like the following:  var p = {     "p1": "value1",     "p2": "value2",     "p3": "value3" };   Now I want to loop through all p elements (p1, p2, p3...) And get their keys and values. How can I do that?  I can modify the JavaScript object if necessary. My ultimate goal is to loop through some key value pairs and if possible I want to avoid using eval.
85197
I have a complex JSON object which is sent to the View without any issues (as shown below) but I cannot work out how Serialize this data back to a .NET object when it is passed back to the controller through an AJAX call. Details of the various parts are below.     var ObjectA = {         "Name": 1,         "Starting": new Date(1221644506800),          "Timeline": [             {                 "StartTime": new Date(1221644506800),                 "GoesFor": 200              }             ,             {                 "StartTime": new Date(1221644506800),                 "GoesFor": 100              }          ]     };   I am not sure how this object can be passed to a Controller Method, I have this method below where the Timelines object mirrors the above JS object using Properties.  public JsonResult Save(Timelines person)   The jQuery I am using is:          var encoded = $.toJSON(SessionSchedule);          $.ajax({             url: "/Timeline/Save",             type: "POST",             dataType: 'json',             data: encoded,             contentType: "application/json; charset=utf-8",             beforeSend: function() { $("#saveStatus").html("Saving").show(); },             success: function(result) {                 alert(result.Result);                 $("#saveStatus").html(result.Result).show();             }         });   I have seen this question which is similar, but not quite the same as I am not using a forms to manipulate the data.   I have also seen references to using a 'JsonFilter' to manually deserialize the JSON, but was wondering if there is a way to do it nativly though ASP.NET MVC? Or what are the best practices for passing data in this way?
113639
I need to get list of Custom Objects in a Salesforce org and find Created By User of each of them (Created By of object, not the records) .  Is it possible? I can get string list of custom objects as follows:  List&lt;String&gt; CustomObjectsList  = new List&lt;String&gt;(); List&lt;Schema.SObjectType&gt; gd = Schema.getGlobalDescribe().Values();   for(Schema.SObjectType f : gd) {     if (f.getDescribe().isCustom()){         CustomObjectsList.add(f.getDescribe().getName());     } }   Now I need to find object creator of each (not record creator).
123645
According to the documentation  in order to retrieve a list of picklist values for an object we need to pass in a Record Type Id which can be retrieved using the getObjectInfo method.   The issue is that these are both wire functions and I cannot figure out how to chain these methods.  If I try code like the following:  getObjectInfo({ objectApiName: ACCOUNT_OBJECT })             .then(result =&gt; {                 return getPicklistValues({recordTypeId: result.defaultRecordTypeId, fieldApiName: TYPE_FIELD});             })             .then(result =&gt; {                 this.picklistValues = result.data             })             .catch(error =&gt; {                 this.error = error;             });   I get an error      render threw an error in 'c:getpicklistexample' [Imperative use is not   supported. Use @wire(getObjectInfo).]   If I try something like   @track rtId;      @wire(getObjectInfo, { objectApiName: ACCOUNT_OBJECT })     handleResult({error, data}) {         if(data) {             this.rtId = data.defaultRecordTypeId;         }     }      @wire(getPicklistValues, {recordTypeId: this.rtId,fieldApiName: TYPE_FIELD})     picklistValues;   Then it throws an internal server error. Anybody have an idea as to how I could retrieve the record type Id and then call to get the pick list values like the documentation suggests?  FYI my imports are:  import { LightningElement, wire, track } from 'lwc'; import { getPicklistValues, getObjectInfo } from 'lightning/uiObjectInfoApi'; import TYPE_FIELD from '@salesforce/schema/Account.Type'; import ACCOUNT_OBJECT from '@salesforce/schema/Account';
87162
I have contact object and Registration Custom Object.  I want to list the registration object fields in contact object using relationship as follows:  SELECT id, name, (SELECT id,name FROM Registrations__r) FROM Contact;   I want to do the same thing using SOSL. is that Possible? I did something like this for Contact fields.  FIND 'searchText' IN ALL FIELDS RETURNING Contact(name,Email);   doesnot know how to use registration object fields here...
45299
I have a query like:  SELECT a.id, a.name, json_agg(b.*) as "item"   FROM a   JOIN b ON b.item_id = a.id  GROUP BY a.id, a.name;   How can I select the columns in b so I don't have b.item_id in the JSON object?  I have read about , but it returns a JSON object like:  {"f1": "Foo", "f2": "Bar"}   I would need to remap the JSON object once it is fetched to match the proper column keys. I'd like to avoid that and keep original column names.
119203
Using AMPScript to parse an XML feed. Client is switching to JSON. Is there something similar to  for JSON in AMPScript? I am confined to using the members login area and not an external API application.
97262
I have a custom object and I would like to know which all other objects have look up relations to this one? There are many objects available and I cannot go into each and identify which would have look up.   Is there a way to identify this? In this way, I also would know what objects have relations with what other objects in SF.
50717
I want to do simple thing - I want to iterate over list of two objects and use displayColumns as dynamic keys to get values from selectList object:  &lt;aura:attribute name="displayColumns" type="String[]"/&gt; &lt;aura:attribute name="selectList" type="Object[]"/&gt;   &lt;table&gt;     &lt;aura:iteration items="{!v.selectList}" var="elem"&gt;     &lt;tr&gt;         &lt;aura:iteration items="{!v.displayColumns}" var="col"&gt;             &lt;td&gt;{!elem[col]}&lt;/td&gt;         &lt;/aura:iteration&gt;     &lt;/tr&gt;     &lt;/aura:iteration&gt; &lt;/table&gt;   In pure JS I would do: elem[col.value], but in lightning compiler returns:      expecting a positive integer, found 'col' at column 6 of expression:   elem[col.value]: Source   Is there any workaround without creating proper object structure in controller?
35414
In javascript you can easily create objects and Arrays like so:  var aObject = { foo:'bla', bar:2 }; var anArray = ['foo', 'bar', 2];   Are similar things possible in PHP? I know that you can easily create an array using the array function, that hardly is more work then the javascript syntax, but is there a similar syntax for creating objects? Or should I just use associative arrays?  $anArray = array('foo', 'bar', 2); $anObjectLikeAssociativeArray = array('foo'=&gt;'bla',                                       'bar'=&gt;2);   So to summarize: Does PHP have javascript like object creation or should I just use associative arrays?
614
I need to be able to merge two (very simple) JavaScript objects at runtime.  For example I'd like to:  var obj1 = { food: 'pizza', car: 'ford' } var obj2 = { animal: 'dog' }  obj1.merge(obj2);  //obj1 now has three properties: food, car, and animal   Does anyone have a script for this or know of a built in way to do this?  I do not need recursion, and I do not need to merge functions, just methods on flat objects.
16373
How do I pass have a Javascript script request a PHP page and pass data to it? How do I then have the PHP script pass data back to the Javascript script?  client.js:  data = {tohex: 4919, sum: [1, 3, 5]}; // how would this script pass data to server.php and access the response?   server.php:  $tohex = ... ; // How would this be set to data.tohex? $sum = ...; // How would this be set to data.sum? // How would this be sent to client.js? array(base_convert($tohex, 16), array_sum($sum))
65747
I'm running a REST API which is returning the below:  "id" : "fdgsdgsdsdgsdg",    "pageevents" : [ {        "name" : "test",        "number" : "0123442",        "homepage" : "www.test.com"     } ],     "goals" : [ {        "name" : "test",        "number" : "0123442",        "homepage" : "www.test.com"     } ] } ]   Im using the below code to de-serialize it, so i can display it as a pageblocktable on a visualforce page however im getting the error :      System.JSONException: Illegal value for primitive   public List&lt;maMoments&gt; getMomentsActivity() {     Id contactId;     if (contactId == null) {         contactId = '0030O00001sqXJr';     }      String contactIdString = String.valueOf(contactId);     String jsonResponse = this.AutomationDetailsMoments(contactIdString);     system.debug(jsonResponse);     List&lt;maMoments&gt; mAutomation = (List&lt;maMoments&gt;) JSON.deserialize(jsonResponse, List&lt;maMoments&gt;.class);     system.debug(mAutomation);     for(maMoments emailStructure : mAutomation){      }      return mAutomation; }  public string AutomationDetailsMoments(String contactId) {     contactId = '0030O00001sqXJr';     Http h = new Http();     HttpRequest req = new HttpRequest();     req.setEndpoint('https://virtserver.swaggerhub.com/mickjdavies/Example/1.0.0/interestingmoments');     req.setMethod('POST');     req.setBody(contactId);      // Send the request, and return a response     HttpResponse res = h.send(req);     system.debug(res.getBody());     return res.getBody(); }  private class maMoments {     public String contactId;     public String id;     public List&lt;String&gt; goals;     public String name;     public String homepage;     public String phone; }
53955
I'm new to game development and a bit confused about how to effectively store an object's access to certain spells/abilities.  The player and mob objects are all generated from the same class. However, each object may have access to different abilities and spells. How do I keep track of a specific object's access to these?  Example: My player object might have access to Fireball and Haste, while a goblin might have access to Confusion.  I followed , and I understand how to attach a spell function to scroll use. I'm just not sure how to emulate a character memorizing a spell and using it as an ability.