本文介绍了使用Salesforce的Web服务创建和设置任务的类型的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是通过Java使用Salesforce的API SOAP API成功创建任务。

I am successfully creating a Task using the SalesForce API SOAP API through Java.

不过,我的问题是,我似乎无法设置它的类型。他们都默认为呼叫,但我真的希望他们能电子邮件。

However, my problem is that I can't seem to set the Type of it. They all default to "Call" but I really want them to be "Email".

有人能指出我在那里我可以做到这一点的方向?我的认为的它与RecordTypeMapping做的,但我对如何使用这在我的Java code查找特定的一个任务类型有些困惑。

Can someone point me in the direction of where I can do this? I think it is to do with RecordTypeMapping, but i am somewhat confused as to how to use this in my Java code to look up the particular one for Task type.

我觉得我有这么密切的与此有关。我有一个是给我的Task.java类的额外的方法正确的WSDL,但无论怎样我传递,它死。

I feel I have got so close with this. I have the correct WSDL that is giving me the extra method on the Task.java class, but no matter what I pass in, it dies.

这似乎并没有成为一个巨大的要求,但我很困惑,这点来加盟得到它的工作。

This doesn't seem to be a huge ask, yet i am perplexed as to which dots to join to get it to work

任何帮助将是AP preciated。谢谢

Any help would be appreciated. thanks

推荐答案

本场可通过像任何其他API。你的问题不有什么用RecordTypes或者(当您将通过API的记录,你可以把你想要的任何字符串作为列表值)。

This field is available through API like any other. Your problem doesn't have anything to do with the RecordTypes either (when you insert a record via API, you can put any String you want as the picklist value).

让我们先从清单,如果这没有帮助,我们会考虑更多的选择:)

So let's start with the checklist and if this doesn't help we'll think about more options :)


  1. 是新任务页面上可见的领域呢?

  2. 什么的<一个href=\"https://na5.salesforce.com/p/setup/field/StandardFieldAttributes/d?id=Type&type=Task&setupid=TaskFields\"相对=nofollow>查看现场辅助功能按钮说? (把自己的组织ID中的链接,我用我的NA5)

  3. 你知道其凭据用来连接通过API(例如,系统管理员)的用户的个人资料?您可以在验证<一个href=\"https://na5.salesforce.com/p/setup/field/StandardFieldAttributes/e?id=Type&type=Task&setupid=TaskFields\"相对=nofollow>设置字段级安全性」这个配置文件可以看到这个领域(第1复选框),它不是为只读(第二复选框)
  4. 您可以尝试建立呼叫为默认值这个领域,看看会发生什么?

  5. 你能试图通过Salesforce.com数据加载器插入一个新的任务?它是否会奏效,这将意味着在该API它自己是OK(数据加载器也使用API​​)以及问题出在你的应用程序的某个地方。

  6. 如果你确实需要访问所谓的元数据来知道什么是领料单的可能值,可以使用描述()调用。 应该让你开始,但正如我之前说的 - 据我记得列表值当您使用的API并没有真正执行。

  7. 愚蠢的,但是......请咨询您的系统管理员,如果他没有把那修改此字段的值的工作流程。并要求开发商顶点,如果有任何插入之前触发任务对象...

  1. Is the field visible on the "New Task" page?
  2. What does the "View field accessibility" button say? (put your own org ID in the link, I've used my "na5")
  3. Do you know the Profile of the user whose credentials you use to connect via API (for example "System Administrator")? Can you verify in the "Set Field-Level security" that this Profile can see this field (1st checkbox) and it's not marked as readonly (2nd checkbox)?
  4. Can you try to set up the "Call" as default value for this field and see what happens?
  5. Can you try to insert a new Task through the Salesforce.com Data Loader? If it will work, it will mean that API on it's own is OK (Data Loader also uses the API) and the problem lies somewhere in your app.
  6. If you really need to access the so-called metadata to know what are the possible values of a picklist, you can use the describe() calls. This should get you started but as I said before - as far as I remember the picklist values aren't really enforced when you use API.
  7. Stupid, but... consult your System Administrator if he didn't put any workflows that modify the value of this field. And ask the Apex developers if there are any "before insert" triggers on the Task object...

编辑:所有谁与Salesforce集成(尤其是我已经创建了一个新的自定义字段问题的用户,看来我可以查询,但我没有看到它在返回的结果),有几个步骤:

for all the users who have problems with Salesforce integration (especially "I've created a new custom field, it seems I can query for it but I don't see it in the returned results") there are couple more steps:

如果您正在使用企业WSDL - 记住下载新副本。 Java和C#等人需要(再次消费吧)从WSDL再生他们班才能看到新的领域。 PHP用户不应该担心(我已经检查一切最后一次是在运行时做过PHP工具包......当然,如果你已经实际产生出来的东西的WSDL - 做一遍)。但在PHP的情况下,它似乎可以WSDL在您的应用程序以某种方式缓存。重新启动服务器,以确保新鲜WSDL用于?

If you're using enterprise WSDL - remember to download fresh copy. Java, C# etc. people need to regenerate their classes from the wsdl ("consume" it again) in order to see new fields. PHP users shouldn't worry (last time I've checked everything is done in runtime in "PHP toolkit"... of course if you've actually generated something out of the WSDL - do it again). But in case of PHP it seems WSDL can be somehow cached in your app. Restart the server to make sure fresh wsdl is used?

我花了比预期更长(Apache Axis的2产生完全不同的code到我与轴1.x中使用过的)+我遇到了一些其他的杂念,但我已经检查了。

Took me longer than expected (Apache Axis 2 generates totally different code to the one I'm used too with Axis 1.x) + I've encountered some other distractions, but I've checked it.

总之:它是一个可正常场通过API和对我的作品

In short: it's a normal field available through API and works for me.

请确保您的企业WSDL包含类似

Please make sure that your enterprise WSDL contains lines similar to

<complexType name="Task">
    <complexContent>
        <extension base="ens:sObject">
            <sequence>
                <element name="Account" nillable="true" minOccurs="0" type="ens:Account"/>
                (...)
                <element name="Type" nillable="true" minOccurs="0" type="xsd:string"/>
                (...)
            </sequence>
        </extension>
    </complexContent>
</complexType>

如果它不 - 从中​​重新生成Java类。如果它不 - 下载一个新的WSDL

If it does - regenerate your Java classes from it. If it doesn't - download a new WSDL.

与Apache Axis2和enterprise.wsdl我能够创造这样的样品code:

With Apache Axis2 and enterprise.wsdl I was able to create such sample code:

Task task = Task.Factory.newInstance();
task.setType("Alan's Email");   // Not a valid picklist value, just to prove that these don't matter when we use API.
task.setWhatId("0067000000AH3ME"); // An Opportunity Id ("Burlington Textiles" in my test org) to which this task will be related.
task.setStatus("Not Started");
task.setPriority("Normal");
task.setDescription("A new Task has been created with methods from Enterprise WSDL.");

您也可以下载整个测试项目(相当大) 。有很高的机会,如果你已经习惯了轴1.x的风格(大部分Salesforce的API例子是使用旧轴写入时),code看起来怪异,但我向你保证,它为我工作。

You can download the whole test project (rather big) here. There's high chance the code looks weird if you're used to Axis 1.x style (most of the Salesforce API examples are written using old Axis), but I assure you it worked for me.

如果你还需要帮助? - 我想我们将有直接联系。

If you still need help - I guess we'll have to contact directly?

祝你好运。

这篇关于使用Salesforce的Web服务创建和设置任务的类型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-15 06:54