3

I am trying to create an Event in Salesforce via SOAP API. Setting System/Audit fields via API is enabled.

I see that the resulting SOAP Envelope includes correct values for CreatedById, CreatedDate, LastModifiedById, LastModifiedDate fields. But when I am querying values after create I see that LastModifiedById, LastModifiedDate fields have been updated to something else (current time and user being used to do API call), while CreatedById and CreatedDate have correct values (ones that I've sent with SOAP request).

Does anybody know what might be the issue here?

P.s. this is a 'Professional Edition' of Salesforce

  • What are the values after you wait out couple minutes? Still "now" or maybe something older? Can there be any workflow or a batch job (possible if you have some Apex installed via managed packages) that has updated them since? I've never worked with having them editable - is it possible to set field history tracking on them in such case? – eyescream Jun 6 '13 at 19:23
  • No, values don't change after waiting. I.e. as far as I understand they receive their value on create. I only have API access, so I am not sure about workflow or batch job. – antonlitvinenko Jun 6 '13 at 19:38
  • 1
    I suspect that there's a workflow or trigger at play. Would be best to confirm with their System Administrator (maybe they'll agree to make an exception rule "if User = integration user, don't run this logic, we trust that the data is correct"... They could also disable it temporarily for the time of data migration (unless it's going to be an ongoing integration job?). Or you know, forget about it; "not a problem". Some other user will eventually update the Event and LastModified* values will change again. – eyescream Jun 6 '13 at 19:52
  • They have a 'Professional Edition' and apparently you cannot use any fancy stuff like triggers or workflows on that. Unfortunately, for them correct value in LastModified is a big deal :( – antonlitvinenko Jun 6 '13 at 19:54
  • Well, salesforce.com/us/developer/docs/api/Content/system_fields.htm says you should be able to set values on anything except SystemModstamp. I was going to suggest trying to update the records but looks like they're writeable only on insert (boards.developerforce.com/t5/General-Development/…)... They might have installed some plugins from appexchange.com that actually will have workflows and whatnot even on Prof. Edition. Other than that - consider telling your end users to raise a case with SF support :/ – eyescream Jun 6 '13 at 20:11
2

Here is the cause.

https://help.salesforce.com/apex/HTViewSolution?id=000005055&language=en_US

Once you disable Shared Activities (the ability to have multiple contacts on activities), it works.

1

You can setup a debug log for the integration user. This should give you insight on any DML operation that is happening as part of some indirect process.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.