• robert crouse
  • NEWBIE
  • 0 Points
  • Member since 2023

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 2
    Replies
Hi All,

I have a required where i need to create Account with Contact and attachment under the contact.
I also need to refer a look up value(Test_Rec_Type_Object__c) on Account with the help of external id and the same with contact as well. On contact i have a look up(Test_Object__c) which i need to refer with the external id.

Here is the snippet which i used from workbench REST API...
----------------------
/services/data/v37.0/composite/tree/Account

{
"records" :[{
    "attributes" : {"type" : "Account", "referenceId" : "ref1"},
    "name" : "Acc with Con with Att New",
    "phone" : "1234567890",
    "website" : "www.salesforce.com",
    "numberOfEmployees" : "100",
    "industry" : "Banking",
    "Test_Rec_Type_Object__c" : {
       "Text_External_Unique__c" : "12345" },

    "Contacts" : {
      "records" : [{
         "attributes" : {"type" : "Contact", "referenceId" : "ref2"},
         "lastname" : "Smith",
         "Title" : "President",
         "email" : "sample@salesforce.com",
         "Test_Object__c" : {
            "TO_External_Obj__c.Id" : "67890" },

    "Attachments" : {
      "records" : [{
         "attributes" : {"type" : "Attachment", "referenceId" : "ref3"},
         "Name": "TestPDF.pdf", 
         "body": "Attach with Rec Creation"
         }]
      }
         }]
      }
    }]
}

Here is the error i am getting... Could any one please help on this... There is some problem in referencing the external id(Highlighted bold)

Cannot deserialize instance of reference from START_OBJECT value { or request may be missing a required field at [line:8, column:27]
 

I'd like to build an algorithm that allows me to force rank opportunities... similar to how you can rank your video rentals on the Netflix website.  Example:  If I have 4 opportunities: 

 

1. MacDonald's

2. Burger King

3. Wendy's

4. Carl's Jr

 

then I manually elevate the" Wendy's" Opportunity to the top rank I'd want the other Opportunities to automatically re-rank as follows:

 

1. Wendy's

2. MacDonald's

3. Burger King

4. Carl's Jr

 

This "Force Ranking" will help me keep our team focused on the most important projects.  Having to manually re-rank opportunities is too time consuming and error-prone, especially when the list is long.  Any advice on how I can achieve this?

 

Thanks -Tom