zoukankan      html  css  js  c++  java
  • Building Applications with Force.com and VisualForce(Dev401)(十六):Data Management: Introduction to Upsert

    Dev401-017:Data Management: Introduction to Upsert

    Module Objectives
    1.Define upsert.
    2.Define external ID.
    3.List typical use case where upsert is useful.
    4.List typical use case where upsert with relationships is useful.
    5.Explain how external IDs are used in combination with upsert.
    6.Explain some advantages of making use of an external ID field in a Force.com application.

    Upsert
    1.Upsert is an API function that combines insert and update into a single call
    2.Upsert users an indexed custom field or external ID to determine whether to create a new object or update an existing object.
    - If thexternal ID is not matched, then a new object is created
    - If the external ID is matched once, then the existing object is updated
    - If the external ID is matched multiple times, the an error is reported
    3.Use Upsert when importing data to prevent the creation of duplicates.

    External IDs
    1.External ID is a flag that can be added to a custom field to indicate that is should be indexed and treated as an ID.
    2.Custom index on any custom field of type Text, Number or Email.
    3.Available on all objects that support ustom fields.
    4.User-defined cross-reference field.
    5.Why is ti important?
    - Increases report and API SOQL performance
    - Used with upsert to easily intergrate apps with other systems
    6.An object can have three(3) External ID fields.

    Upsert and External ID Typical Use Case
    1.Legacy Position records in and old Recruiting Application have a Legacy Position Number.
    2.Create a custom text field called Legacy_Position_Number on the Salesforce Position object. Flag the new field as an external ID.
    3.When importing Position data from Legacy system to Salesforce, use the Upsert function in combination with the Legacy_Postion_Number field instead of using the Crate or Update API calls.

    Upset with Relationships
    1.Allows use of relationships defined in legacy systems when importing data into Force.com apps.
    2.Configure upsert action to traverse object relationships defined in your Force.com app, but use external IDs from legacy system to discover Force.com record IDs.
    3.No need to know Force.com records IDs to load data!
    4.Very convenient for intergrations and migrations
    - Shifts more of the work Salesforce.

    Review
    1.What is the advantage of performing upserts rather than creates on large data sets?
    Prevent duplicates;external ID
    2.How do you make a field an External ID field?
    Checkbox
    3.Do you have to know the Salesforce IDs of records in order to use Upsert with relationships?
    No

  • 相关阅读:
    在android 5.0以上,如何判断当前应用是在前台还是后台
    Android实现手机摄像头的自动对焦
    抓包获取百度音乐API
    andriod 自定义来电界面功能
    Android 自定义相机
    解决Android拍照保存在系统相册不显示的问题
    有关Color和Drawable你所不知道的那些内容
    Android主题切换方案总结
    设置background属性使用selector的时候内置?attr报错的解决方案
    一步一步解析google camera2 demo(三)
  • 原文地址:https://www.cnblogs.com/shgq/p/3299213.html
Copyright © 2011-2022 走看看