简体   繁体   English

如何使用Beatbox或simple-salesforce在Salesforce中创建自定义表格?

[英]How to create a custom table in Salesforce using Beatbox or simple-salesforce?

We are currently evaluating Python bindings for Salesforce - in particular Beatbox and simple-salesforce. 我们目前正在评估Salesforce的Python绑定-尤其是Beatbox和simple-salesforce。 In both modules via are missing functionality to create new custom tables, drop a custom table and dropping all items of a custom tables (without using individual deletes). 在这两个模块中,via均缺少创建新定制表,删除定制表和删除定制表的所有项的功能(不使用单个删除)。

Of course we can create and model our own custom tables in Salesforce through the web but for the sake of automation and testability we would prefer to create our tables automatically using Python...any pointer on this issue and the mass deletion issue? 当然,我们可以通过Web在Salesforce中创建和建模自己的自定义表,但是出于自动化和可测试性的考虑,我们宁愿使用Python自动创建表...在此问题和批量删除问题上有任何指针吗?

Unfortunately, Beatbox and Simple-Salesforce are not designed for the creation or deletion of custom objects (tables). 不幸的是,Beatbox和Simple-Salesforce并非设计用于创建或删除自定义对象(表)。

Beatbox (SOAP API) and Simple-Salesforce(REST API) were created to work with the Salesforce SOAP and REST APIs to access Salesforce data. Beatbox(SOAP API)和Simple-Salesforce(REST API)的创建是为了与Salesforce SOAP和REST API配合使用以访问Salesforce数据。 This allows you to create, update, or delete records of existing objects and query records of those objects (tables). 这使您可以创建,更新或删除现有对象的记录,并查询那些对象(表)的记录。

If you want to create new custom objects programmatically, that is do able through the Metadata API ( https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/ ). 如果要以编程方式创建新的自定义对象,则可以通过Metadata API( https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/ )来创建。 However, I have no yet found a tool as user friendly as Simple-Salesforce for creating Metadata deployments. 但是,我还没有找到像Simple-Salesforce这样的用户友好工具来创建元数据部署。 The metadata, in general, is less friendly because you have to push the whole metadata package as a zip file. 通常,元数据不太友好,因为您必须将整个元数据包作为zip文件推送。 It is more cumbersome than simple querying or record creation. 它比简单的查询或记录创建更麻烦。

I don't have a good solution for the mass delete. 对于批量删除,我没有很好的解决方案。 Is the issue that doing them individually is slow or uses up too many API calls in your instance? 单独执行它们的问题是否很慢,或者实例中使用了太多的API调用? One possible solution is to have a an Apex Class or classes that that does all of the deletes. 一种可能的解决方案是拥有一个或所有执行所有删除操作的Apex类。 Then create a custom object that has a number of checkboxes. 然后创建一个具有多个复选框的自定义对象。 Set up a trigger to call the Apex Delete Classes when a record of the that object is updated and the checkboxes are populated true. 设置触发器,以在更新该对象的记录并填充复选框为true时调用Apex删除类。 Then you can call an object update from Python that will trigger mass deletes. 然后,您可以从Python调用对象更新,这将触发批量删除。 It is hacky, but it works. 它很hacky,但是可以用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM