I am getting this error System.LimitException: Too many SOQL queries: 101 when I run the class bellow. It seems like it is affecting all the triggers linked to NRProducts__c Object(This object has 45,000 records but the SOQL query should only return 7,000 ). I have a SetInterval JQuery function in the VF Page that clicks the a button every 20 seconds. My question is if I am making any mistake in the Classs code, or any ideas why this is happening. Thank you!  this is the whole error message:    System.LimitException: Too many SOQL queries: 101    Error is in expression '{!CreatePlan}' in component &lt;apex:commandButton&gt; in page   inventoryamzipa    Trigger.InventoryAdjCountsONProducts: line 4, column 1   This is the class:      public class InventoryAMZAPIController2{     public String Debug{ get; set; }      public InventoryAMZAPI2.CreateInboundShipmentPlanResult NewPlan{ get; set; }     public List&lt;InboundShipmentPlanRequestItem&gt; RemainingItems{ get; set; }       public void CreatePlan(){       Date target_date = date.today();       List&lt;NRProducts__c&gt; details = [SELECT NRName__c, AMZ_Inventory_Update__c, Active__c, isFBA__c  FROM NRProducts__c WHERE isFBA__c=true AND Active__c = true AND AMZ_Inventory_Update__c != :target_date  LIMIT 10];         Map&lt;String, InboundShipmentPlanRequestItem&gt; itemsMap = new Map&lt;String, InboundShipmentPlanRequestItem&gt;();         if(!details.isEmpty()){             RemainingItems = new List&lt;InboundShipmentPlanRequestItem&gt;();             for(NRProducts__c rl : details){                 InboundShipmentPlanRequestItem item = new InboundShipmentPlanRequestItem(rl.NRName__c);                 itemsMap.put(rl.NRName__c, item);                 RemainingItems.add(item);             }              //request values                 NewPlan = InventoryAMZAPI2.CreateInboundShipmentPlan(                 RemainingItems,                 'Basic'             );              Map&lt;String, String&gt; soDetailSkuMap = new Map&lt;String, String&gt;();               for(InventoryAMZAPI2.InboundShipmentPlan p : NewPlan.InboundShipmentPlans){                 soDetailSkuMap.put(p.SellerSKU, p.InStockSupplyQuantity  );               }              //Assign values to products             List&lt;NRPRoducts__c&gt; nr = [Select NRName__c FROM NRProducts__c Where NRName__c  IN: soDetailSkuMap.keySet()];             for(NRPRoducts__c detail : nr){                 detail.AMZ_Inventory__c = soDetailSkuMap.get(detail.NRName__c );                 detail.AMZ_Inventory_Update__c= date.today();                  update detail;                }           } else{          Debug = 'Done';          }      }      public class InboundShipmentPlanRequestItem extends InventoryAMZAPI2.InboundShipmentPlanRequestItem{         public InboundShipmentPlanRequestItem(String sellerSKU){             super(sellerSKU);         }     } }
I am getting a Too many SOQL queries: 101 error on a trigger when I am trying to deploy another trigger.  I am posting the trigger which is causing the error.  trigger rollupAccountShowings on Account (before insert, before update) {    if (trigger.isinsert) {       for (Account a:Trigger.new){           a.No_of_Viewings__c = 0;        }    } else {      for (account a : [select                   id,                  (select id from pb__Showings__r)                  from account                   where id in:trigger.new LIMIT 1]) {           trigger.newMap.get(a.id).No_of_Viewings__c = a.pb__Showings__r.size();      } }   Can anyone correct me where I have gone wrong and suggest me the changes.  Thanks
Derivatives: enter "evaluated at" vertical bar with multiple values as subscripts Sorry for the long title, but how do I enter evaluated at (for a derivative), with multiple valuation criteria at the bottom of the the big | line?  Thanks! How to fill a mesh with solid color Update iOS 5.1.1 on iPad 1 to at least iOS 6 Show $1/(1+ x^2)$ is uniformly continuous on $\Bbb R$. RAID10 vs. RAID5 for data files We are trying to evaluate the potential performance improvements that could be gained by switching an existing applications .mdf files to a RAID10 LUN vs. the existing RAID5 LUN they are living on right now. The transaction log already lives on a RAID10 LUN.   So the question is, if we move data files to RAID10 would the end user see performance improvements in the GUI? or would it be just faster writes to the data files when a checkpoint occurs and the changes get written to the data file but no improvement would be seen at the end user level? In newer Google Maps I can make area available offline.  Do other applications that rely on Google Maps (utilize Google Maps Android API) use offline maps? dd aplied to dev USB before connect corrupt /dev/sdX and dont work How do I check which shell I am using? I read that terminal is nothing but shell, and Unix provides different flavors of shells:   Bourne shell (sh) C shell (csh) TC shell (tcsh) Korn shell (ksh) Bourne Again shell (bash)   Questions:   When I open a terminal window, which shell is opened by default? How do I check how many shells are installed? How do I change the shell used from my account? I sometimes browse erotic media files but I would like to avoid having them appear in files &amp; folders / recent. How can I do that?  The old "making .recently-used.xbel a folder" trick from 10.10 and older doesn't work any more.   Plus I'd prefer to turn off tracking only temporarily.  I also prefer not to use a separate user for this, as switching users sometimes isn't fast enough. Why would I use manual camera controls instead of the automatic modes? I'm very new to digital photography, so I still haven't gotten the hang of all this exposure and ISO stuff, etc. I have a Canon EOS T3.   My question is how big of a difference does it make using manual settings rather than auto settings for everything? I've taken some pretty nice photos with all auto settings, and I'm not sure if it could have turned out any better using manual settings. I know that there are some people who have been in the game for years upon years, and to them they can notice the difference between photos taken with manual vs auto settings, but for my situation, do you think it really makes a difference? Is my camera smart enough to determine the best settings for me?  Also, lets say manual settings are better (which I'm sure they are, since they give you greater control). How often are you supposed to adjust your settings? Between every shot, considering they are unique shots? Or does it not matter about the object, but rather the lighting environment? So if I'm in a forest at 2:00 PM on a sunny bright day and I take photos for one hour, should I be constantly adjusting my settings between every unique shot to get the best out of it? Or do I usually just find one setting that works for the environment I'm in? Derive Variance of regression coefficient in simple linear regression Evaluate  $$\int\frac{e^xdx}{(e^{2x}-1)(e^x+1)}$$  I tried to decompose the integrand into A and B partial fractions.  No success. How would I solve the following problem involving elementary matrices? Let $A=\begin{pmatrix}0&amp;5\\ 7&amp;4\end{pmatrix}$.      1) Write $A$ as a product of $4$ elementary matrices.      2) Write $A^{-1}$ as a product of $4$ elementary matrices.   My work. I have managed to find $A^{-1}$, which came out to be this:  \begin{pmatrix}-\frac{4}{35}&amp;\frac{1}{7}\\ \frac{1}{5}&amp;0\end{pmatrix}  However, I am struggling to figure out how I would split each of these matrices into $4$ elementary matrices. Any help? I have HTML code like this :  &lt;div&gt;        &lt;a&gt;Link A1&lt;/a&gt;        &lt;a&gt;Link A2&lt;/a&gt;        &lt;a&gt;Link A3&lt;/a&gt; &lt;/div&gt;  &lt;div&gt;        &lt;a&gt;Link B1&lt;/a&gt;        &lt;a&gt;Link B2&lt;/a&gt;        &lt;a&gt;Link B3&lt;/a&gt; &lt;/div&gt;   When user clicks a link from above HTML, I want to get the jQuery object of the corresponding &lt;a&gt; element, and then manipulate its sibling. I can't think of any way other than creating an ID for each &lt;a&gt; element, and passing that ID to an onclick event handler. I really don't want to use IDs.   Any suggestions? Determinant of block matrix with commuting blocks I know that given a $2N \times 2N$ block matrix with $N \times N$ blocks like   $$\mathbf{S} = \begin{pmatrix} A &amp; B\\  C &amp; D \end{pmatrix}$$  we can calculate $$\det(\mathbf{S})=\det(AD-BD^{-1}CD)$$ and so clearly if $D$ and $C$ commute this reduces to $\det(AD-BC)$, which is a very nice property.   My question is, for a general $nN\times nN$ matrix with $N\times N$ blocks where all of the blocks commute with each other, can we find the determinant in a similar way? That is, by first finding the determinant treating the blocks like scalars and then taking the determinant of the resulting $N\times N$ matrix.  Thanks in advance! Film where aliens looking like humans are waiting in an airport closed due to snowstorm I saw the movie 6 - 7 years back on cable tv, from the looks of it it seemed to be made in the late 1990's or early 2000's. Unfortunately I could not see the complete movie. The story goes like--   Some people are waiting at a small airport because snowstorm activity has cancelled all flights in and out. There are two children in the group as well (one boy and a girl). Somehow they discover there are aliens looking like humans among them. They decide to check passengers through baggage scanners (checking the skeletal structure via x-ray). They find and kill 2 aliens.   and the big twist:      5. They then realize the two children are also aliens.   any ideas what the name of the movie is ??? What does "javascript:void(0)" mean? Which email was the verification email sent to? I started my app today and it said that I needed to verify my email. But I don't know the email I chose. I logged on every email in but there was never a verify email. Is there a way to know your email on Pokemon Go? Motley fool says you can make $15,978 more per year with Social Security. Is this for real? The Motley fool has an ad campaign that says you can make $15,978 more per year on Social Security by doing 17 minutes of work using a legal loophole.  I don't want to link to their ad (although, you can find it by searching ).  What are they talking about here?  Is there any truth to this?  If someone could explain it to me without me having to watch the entire ad video or subscribe to their newsletter, I'd appreciate it. There are two directories shown by 'ls'.  Normally directories anywhere are blue on black background.  But the first one is blue on green and impossible to read.  Why is this?  How to make it blue on black, or at least something light on something dark?  This is on Ubuntu 12.04, using bash in Gnome Terminal.  In Konsole, the blue is slightly darker, and possible to read, though could be way better.