You need to sign in to do that
Don't have an account?
SherryA
API Support
I have inherited code that calls the API to create a task on a lead. This code has been working in production and has not changed. But, on occasion, it seems to give me an integrity constraint in error that looks something like...
field integrity exception: WhoId, WhatId (cannot specify whatID with lead whoID)
I am creating a task on a lead (referenced in the whoId), and the whatId is not populated (its null).
The confusion I'm having is when I call SFDC Tech Support, they seem to have no idea what I'm talking about when I say I'm calling the API. Any ideas why that is? Or...even better...has anyone seen this kind of sporadic behavior?
Thanks for any thoughts.
in regards to support...you only get development support with a larger account or premier support service.. to give you an example, i manage a 40 seat enterprise account, and our options are to upgrade to unlimited and add 10 more seats to get it, or buy premier support, which is a significant chunk of money (and close to what unlimited would cost now).
<Description>SFDCEventHandler Processing Failure. SFDC Task will not be created. Exception of type 'System.Exception' was thrown. field integrity exception: WhoId, WhatId (cannot specify whatID with lead whoID)</Description>
<Message>
<Task ExternalId="xxx" InternalId="" xmlns="xxx/">
<OwnerId>00550000000rViA</OwnerId>
<WhoId>00Q7000000M1TTp</WhoId>
<WhatId />
<Status>Ordered</Status>
<Description>Order processed through the tool.</Description>
<Subject>Fulfillment Order</Subject>
<DueDate>2008-05-01</DueDate>
<Items xmlns="">
<Item>
<Items_Included_ID__c>KIT-xxx</Items_Included_ID__c>
<Items_Included__c>INTRO BROCHURE KIT</Items_Included__c>
</Item>
<Item>
<Items_Included_ID__c>SPOT CUSTOM LETTER</Items_Included_ID__c>
<Items_Included__c>CUSTOMIZED LETTER FROM THE SPOT</Items_Included__c>
</Item>
<Item>
<Items_Included_ID__c>BC-xxx-01</Items_Included_ID__c>
<Items_Included__c>
</Items_Included__c>
</Item>
<Item>
<Items_Included_ID__c>--ExxxPLACEHOLDER--</Items_Included_ID__c>
<Items_Included__c />
</Item>
</Items>
</Task>
</Message>
</ns0:Alert>
</ns0:Notification>
Message Edited by SherryA on 05-01-2008 11:07 AM
Message Edited by SherryA on 05-01-2008 02:44 PM
Hi,
I have the documentation on this and can see where this is coming from but I need to be able to hook up a custom object - where would I do that with a lead object?
With the Contact - Task - custom object via the WhatID made sense but how do I associate the custom object ID with a Lead? I cannot see any other ways as I am a newbie to salesforce using the APEX WSDL apis.
Is there a way or am I stuffed? I have looked around at the other obejcts to see if I can do anything else simliar with Campaign object or Tags but don't know enough to be sure I am working within the 'normal' framework if you see what I mean. :)
Any ideas?
Thanks!
emitrom,
I don't understand your question. Are you just trying to associate a Task with a Lead and a custom object? You can't do that.
hi werewolf,
Yes that is exactly my problem. I can make the following connections of
Contact - Task - Custom Object
but cannot do
Lead - Task X Custom Object
So for now that only way I can link the Task and lead to the Custom Object is to include the URL in the description field. Which obviously is a bit clunky and I was hoping there was a better way?
Either way at least the user can select the object now but obviously I have the problem of configuring the correct URL for the account i.e. https://na6 or whichever.
Ideas?
Despite SF documentation to the contrary, I found that I am able to link a Task to both a WhoId (a Lead) and a WhatId (in my case, an Account - but I expect it would work for custom objects as well), but it only works on update, not on insert. (Insert generates the error that SherryA mentioned in her original post.)
I want my WhatId populated on insert as well as update, so as a workaround I'm trying out having a trigger perform an update operation (without making any changes) to any Lead Tasks that are being inserted. That update operation then triggers a call to the code that populates the WhatId. Seems to be working so far . . .