在 SugarCRM 自定义模块中创建文件类型字段
我有一个自定义模块样本管理。我想在 editviewdef.php 中创建一个文件类型字段,以便我可以在需要时上传文件并从详细视图下载它。有人能告诉我如何完成这项任务的步骤吗?
i have a custom module Sample Management. I want to create a file type field in editviewdef.php so that i can upload the file and download it from the detailed view whenever needed. Would anyone tell me the steps how to proceed for this task?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果您通过模块生成器创建模块,只需添加 'file' => 1、到 $config 变量 (config.php) 中的“templates”数组。然后,您将能够将新的上传文件字段添加到 editviewdefs.php:
不要忘记将表单和 javascript 元素添加到 editviewdefs.php 中的 templateMeta 数组:
您还需要将 uploadfile 字段添加到detailvidefs。 php:
希望这有帮助!
If you are creating the module through Module Builder, just add 'file' => 1, to the 'templates' array in $config variable (config.php). Then you'll be able to add a new upload file field to your editviewdefs.php:
Don't forget to add the form and javascript elements to the templateMeta array in editviewdefs.php:
You also need to add the uploadfile field to detailvidefs.php:
Hope this helps!
您需要做的是通过以下方式创建自定义 SugarField 类型:
我绝对可以验证 SugarCRM 6.4.1 中是否存在文件字段类型,一旦您定义了该字段的布局方式,您应该能够与 CRM 的其余部分无缝地使用它。
What you need to do is create a custom SugarField type by:
I can definitely verify that there is a file field type as of SugarCRM 6.4.1, once you define how the field is laid out, you should be able to use it seamlessly with the rest of the CRM.