Deprecated: Optional parameter $list declared before required parameter $is_script is implicitly treated as a required parameter in /home1/oijoiv2f/public_html/wp-content/plugins/apus-framework/libs/redux/ReduxCore/inc/class.redux_cdn.php on line 21

Deprecated: Optional parameter $register declared before required parameter $footer_or_media is implicitly treated as a required parameter in /home1/oijoiv2f/public_html/wp-content/plugins/apus-framework/libs/redux/ReduxCore/inc/class.redux_cdn.php on line 45

Deprecated: Optional parameter $register declared before required parameter $footer_or_media is implicitly treated as a required parameter in /home1/oijoiv2f/public_html/wp-content/plugins/apus-framework/libs/redux/ReduxCore/inc/class.redux_cdn.php on line 104

Deprecated: Optional parameter $expire declared before required parameter $path is implicitly treated as a required parameter in /home1/oijoiv2f/public_html/wp-content/plugins/apus-framework/libs/redux/ReduxCore/inc/class.redux_functions.php on line 54

Deprecated: Optional parameter $depth declared before required parameter $output is implicitly treated as a required parameter in /home1/oijoiv2f/public_html/wp-content/themes/entaro/inc/classes/megamenu.php on line 155

Deprecated: Optional parameter $depth declared before required parameter $output is implicitly treated as a required parameter in /home1/oijoiv2f/public_html/wp-content/themes/entaro/inc/classes/mobilemenu.php on line 147

Deprecated: Optional parameter $args declared before required parameter $wp_customize is implicitly treated as a required parameter in /home1/oijoiv2f/public_html/wp-content/plugins/apus-framework/libs/redux/ReduxCore/inc/extensions/customizer/extension_customizer.php on line 583

Deprecated: Optional parameter $args declared before required parameter $wp_customize is implicitly treated as a required parameter in /home1/oijoiv2f/public_html/wp-content/plugins/apus-framework/libs/redux/ReduxCore/inc/extensions/customizer/extension_customizer.php on line 606

Warning: Cannot modify header information - headers already sent by (output started at /home1/oijoiv2f/public_html/wp-content/plugins/apus-framework/libs/redux/ReduxCore/inc/class.redux_cdn.php:21) in /home1/oijoiv2f/public_html/wp-includes/rest-api/class-wp-rest-server.php on line 1831

Warning: Cannot modify header information - headers already sent by (output started at /home1/oijoiv2f/public_html/wp-content/plugins/apus-framework/libs/redux/ReduxCore/inc/class.redux_cdn.php:21) in /home1/oijoiv2f/public_html/wp-includes/rest-api/class-wp-rest-server.php on line 1831

Warning: Cannot modify header information - headers already sent by (output started at /home1/oijoiv2f/public_html/wp-content/plugins/apus-framework/libs/redux/ReduxCore/inc/class.redux_cdn.php:21) in /home1/oijoiv2f/public_html/wp-includes/rest-api/class-wp-rest-server.php on line 1831

Warning: Cannot modify header information - headers already sent by (output started at /home1/oijoiv2f/public_html/wp-content/plugins/apus-framework/libs/redux/ReduxCore/inc/class.redux_cdn.php:21) in /home1/oijoiv2f/public_html/wp-includes/rest-api/class-wp-rest-server.php on line 1831

Warning: Cannot modify header information - headers already sent by (output started at /home1/oijoiv2f/public_html/wp-content/plugins/apus-framework/libs/redux/ReduxCore/inc/class.redux_cdn.php:21) in /home1/oijoiv2f/public_html/wp-includes/rest-api/class-wp-rest-server.php on line 1831

Warning: Cannot modify header information - headers already sent by (output started at /home1/oijoiv2f/public_html/wp-content/plugins/apus-framework/libs/redux/ReduxCore/inc/class.redux_cdn.php:21) in /home1/oijoiv2f/public_html/wp-includes/rest-api/class-wp-rest-server.php on line 1831

Warning: Cannot modify header information - headers already sent by (output started at /home1/oijoiv2f/public_html/wp-content/plugins/apus-framework/libs/redux/ReduxCore/inc/class.redux_cdn.php:21) in /home1/oijoiv2f/public_html/wp-includes/rest-api/class-wp-rest-server.php on line 1831

Warning: Cannot modify header information - headers already sent by (output started at /home1/oijoiv2f/public_html/wp-content/plugins/apus-framework/libs/redux/ReduxCore/inc/class.redux_cdn.php:21) in /home1/oijoiv2f/public_html/wp-includes/rest-api/class-wp-rest-server.php on line 1831
{"id":850,"date":"2017-07-27T06:01:03","date_gmt":"2017-07-27T06:01:03","guid":{"rendered":"http:\/\/www.salesforcenextgen.com\/?p=850"},"modified":"2020-12-28T19:45:26","modified_gmt":"2020-12-28T19:45:26","slug":"dmloperation","status":"publish","type":"post","link":"https:\/\/salesforcenextgen.com\/dmloperation\/","title":{"rendered":"DML Operation"},"content":{"rendered":"

DML Operation contd<\/strong><\/p>\n

Upserting records<\/strong><\/p>\n

This command incorporates two DML operation i.e. insert and update in one statement. It has to be provided with a unique identifier such as Record Id, so that it can search the database and find the requested record, if there is no record matching the record Id then a new record is created, if a match found then the record is updated. But if the record Id or key passed have multiple matches, then it neither updates nor creates a record and throw an error<\/p>\n

\"Upsert<\/p>\n

Upsert operation is supported in Dataloader, Apex, and API. It is feasible to create parent child relationship in one statement.<\/p>\n

Below is the schematic representation of an Upsert Statement.<\/p>\n

\"Upsert<\/p>\n

Benefits of using Upsert:<\/p>\n

It simplifies the process of insertion and updating the records, information about Salesforce Id is not mandatory we can use external Id for this purpose. We do not have to manually export and match the records.\u00a0 It helps in preventing the duplication of records.<\/p>\n

Best Practice for Upsert:<\/p>\n

Make external Id, Unique and case insensitive. Make use of compound fields to make a unique identifiers.<\/p>\n

Use Case for Upsert:<\/p>\n

Export data from production to sandbox.<\/p>\n

    \n
  1. Create a new field and make it as external Id, follow the best practice to make this field<\/li>\n
  2. Deploy new field in the sandbox<\/li>\n
  3. Start export of data from production and import to sandbox using the various tools available like dataloader or data import wizard<\/li>\n
  4. Use the newly created field for matching the data in sandbox.<\/li>\n<\/ol>\n

    Upsert command and external id are very handy when we are integrating data from external datasource, with the help of external id we can reference our record. Most of the data uploading tool like dataloader, dataimport wizard or 3rd<\/sup> party connectore like boomi has options to specify the external Id.<\/p>\n

    Merge Records<\/strong><\/p>\n

    If there are duplicates in your org then Merge operation comes into picture to help you clean up the data.<\/p>\n

    Merge operation can take up to three records , update the selected record and delete the other two records, in case the delete records have related objects then these objects get reparented.<\/p>\n

    Merge is mainly available on Contacts, lead and account object<\/p>\n

    Steps to merge these standard objects are mentioned below:<\/p>\n

      \n
    1. Merge Duplicate Contacts<\/a><\/li>\n
    2. Merge Duplicate Accounts<\/a><\/li>\n
    3. Merge Duplicate Leads<\/a><\/li>\n<\/ol>\n

      Next:\u00a0SOQL (Salesforce Object Query Language)<\/a><\/span><\/p>\n","protected":false},"excerpt":{"rendered":"

      DML Operation contd Upserting records This command incorporates two DML operation i.e. insert and update in one statement. It has to be provided with a unique identifier such as Record Id, so that it can search the database and find the requested record, if there is no record matching the record Id then a new …
      Continue reading DML Operation<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[72],"tags":[40,61,74,45,75,38,42,55,51,52],"_links":{"self":[{"href":"https:\/\/salesforcenextgen.com\/wp-json\/wp\/v2\/posts\/850"}],"collection":[{"href":"https:\/\/salesforcenextgen.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/salesforcenextgen.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/salesforcenextgen.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/salesforcenextgen.com\/wp-json\/wp\/v2\/comments?post=850"}],"version-history":[{"count":3,"href":"https:\/\/salesforcenextgen.com\/wp-json\/wp\/v2\/posts\/850\/revisions"}],"predecessor-version":[{"id":2214,"href":"https:\/\/salesforcenextgen.com\/wp-json\/wp\/v2\/posts\/850\/revisions\/2214"}],"wp:attachment":[{"href":"https:\/\/salesforcenextgen.com\/wp-json\/wp\/v2\/media?parent=850"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/salesforcenextgen.com\/wp-json\/wp\/v2\/categories?post=850"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/salesforcenextgen.com\/wp-json\/wp\/v2\/tags?post=850"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}