SFDC Developer

CSV文件修正的原理(JS实现):

blob = new Blob(['\ufeff' + csvStr], {type: 'text/csv;charset=UTF-8'})

重点1:添加\ufeff BOM头

重点2:使用charset=UTF-8编码

Visualforce Page: $Label.Label_API_Name

Lightning Component Page {!$Label.c.Label_API_Name}

Apex Class String getLabelName = Label.Label_API_Name;

or directly System.Label.Label_API_Name

Organization-Wide Email Address   组织范围内的电子邮件地址 对应对象:

orgwideemailaddress
select id,displayname,address from orgwideemailaddress

创建partner user 在测试类中不要忘记加上PortalRole

  • Create adminUser with the role assigned to this user (This role should be other than the customer portal role).
  • Create Account and Contact while running in adminUser context i.e. enclose your Account and Contact creation code within system.runAs(adminUser). This is because, the Owner of the Account should have a role.
  • Create Community User as adminUser i.e. after creating Account and Contact, your code for Community User creation should follow which should be within system.runAs(adminUser). You can assign PortalRole for this user or can leave it blank, when this field is left blank and a Contact is assigned, the user is automatically assigned a User Role.

PortalRole

The role of the user in the Customer Portal (either Executive, Manager, User, or PersonAcount). Prior to API version 16.0, you could set this field to null and the system automatically included a portal role. In API version 16.0 and above, when you set this field to null, a portal role is not automatically created. When this field is null and a ContactId is provided, the user is assigned to the User role.

Format the 'Date' and 'Date Time' data in a CSV file

Knowledge Article Number000325035
Description

Data Loader uses the SOAP API or BULK API depending on how it's configured.

Unless formatted properly for the API to accept them, users may have trouble importing changes to the 'Date,' 'Date Time,' and 'Time' data type fields when the corresponding values in the .csv file do not adhere to a specific formatting or correspond with the org's time zone settings.

Refer to Data Types Supported by Data Loader for all of the supported formats that are unique to Data Loader.
 

Resolution

Video guide to format the Date and Date Time data in a CSV file

How to Format the 'Date' and 'Date Time' Data in a CSV File


This is the correct formatting to use to avoid errors and frustration:

'Date' field acceptable formats

  • YYYY-MM-DD

  • YYYY-MM-DD hh:mm:ss

  • YYYY-MM-DD hh:mm:ss

  • YYYY-MM-DDThh:mm:ssZ

  • YYYY-MM-DDThh:mm:ss.sssZ

 

'Date Time' field acceptable formats

  • YYYY-MM-DD hh:mm:ss

  • YYYY-MM-DDThh:mm:ssZ

  • YYYY-MM-DDThh:mm:ss.sssZ

 

'Time' field acceptable formats

  • hh:mm:ss.sssZ (For example, 07:00:00.000Z)


 

Example scenarios

Scenario: If your org's time zone is set as "China/Taiwan time zone GMT+8":

 'Date' and Data Loader time zone is GMT+0, GMT, or blank 

Your example data in your import spreadsheet can be one of the following:

 

  • 2011-01-10

  • 2011-01-10 00:00:00

  • 2011-01-10T00:00:00Z

  • 2011-01-10T00:00:00.000Z



'Date' and Data Loader time zone is GMT+8

Your example data in your import spreadsheet must be one of these:

  • 2011-01-10 08:00:00

  • 2011-01-10T08:00:00Z

  • 2011-01-10T08:00:00.000Z


Note: If you set the hh:mm:ss to 00:00:00, the Import Date data in Salesforce will display the previous day ('2011-01-09' instead of '2011-01-10').


'Date Time' and Data Loader time zone is GMT+8

Your example data in your import spreadsheet must be one of these options in order to have the 'Date Time' display exactly what you imported in spreadsheet:

  • 2011-01-10 XX:XX:XX

  • 2011-01-10TXX:XX:XXZ

  • 2011-01-10TXX:XX:XX.XXXZ

 

Additional information about these format​s

  • XX:XX:XX or XX:XX:XX.XXX stands for the variable time you key in.

  • The "T" in these strings indicates the beginning of the time element.

  • "Z" is a special GMT designation.

  • This information is only applicable for the latest version of the Data Loader

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值