• Admin User 1137
  • NEWBIE
  • 5 Points
  • Member since 2015

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

How to deserialize the below mentioned json format from Mule in Apex Salesforce ?

Could any one help me out with this ?

{  
    SalesDetails=    [  
        {           
            "getVO":{  
                "Delivery_Date__c":" test";
                "Salesman_Name__c":"test",
                "Deal_Number__c":"test",
                "Worksheet_Total__c":"test",
                "Selling_Dealer__C":"test",
                "Name":"UNREG",
                "ContactName__c":"test"
            },
            "getVehicle":{  
                "Stock_No__c":"test",
                "Name":"test",
                "Engine_Number__c":"test",
                "Rego_Number__c":"test",
                "Make__c":"test",
                "Model_Name__c":"test",
                "Model_Description__c":"test",
                "Colour__c":"test",
                "Vehicle_Type__c":"test"
            },
            "getAccount":{  
                "Customer_ID__c":"test",
                "First_Name__c":"test",
                "Last_Name__c":"test",
                "Salutation__c":"test",
                "Business_Email__c":"test",
                "Home_Email__c":"test",
                "Date_of_Birth__c":test",
                "License_Number__c":"test",
                "Preferred_Name__c":"test",
                "License_Expiry_Date__c":test",
                "Selling_Dealer__c":"test",
                "Contact_Type__c":"test",
                "Name":"test",
                "Business_Phone__c":"test",
                "Business_Phone_Valid__c":true,
                "Phone1__c":"test",
                "Phone1_Valid__c":true,
                "Home_Phone__c":"",
                "Home_Phone_Valid__c":false,
                "Mobile__c":"test",
                "Mobile_Phone_Valid__c":true,
                "Business_Email_Valid__c":true,
                "Home_Email_Valid__c":true,
                "Physical_Latitude__c":"test",
                "Physical_Longitude__c":"test",
                "Physical_Address__c":"test",
                "Physical_Address_Valid__c":true,
                "PhysicalDPID__c":"test",
                "Physical_Suburb__c":"test",
                "Physical_State__c":"test",
                "Physical_Post_Code__c":"test",
                "Eranet_Data_Time__c":test,
                "Id":"test",
                "Old_Customer_Id__c":"test",
                "Physical_Country__c":"test"
            },
            "getContact":{  
                "Customer_ID__c":"test",
                "Salutation":"test",
                "Preferred_Name__c":"test",
                "FirstName":"test",
                "LastName":"test",
                "Business_Email__c":"test",
                "Home_Email__c":"test",
                "Date_of_Birth__c":test,
                "License_Number__c":"test",
                "License_Expiry_Date__c":test,
                "Selling_Dealer__c":"test",
                "Business_Phone__c":"test",
                "Business_Phone_Valid__c":test,
                "Phone1__c":"test",
                "Phone1_Valid__c":true,
                "HomePhone":"",
                "Home_Phone_Valid__c":false,
                "MobilePhone":"test",
                "Mobile_Phone_Valid__c":true,
                "Business_Email_Valid__c":true,
                "Home_Email_Valid__c":true,
                "Physical_Latitude__c":"test",
                "Physical_Longitude__c":"test",
                "Physical_Address__c":"test",
                "Physical_Address_Valid__c":true,
                "PhysicalDPID__c":"test",
                "Physical_Suburb__c":"test",
                "Physical_State__c":"test",
                "Physical_Post_Code__c":"test",
                "Eranet_Data_Time__c":test,
                "AccountId":"test",
                "Id":"test",
                "Old_Customer_Id__c":"test",
                "Physical_Country__c":"test"
            }
            "getLead":{
                "Id": "",
                "Type": "test",
                "AccountId":"",
                "ContactID":"",
                "OppurtunityFlag": "Yes"
            },
            "getOpportunityFields":{
                "AccountId": "",
                "AccountName": "",
                "VehicleId": "",
                "Model__c":"",
                "Make__c": "",
                "Selling_Dealership__c": "",
                "Request_Type__c": "",
                "Enrolled_Date__c": "",
                "LeadSource": "",
                "CampaignId": "",
                "OpportunityName": "",
                "OpportunityOwner": "",
                "OpportunityStage": "Won",
                "Closeddate": "",
                "Status":"",
                "Price__c": ""
            },
            "getlstLiveCampaignMemberId":
            [
                {
                    "LiveCMID": "test",
                    "Status": "test"
                }
            ],
            "getlstPrimaryCampaignMemberId":
            [
                {
                    "PrimaryCMID": "test",
                    "Status":"Closed"
                }
            ]
        }
    ],
    TransactionId=dfd62371-766b-11e6-87eb-b82a72a03108
}
 
I am merging the Contacts and Leads using the Standard 'Merge Contacts' and 'Find Duplicates' button. After the Contacts or Leads are merged it is getting updated in the Campaign Member object automatically.
Whenever a Campaign Member is updated, i need to update a Custom object. I am stuck here, the Camapign Member updation is not working as a DML operation and so I am not able to update my custom object.
Whenever a lead/contact is merged, the relevant Campaign Member is updated and the campaign member relevant to the lead/contact that was deleted while merging is also deleted. So now i need to delete the custom object record relevant to the deleted campaign member (while merging) and update the custom object record relevant to updated campaign member (while merging). Can anyone help me out with this. ?
I need to update a custom object with the Campaign Member records whenever a campaign member is inserted or updated. A Campaign Member can be either a Lead type or  Contact type. After a Campaign Member which is of  type Lead is inserted to the Custom Object, if that corresponding Lead is getting converted, then the Campaign Member type changes to Contact, but my Custom Object is not getting updated. Im stuck here.
Can anyone guide me through this issue ?

During the sites self-registration process, I have only come across the ability to create a portal user that creates both a contact and a user synchronously.  I would like to be able to create a portal user using an existing contact.  I tried setting the contact id on the user object before I called createPortalUser, but it still created a new contact.  We are trying to eliminate the possibility of duplicate contacts.

  • April 07, 2011
  • Like
  • 0