You need to sign in to do that
Don't have an account?
Depton
API - Web Services Vs Triggers and rules
Hi,
I am having the issue that when using Web Services (PHP) triggers and assignment rules are not executed.
2 examples:
Lead assignment:
When I created a Lead assignment rules are not working, all the fields are correctly populated but the assignment rules are not working.
The same with opportunity triggers, I have added a user exception:
If the user that modifies the record is “XXXXX” then the trigger shouldn´t work, but the trigger keeps getting fired??
Any ideas why is this happening?
Thank you!!
Asignment rules are not fired implicitly when leads are inserted via API. You need to invoke them explicitly.
Use the database.DMLOptions class to provide extra information during a transaction, for example, specifying the truncation behavior of fields or assignment rule information. DMLOptions is only available for Apex saved against API versions 15.0 and higher.
Here is how you would do:
If you want to invoke your default rule:
Hope this helps.
Sales4ce
Thank you!!!
I think i understand, just to be sure, from the PHP API there is nothing we can do, we must create a trigger for it right?
Trigger is created on the Lead object in Salesforce. So when you perform your DML operation the trigger would fire.
Was that helpful?
Sales4ce
From the SOAP API you would set the AssignmentRuleHeader to enable the assignment rules to run.
Thanks!!
So I can do it through the API!! right?
I have found this, I think it will help me to set the Assignmentruleheader
Thank you!!