I have a button which adds rows to my table. but the property of Delete button dose work as it has been added after readyFucntion have been called   enter code here
112
I have a bit of code where I am looping through all the select boxes on a page and binding a .hover event to them to do a bit of twiddling with their width on mouse on/off.  This happens on page ready and works just fine.  The problem I have is that any select boxes I add via Ajax or DOM after the initial loop won't have the event bound.  I have found this plugin (), but before I add another 5k to my pages with a plugin, I want to see if anyone knows a way to do this, either with jQuery directly or by another option.
78811
I added a new field on Opportunity table to keep a count of records, as well as track the updates made on that record.  This is needed for an external system we use. Opportinity table already has around 5000 records now. I would like to update the new field that I added with some sequence order initially. Say each record to have a unique sequence number like 1,2,3 etc(can't use the Id field for unique). The field "Identifier__c" was added for this purpose with data type number and unique contraint. For that I created a temporary class and trigger. But it is throwing the error.     Review all error messages below to correct your data. Apex trigger OpportunitySAPIdentifierHandler caused an unexpected exception,   contact your administrator: OpportunitySAPIdentifierHandler: execution   of BeforeUpdate caused by: System.DmlException: Update failed. First   exception on row 0 with id 006E00000038FPSIA2; first error:   CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, OpportunitySAPIdentifierHandler:   execution of BeforeUpdate caused by: System.DmlException: Update   failed. First exception on row 0 with id 006E00000038FPTIA2; first   error: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY,   OpportunitySAPIdentifierHandler: execution of BeforeUpdate caused by:   System.DmlException: Update failed. First exception on row 0 with id   006E00000038FPSIA2; first error: SELF_REFERENCE_FROM_TRIGGER, Object   (id = 006E00000038FPS) is currently in trigger   OpportunitySAPIdentifierHandler, therefore it cannot recursively   update itself: [] Class.AutoNumber.OpportunityAutoNumber: line 76,   column 1 Trigger.OpportunitySAPIdentifierHandler: line 4, column 1: []   Class.AutoNumber.OpportunityAutoNumber: line 76, column 1   Trigger.OpportunitySAPIdentifierHandler: line 4, column 1: []:   Class.AutoNumber.OpportunityAutoNumber: line 76, column 1   Below is the trigger and class used.  trigger Opportuniwith sIdentifierHandler on Opportunity (before insert,before update) {          If(Trigger.isInsert || Trigger.isUpdate){             AutoNumber.OpportunityAutoNumber(Trigger.new);         }   }   The class is   public with sharing class AutoNumber {       public static void OpportunityAutoNumber (List&lt;Opportunity&gt; Opp) {          if(Trigger.isUpdate || Trigger.isInsert) {              for(Opportunity p: Opp) {                  List&lt;Opportunity&gt; oppList = new List&lt;Opportunity&gt;();                 oppList = [SELECT Id, createdDate, Identifier__c FROM Opportunity where Identifier__c = null and Id != :p.Id limit 100 FOR update];                 for (Opportunity oppL: oppList) {                      if(oppL.Identifier__c == null) {                          List&lt;Opportunity&gt; OpportunityList = new List&lt;Opportunity&gt;([select Identifier__c from Opportunity where Identifier__c != null order by Identifier__c desc limit 1]);                          if (!OpportunityList.isEmpty()) {                               Decimal maxval = OpportunityList.get(0).Identifier__c;                             oppL.Identifier__c = maxval + 1;                             update oppL;                         }                      }                     // integer currentCounter = Integer.valueOf(opp.Identifier__c);                     // oppr.Identifier__c = currentCounter + 1;                     // update oppr;                 }             }         }        }  }
86079
I recall there is a difference between some methods/properties called directly on the  class, and the identically named methods/properties on the  property. (Might have been the RowCount/Count property for which I read this.) The difference is one of them disregards , and the other respects/uses it.  In this particular case I'm wondering about the difference between  and . I can imagine one of them actually removes all rows, and the other one just marks them as deleted.  So my question is, is there a difference between the two Clear methods, and if so what is the difference?  (Oh, this is for .NET 1.1 btw, in case the semantics changed from one version to another.)
91339
I am running the below query in ideone   CREATE TABLE AUTHOR ( AUTHOR_ID NUMBER(5) PRIMARY KEY, AUTHOR_NAME VARCHAR2(18) );  INSERT INTO AUTHOR (AUTHOR_ID, AUTHOR_NAME) VALUES (1234, 'MC GRAW HILL'); INSERT INTO AUTHOR (AUTHOR_ID, AUTHOR_NAME) VALUES (1235, 'J K ROLLING');     INSERT INTO AUTHOR (AUTHOR_ID, AUTHOR_NAME) VALUES (1236, 'WILLAM'); INSERT INTO AUTHOR (AUTHOR_ID, AUTHOR_NAME) VALUES (1237, 'SHAKESPEAR');  --------------------------------- CREATE TABLE BOOK  ( BOOK_ID NUMBER(5) PRIMARY KEY, BOOK_NAME VARCHAR2(15), AUTHOR_ID NUMBER(5), CONSTRAINT author_fk FOREIGN KEY (AUTHOR_ID) REFERENCES AUTHOR(AUTHOR_ID) ON DELETE CASCADE );  INSERT INTO BOOK (BOOK_ID, BOOK_NAME, AUTHOR_ID)      VALUES (10001, 'SOFTWARE DEVELOPEMENT', 1234); INSERT INTO BOOK (BOOK_ID, BOOK_NAME, AUTHOR_ID)      VALUES (10002, 'HARRY POTTER', 1235); INSERT INTO BOOK (BOOK_ID, BOOK_NAME, AUTHOR_ID)      VALUES (10003, 'TO BE OR NOT TO BE', 1237); INSERT INTO BOOK (BOOK_ID, BOOK_NAME, AUTHOR_ID)      VALUES (10004, 'PROJECT MANAGEMENT', 1234);   After creating these entries, when I try to delete the entries in AUTHOR Table by using following command:  DELETE FROM AUTHOR WHERE AUTHOR_ID = 1234;   Select * from book ;  10001|SOFTWARE DEVELOPEMENT|1234 10002|HARRY POTTER         |1235 10003|TO BE OR NOT TO BE   |1237 10004|PROJECT MANAGEMENT   |1234   and  Select * from author ;  1235|J K ROLLING 1236|WILLAM 1237|SHAKESPEAR   the entry from parent table is deleted but their is no delete cascade effect in child table (BOOK table). Can someone help me what I am doing wrong.  Thanks,
119645
Component  &lt;aura:component implements="force:lightningQuickAction"&gt;     &lt;ui:inputNumber aura:id="num1"/&gt; +     &lt;ui:inputNumber aura:id="num2"/&gt;     &lt;br/&gt;     &lt;ui:button label="Add" press="{!c.showToast}"/&gt; &lt;/aura:component&gt;   Controller    ({         showToast : function(component, event, helper) {         var n1 = component.find("num1").get("v.value");         var n2 = component.find("num2").get("v.value");          // Display the total in a "toast" status message          var resultsToast = $A.get("e.force:showToast");         resultsToast.setParams({             "title": "Quick Add: " + n1 + " + " + n2,             "message": "The total is: " + (n1 + n2) + "."         });         resultsToast.fire();          // Close the action panel          var dismissActionPanel = $A.get("e.force:closeQuickAction");         dismissActionPanel.fire();         }     })   ERROR MESSAGE     This page has an error. You might just need to refresh it. Action   failed: c$TestCheck1$controller$showToast [Cannot read property   'setParams' of undefined] Failing descriptor:   {c$TestCheck1$controller$showToast}
24017
While reuploading a bunch of  to imgur, I noticed something funny: sometimes, after uploading an image from the web, I would no longer be able to paste anything into the edit box.  A bit more investigation revealed that the following steps are needed to reproduce this bug:   In the SE post editor, click the button to upload an image. In the image upload dialog, click "You can also provide a link from the web." Make sure the URL input box has the focus, and then close the dialog by pressing Esc.  Alternatively, on Firefox, type or paste an image URL into the text box and submit the form by pressing Enter.  (This  does not seem to trigger the bug on Chrome; thanks, Chris Jester-Young.)  Either way, the bug will not be triggered if you close the dialog by clicking something outside the URL input box, like the submit button or the close button. Once back in the Markdown editor, try pasting something into the edit box.  Nothing will happen. Reopening and closing the image upload dialog will make paste work again.   Apparently, what happens is that the image upload dialog installs its own paste event handler onto the &lt;body&gt; element, in order to let you paste images into the dialog to upload them.  This handler should be removed when the dialog closes, but the steps above break this, leaving the handler in place.  Why?  Well, it turns out that the dialog itself removes the paste event handler when the URL entry box gains focus (so that you can paste an URL into it, of course), and adds it back when the box loses focus.  But if you submit the upload form while the URL entry box still has focus, then the blur event handler on the box runs only after the dialog has closed.  Thus, the sequence of events (no pun intended) runs like this:   Open upload dialog.  Paste event handler is added. URL entry box gets focus.  Paste event handler is removed. Close upload dialog by pressing Esc.  Paste event handler is (again, redundantly) removed. URL entry box loses focus as it disappears from the page.  Paste event handler is added back.  (Oops!)   How do we fix this?  Well, I see a bunch of ways:   Have the code that closes the popup remove the blur event handler from the URL input, so that it cannot run any more, before removing the popup from the DOM. Have the blur event handler itself check a flag to see if we've already closed the dialog, and if so, not add back the paste handler on &lt;body&gt;. Have the paste handler itself check if the upload dialog is present, and if not, do nothing and let the event propagate.   Any of these should work.  Heck, you could implement all of them, just to make sure. :)
72015
If you are looking at an answer with a code snippet in it, and the answerer updates the answer, you see An edit has been made (etc.). If you click that, the answer is refreshed, but the code snippet buttons (Run, Copy, and Expand) go missing.  The code snippet buttons are there again after reloading the entire page.  Answer has been edited:        After clicking to reload it:        Similarly, non-snippet code blocks do not receive syntax highlighting after an edit, as described , which refers to  as a related or root cause.  (Browser: Chrome v77 - OS: Windows 10 Pro x64)
9826
I have a javascript button on my product layout named "ListToEbay" and I have written a controller to invoke the EndItem()  service method of ebay api.  Below is the method:--  public void  removeItemFromEbayList() {   HttpRequest req = new HttpRequest();   Http http = new Http();   sEnvelopHandlerForEndingList='Request XML';   req.setBody(sEnvelopHandlerForEndingList); }   I want to execute this method directly on clicking that button, without going or opening a VisualForce Page. How can I accomplish that?
22242
I'm in a bit of a verbiage bind. I have a form for a request cancellation. I cannot change the wording on that. The word cancel HAS to be used.  The button bellow sits in the footer of a card. Unfortunately, I cannot show you the rest of the card for context.      Clicking that button brings up the above form in the footer of the card.  The pattern shown here (form input on one line, followed by a cancel and submit button with the below styles and ordering) is used across the application. This is another non negotiable. Clicking that cancel button collapses the form back into the original button ("Cancel Request").  As you can probably tell as this point, I have a Cancel-Cancel-Conundrum. I need a better word than cancel for that form button, but I'm having trouble thinking of something. I was thinking something along the lines of "Exit" but that feels a little weird.
5792
I have one text input and one button (see below). How can I use JavaScript to trigger the button's click event when the Enter key is pressed inside the text box?  There is already a different submit button on my current page, so I can't simply make the button a submit button. And, I only want the Enter key to click this specific button if it is pressed from within this one text box, nothing else.  &lt;input type="text" id="txtSearch" /&gt; &lt;input type="button" id="btnSearch" value="Search" onclick="doSomething();" /&gt;
62170
How does the code  work with Ctrl + K? I am new to Stack Overflow.   I can't get it with Ctrl + K. I  press space button for 4 times in each line I post.
32675
I have a VF page that is the 'edit' page for a certain object. I have a button 'Clone'. Upon clicking this button, I wish to be redirected to a new edit page with all the previous objects fields still intact (except for a few that should be cleared and set to default). Note that this new object should not be inserted until I click 'Save'. The Id of the object should be different compared to the previous object, so that on Save, the previous object is not overwritten.   I am thinking I will split this up into two parts, an apex method, and a javascript method for resetting the fields:  &lt;apex:commandButton action="{!saveAsTemplate}" onclick="initTemplate();" value="Clone" /&gt;   The javascript portion is easy enough, but I'm having trouble of figuring out what to do on the apex side, besides for setting the id of the record to null.
102581
Is there a way to add a button control to a cell in inside a ListView in a WinForms app?
80540
I'm trying to do some treatement after creating an item but the treatement is done twice because in my code after creating the item, I'm updating it , so the event reciever get fired twice: first when I add the element and the second when I updated it. Here's the code :  if (Mode == OperationMode.New) {     item = ListeActions.AddItem();     item["Client"] = new SPFieldLookupValue(myClient.ID, myClient["Name"] as string).ToString();     //the Event Reciever ItemAdded is fired here } if (Mode == OperationMode.Edit) {     item = ListeActions.GetItemById(ActionItemID); } TextField ACObject = (TextField)Page.GetControlById("ACObjectID"); UserField ACAssignedTo = (UserField)Page.GetControlById("ACAssignedToID"); NoteField ACDetails = (NoteField)Page.GetControlById("ACDetailsID");  item["Object"] = ACObject.Value; item["AssignedTo"] = ACAssignedTo.Value; item["Details"] = ACDetails.Value;  item.Update();  //if we're in the case of adding new item then the event //reciever ItemAdded is fired here for the second time //while ItemUpdated is not fired   So how can I stop the second fire of itemAdded resulting on the item.Update() yet keep the first fire since I need to keep applying my treatement?  PS: in the case of updating an existing ListeActions.item the itemUpdated is fired twice too !!  BTW : This Code isn't written in the itemadded method nor in the itemupdated method, actually it's the code in a user control for a webpart development.
36370
This is probably a simple answer but I can't find it.  I have a table with a column of integers and I want to ensure that when a row is inserted that the value in this column is greater than zero.  I could do this on the code side but thought it would be best to enforce it on the table.  Thanks!  I was in error with my last comment all is good now.
105818
Is it possible to add a new button to an existing panel or an existing node that runs a custom operator?  How can I do this?
10000
The accepted answer is factually incorrect; one can simply call  row.Table.Columns.Contains(name);   What should be done?