JFDu / salesforce-dotnet

Automatically exported from code.google.com/p/salesforce-dotnet
0 stars 0 forks source link

Add AssignmentRuleHeader to the SF proxy binding; Lead/Account Controller(s) #9

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
During development, and in production we received some issues that the 
default owner of all new Leads or Accounts was always assigned to the API 
profile; individuals had to manually log-in into Salesforce and update or 
assign their own Leads and Accounts by territory. Tedious task for them to 
say the least.

I found and patched one solution to the issue, in the case that this is a 
requirement for some users of the .Net library.

For an overview read more here: 
http://www.salesforce.com/us/developer/docs/api/Content/sforce_api_header_a
ssignmentruleheader.htm

I have modified the LeadController create() or update() call of a Lead for  
and the update() call of an Account in the AccountController for the 
territory assignment rules to be applied.

I am merely creating an AssignmentRuleHeader, applying the default behavior 
for those calls to create() update() on the proxy binding, and then 
discarding it since it only applies to those objects and calls.

** Note that Salesforce allows for multiple Assignment Rules, but only ONE 
can be activated; e.g; the default. If you want to use a different 
Assignment Rule, you can call it by name, or look it up via the API.

Code files attached.

Original issue reported on code.google.com by mteece@gmail.com on 23 Nov 2009 at 3:48

Attachments: