Bhuvarahan / npsp

Automatically exported from code.google.com/p/npsp
0 stars 0 forks source link

One-to-one account not created when contact is created through the API #164

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
This is the second organization where I have experienced this. When a contact 
is created through 
the API, the One2OnceContact processing doesn't happen. If a contact is created 
through the 
Salesforce interface it does. We turned on debugging and looked at the 
differences between the 
two, the contacted created through the API does not execute the SOQL in this 
package:

10:31:2.473|ENTERING_MANAGED_PKG|npe01
10:31:2.480|SOQL_EXECUTE_BEGIN|[262,25]|Aggregations:0|Select Id, 
One2OneContact__c from 
Account where One2OneContact__c in :contactIds
10:31:2.482|SOQL_EXECUTE_END|[262,25]|Rows:0|Duration:2
10:31:2.484|DML_BEGIN|[314,41]|Op:Insert|Type:Account|Rows:1
10:31:2.528|DML_END|[314,41]|
10:31:2.529|CUMULATIVE_LIMIT_USAGE
10:31:2.529|CUMULATIVE_LIMIT_USAGE_END

Original issue reported on code.google.com by phillip....@gmail.com on 3 Mar 2010 at 3:44

GoogleCodeExporter commented 8 years ago
What version of the package are you using?

Original comment by gok...@gmail.com on 13 Apr 2010 at 8:51

GoogleCodeExporter commented 8 years ago
Was this resolved yet or is it still under consideration?

Original comment by freeman....@gmail.com on 16 Jul 2010 at 2:05

GoogleCodeExporter commented 8 years ago
I never reproduced this problem. Will look at it in the new code release coming 
in August, hopefully.

Original comment by gok...@gmail.com on 28 Jul 2010 at 2:48

GoogleCodeExporter commented 8 years ago
Hi Steve!

I ran into this issue as well, when the code was being run from a sites page.  
Could it be that the "with sharing" was added to a later release?

To further clarify - I ran the same code (a controller for a sites visualforce 
page that upserts a Contact) with two version of the Contacts and Orgs package:

Version 1.65.2 - worked as expected (Account was created)
Version 2.0 - did not work

Let me know if I can help,
 Drew

Original comment by drewpis...@gmail.com on 17 Feb 2011 at 8:40

GoogleCodeExporter commented 8 years ago
Hey Drew- you are correct in that 'with sharing' was added to the later 
IndividualAccounts class in the 2.x version.  

I'll need to take a closer look at why the sharing rules were implemented in 
2.x for the C&O package. It may well be unnecessary or undesirable, and I'll 
put it in the queue for consideration in the next patch/release. 

In the interim, are you able to add the apex class IndividualContacts to the 
the enabled class list for the sites user? That should allow them access to the 
matching account creation assuming they have contact/account creation perms 
enabled.  You'll only need the base class, as sharing rules are implicitly 
inherited, and I don't believe they're called out elsewhere in the account 
creation chain. 

Let me know if that works for you-

Thanks,
Kevin

Original comment by kbro...@gmail.com on 17 Feb 2011 at 8:59

GoogleCodeExporter commented 8 years ago
Thanks Kevin.

Yes, I have the npe01.IndividualAccounts and npe01.Constants classes both 
enabled, as well as create and edit permissions for Contacts and Accounts on 
the sites user page.

Cheers,
 Drew

Original comment by drewpis...@gmail.com on 17 Feb 2011 at 11:03

GoogleCodeExporter commented 8 years ago
Hey Drew-

If you'd like, email me directly (kbromer at salesforce dot com) with your org 
ID, I can take a look at the setup and see what's happening. I'm surprised that 
the workaround isn't doing the trick for you, I may well be missing something 
though.

Thx-
Kevin

Original comment by kbro...@gmail.com on 17 Feb 2011 at 11:12

GoogleCodeExporter commented 8 years ago
I still want to see if we can identify the sites issue not respecting profile 
perms, but in the interim, I've moved the IndividualContacts class to a 
'without sharing' class model for the next patch release, which hopefully will 
be this weekend. That should allow all profiles to use (and respect) the 
1x1/Bucket model for the contacts.  

Original comment by kbro...@gmail.com on 19 Feb 2011 at 7:02

GoogleCodeExporter commented 8 years ago
Thanks Kevin! I'm happy to help in any way I can.  It didn't look like there 
was a new patch release, but I may just have missed.  No worries - I'll check 
back later this week.

 Drew

Original comment by drewpis...@gmail.com on 22 Feb 2011 at 7:31

GoogleCodeExporter commented 8 years ago
Coming later today - weekend got away from me :)

Original comment by kbro...@gmail.com on 22 Feb 2011 at 7:34

GoogleCodeExporter commented 8 years ago

Original comment by kbro...@gmail.com on 22 Feb 2011 at 11:20