function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
U JayU Jay 

List has more than 1 row for assignment to SObject on action button in a page from managed package.

Installed a managed package, which contain simply 2 pages, controllers, stylles, scripts etc.
Then created a site using the apge within the pacjkage. When i clicked an action button, Recieved the exception , “List has more than 1 row for assignment to SObject
Error is in expression '{!saveingData}' in page donation:donationform: (Donation)
An unexpected error has occurred. Your solution provider has been notified. (Donation) “
What will be the reason? Anything regarding the installation or configuration.
Any help?
Thanks in advance.
Best Answer chosen by U Jay
Ankit AroraAnkit Arora
It doesn't matter, as if controller is attached to VFP and you've given wrights to the VFP then controller will automatically be added.

All Answers

Ankit AroraAnkit Arora
It's simple, query in apex is returning more than one record and you are not fetching it in List. For example :

Account acc = [Select Id from account] ;

If this returns more than pne record then it will give the same exception. Try doing this :

List<Account> accLst = [Select Id from Account] ;

If still not able to solve, then post your apex code here.
U JayU Jay
Thanks Ankit. I can not see the code since it is in the class recieved from a managed package. How can i varify it?
Ankit AroraAnkit Arora
Ouch! Then you've to ask the package provider to check in it. May you are missing any step which will be mandatory before using that package?
U JayU Jay
Then... Can't i uninstall the package to retry? When i try to unistall, it showes it is using on the site and some other components so that block uninstallation process.Deactivated the site..Then too :(
Ankit AroraAnkit Arora
You can try that. So not remove all the instances where you are using the manage package component and uninstall it. Keep the back up of file if there is a big development done. Once you re-install it then you can re-use your code.
U JayU Jay
Thanks Ankit :)

U JayU Jay
One more dobt :)
Why all classes are not available under 'Enable Apex Class Access' part under the site's public access settings?
Ankit AroraAnkit Arora
It doesn't matter, as if controller is attached to VFP and you've given wrights to the VFP then controller will automatically be added.
This was selected as the best answer
U JayU Jay
Thanks Ankit :)