• PeterN
  • NEWBIE
  • 54 Points
  • Member since 2015

  • Chatter
    Feed
  • 1
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 3
    Replies
Hi,
I am new to SF REST API. I am trying to create an angular app and retrieve data from salesforce rest api with SF OAuth authentication. I get the bearer access token after authentication and have set it in the header for the api request. However, everytime I made a $http.get from angular, I get no data. The dev tool console shows this error:
XMLHttpRequest cannot load https://na34.salesforce.com/services/data. Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8080' is therefore not allowed access.

However, when I look at the network tab in chrome dev tool, I see the status was 200 OK. I tested the request from fiddler and postman and I am able to get the data without problem. I also added my localhost:8080 to whitelist in CORS from the SF. Any idea what I am missing? Thanks!

I had a couple of questions around the ordering of object content when they are inserted into Salesforce. Specifically, my ask would be a thorough explanation of how content is ordered and retrieved. 

After searching around for awhile it sounds like Salesforce gives no guarantees on ordering of results (specifically noted in the documentation online) as well as other sources online. I'm hoping to pose my questions in respect to their online counterparts below.

a) Here (https://developer.salesforce.com/forums/?id=906F000000092srIAA) for example indicates that ordering by CreatedDate after the insertion of two accounts one after the other will give inaccurate results but that is to be expected. More specifically sfdcfox's later on indicates that you can order by Id instead and that they are always in ascending order.
b) Here (http://salesforce.stackexchange.com/questions/7667/soql-result-ordering-in-the-absence-of-an-order-by-clause)indicates that if the Order By clause is missing then a variety of factors that may affect it which further is corroborated with my third source
c) The Salesforce Developer's guide also indicates (https://developer.salesforce.com/docs/atlas.en-us.soql_sosl.meta/soql_sosl/sforce_api_calls_soql_select.htm)that there is no guarantee for order unless you use the Order By clause.

So my questions then follow:
1) If there is no gurantee for order then how can we guarantee that Id is ALWAYS created in ascending order. Who or what is more accurate in this case? And is this a reliable way to order?
2) The Salesforce Developer's guide (a) is ambiguous just stating that there is no guarantee and likewise the second point (b) indicates that there are a variety of factors that influence this. Does anyone know specifically what the cases and conditions would be?
3) What is the most basic case as well as the 80% satisfiable cases for a default behaviour? If I run multiple inserts on a default object will it be inserted in that order or garble it. And when I retrieve that data via SELECT Id, Name FROM [OBJECT] will it give it back in the order that it had previously inserted with (garbled or in order).

  • September 15, 2015
  • Like
  • 1

I had a couple of questions around the ordering of object content when they are inserted into Salesforce. Specifically, my ask would be a thorough explanation of how content is ordered and retrieved. 

After searching around for awhile it sounds like Salesforce gives no guarantees on ordering of results (specifically noted in the documentation online) as well as other sources online. I'm hoping to pose my questions in respect to their online counterparts below.

a) Here (https://developer.salesforce.com/forums/?id=906F000000092srIAA) for example indicates that ordering by CreatedDate after the insertion of two accounts one after the other will give inaccurate results but that is to be expected. More specifically sfdcfox's later on indicates that you can order by Id instead and that they are always in ascending order.
b) Here (http://salesforce.stackexchange.com/questions/7667/soql-result-ordering-in-the-absence-of-an-order-by-clause)indicates that if the Order By clause is missing then a variety of factors that may affect it which further is corroborated with my third source
c) The Salesforce Developer's guide also indicates (https://developer.salesforce.com/docs/atlas.en-us.soql_sosl.meta/soql_sosl/sforce_api_calls_soql_select.htm)that there is no guarantee for order unless you use the Order By clause.

So my questions then follow:
1) If there is no gurantee for order then how can we guarantee that Id is ALWAYS created in ascending order. Who or what is more accurate in this case? And is this a reliable way to order?
2) The Salesforce Developer's guide (a) is ambiguous just stating that there is no guarantee and likewise the second point (b) indicates that there are a variety of factors that influence this. Does anyone know specifically what the cases and conditions would be?
3) What is the most basic case as well as the 80% satisfiable cases for a default behaviour? If I run multiple inserts on a default object will it be inserted in that order or garble it. And when I retrieve that data via SELECT Id, Name FROM [OBJECT] will it give it back in the order that it had previously inserted with (garbled or in order).

  • September 15, 2015
  • Like
  • 1
Hi,
I am new to SF REST API. I am trying to create an angular app and retrieve data from salesforce rest api with SF OAuth authentication. I get the bearer access token after authentication and have set it in the header for the api request. However, everytime I made a $http.get from angular, I get no data. The dev tool console shows this error:
XMLHttpRequest cannot load https://na34.salesforce.com/services/data. Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8080' is therefore not allowed access.

However, when I look at the network tab in chrome dev tool, I see the status was 200 OK. I tested the request from fiddler and postman and I am able to get the data without problem. I also added my localhost:8080 to whitelist in CORS from the SF. Any idea what I am missing? Thanks!
Hi,
Can you please help me out by answering these questions.
A company wants a recruiting app that models candidates and interviews; displays the total number of interviews on each candidate record; and defines security on interview records that is independent from the security on candidate records.What would a developer do to accomplish this task? 
Choose 2 answers.
A) Create a lookup relationship between the Candidate and Interview objects.
B) Create a trigger on the Interview object that updates a field on the Candidate object
C) Create a roll-up summary field on the Candidate object that counts Interview records.
D) Create a master-detail relationship between the Candidate and Interview objects.
 
Hoping the Ans as :A,B

2) In the Lightning Component framework, which resource can be used to fire events?ans: A,B
Choose 2 answers
Third-party Javascript code.
Javascript controller actions.
Visualforce controller actions.
Third-party web service code.

Hoping as Ans: A,B

3) What is a capability of formula fields? 
 
   Choose 3 answer 
 
A) Generate a link using the HIPERLINK function to a specific record in a legacy system
B) Determine if a datetime field has passed using the NOW function
C) Determine which of three different images to display using IF function
D) Return and display a field value from another object using the VLOOKUP function
E) Display the previous value for a field using the PRIORVALUE funtion

I think Ans: B,C,D

4)A developer wants to display all the available record types for a case Object. The developer also wants to display the picklist values for the Case.Status field. The Case Object and the Case.Status field are on a Custom Visualforce page.
Which action can the developer perform to get the record types and picklist values in the controller?
Choose 2 answers. 
Use Schema.PicklistEntry returned by Case.Status.getDescribe().getPicklistValues()
Use Schema.RecordTypeInfo returned by Case.sObjectType.getDescribe().getRecordTypeInfos()
Use SOQL to query Case records in the org to get all values for the Status picklist field
Use SOQL to query Case records in the org to get all the RecordType values available for Case 

I think Ans:A,B

5) A developer writes a SOQL query to find child records for a specific parent. Ans:5



 



How many levels can be returned in a single query?

A. 1
B. 7
C. 5
D. 3
 
Confused between option A and C.Please clarify these questions.

Thanks in advance for your help.