Error when editing form --using an event receiver

Hi,
I created an event receiver sandbox solution and deployed it to preprod.  My code doesn't work and everytime I edit an item it gives me this error. I don't receive an error when I create an item.
Server encountered an internal error. For more information, turn off customErrors in the server's .config file.
at Microsoft.SharePoint.SPGlobal.HandleComException(COMException comEx) at Microsoft.SharePoint.Library.SPRequest.AddOrUpdateItem(String bstrUrl, String bstrListName, Boolean bAdd, Boolean bSystemUpdate, Boolean bPreserveItemVersion, Boolean bPreserveItemUIVersion,
Boolean bUpdateNoVersion, Int32& plID, String& pbstrGuid, Guid pbstrNewDocId, Boolean bHasNewDocId, String bstrVersion, Object& pvarAttachmentNames, Object& pvarAttachmentContents, Object& pvarProperties, Boolean bCheckOut, Boolean bCheckin,
Boolean bMigration, Boolean bPublish, String bstrFileName, ISP2DSafeArrayWriter pListDataValidationCallback, ISP2DSafeArrayWriter pRestrictInsertCallback, ISP2DSafeArrayWriter pUniqueFieldCallback) at Microsoft.SharePoint.SPListItem.AddOrUpdateItem(Boolean
bAdd, Boolean bSystem, Boolean bPreserveItemVersion, Boolean bNoVersion, Boolean bMigration, Boolean bPublish, Boolean bCheckOut, Boolean bCheckin, Guid newGuidOnAdd, Int32& ulID, Object& objAttachmentNames, Object& objAttachmentContents, Boolean
suppressAfterEvents, String filename, Boolean bPreserveItemUIVersion) at Microsoft.SharePoint.SPListItem.UpdateInternal(Boolean bSystem, Boolean bPreserveItemVersion, Guid newGuidOnAdd, Boolean bMigration, Boolean bPublish, Boolean bNoVersion, Boolean bCheckOut,
Boolean bCheckin, Boolean suppressAfterEvents, String filename, Boolean bPreserveItemUIVersion) at Microsoft.SharePoint.SPListItem.Update() at Microsoft.SharePoint.WebControls.SaveButton.SaveItem(SPContext itemContext, Boolean uploadMode, String checkInComment)
at Microsoft.SharePoint.WebControls.SaveButton.OnBubbleEvent(Object source, EventArgs e) at System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
private bool HasFieldChanged(SPItemEventProperties properties, string sInternalName)
if (properties.ListItem[sInternalName] != null && properties.AfterProperties[properties.ListItem.Fields[sInternalName].StaticName] != null)
//before properties is not equal than after properties
return !properties.ListItem[sInternalName].ToString().Equals(properties.AfterProperties[properties.ListItem.Fields[sInternalName].StaticName].ToString(), StringComparison.OrdinalIgnoreCase);
return false;
 public override void ItemUpdating(SPItemEventProperties properties)
 base.ItemUpdating(properties);
 try
 if (HasFieldChanged(properties, "WHQ") && !HasFieldChanged(properties, "Employee Type"))
 SPList oSPList = properties.Web.Lists["EPDEMails"];
 SPListItem oSPItem = oSPList.AddItem();
 SPListItem item = properties.ListItem;
 string sAfterWHQDepartment = properties.AfterProperties[properties.ListItem.Fields["WHQ Department"].StaticName].ToString();
 string sBeforeWHQDepartment = item[properties.ListItem.Fields["WHQ Department"].StaticName].ToString();
 string sEmails = string.Empty;           
 string sGroups = string.Format("{0},{1},Editors", sAfterWHQDepartment, sBeforeWHQDepartment);
 foreach (string group in sGroups.Split(','))
 foreach (SPUser thisuser in properties.Web.Groups[group].Users)
                            sEmails += thisuser.Email + ";";
                    oSPItem["Subject"] = "Employee Transfer to a different WHQ Department";
                    oSPItem["To"] = sEmails;
                    oSPItem["Body"] = string.Format("{0} {1} has been transferred to {2} from {3}. Please update EPD ASAP", item["First Name"],
item["Last Name"], sAfterWHQDepartment, sBeforeWHQDepartment);
                    oSPItem.Update();
  if (HasFieldChanged(properties, "Region") && !HasFieldChanged(properties, "Employee Type"))
                SPList oSPList = properties.Web.Lists["EPDEMails"];        
  SPListItem oSPItem = oSPList.AddItem();
  SPListItem item = properties.ListItem;
  string sAfterRegion = properties.AfterProperties[properties.ListItem.Fields["Region"].StaticName].ToString();
  string sBeforeRegion = item[properties.ListItem.Fields["Region"].StaticName].ToString();
  string sEmails = string.Empty;
  string sGroups = string.Format("{0},{1},Editors", sAfterRegion, sBeforeRegion);
  foreach (string group in sGroups.Split(','))
  foreach (SPUser thisuser in properties.Web.Groups[group].Users)
                       sEmails += thisuser.Email + ";";
                    oSPItem["Subject"] = "Employee Transfer to a different Region";
                    oSPItem["To"] = sEmails;
                    oSPItem["Body"] = string.Format("{0} {1} has been transferred to {2} from {3}. Please update EPD ASAP", item["First Name"],
item["Las tName"], sAfterRegion, sBeforeRegion);
                    oSPItem.Update();
 if (HasFieldChanged(properties, "Employee Type"))
 SPList oSPList = properties.Web.Lists["EPDEMails"];
 SPListItem oSPItem = oSPList.AddItem();
 SPListItem item = properties.ListItem;
 string sChangedEmployeeType = properties.AfterProperties[properties.ListItem.Fields["Employee Type"].StaticName].ToString();
 if (sChangedEmployeeType == "Region")
string sAfterRegion = properties.AfterProperties[properties.ListItem.Fields["Region"].StaticName].ToString();
string sBeforeWHQDepartment = item[properties.ListItem.Fields["WHQ Department"].StaticName].ToString();
string sEmails = string.Empty;
string sGroups = string.Format("{0},{1},Editors", sAfterRegion, sBeforeWHQDepartment);
 foreach (string group in sGroups.Split(','))
 foreach (SPUser thisuser in properties.Web.Groups[group].Users)
                                sEmails += thisuser.Email + ";";
                        oSPItem["Subject"] = "Employee Transfer to a Region";
                        oSPItem["To"] = sEmails;
                        oSPItem["Body"] = string.Format("{0} {1} has been transferred to {2} from {3}. Please update EPD ASAP",
item["First Name"], item["Last Name"], sAfterRegion, sBeforeWHQDepartment);
                        oSPItem.Update();
 else if (sChangedEmployeeType == "WHQ")
 string sBeforeRegion = item[properties.ListItem.Fields["Region"].StaticName].ToString();
 string sAfterWHQDepartment = properties.AfterProperties[properties.ListItem.Fields["WHQ Department"].StaticName].ToString();
 string sEmails = string.Empty;
 string sGroups = string.Format("{0},{1},Editors", sAfterWHQDepartment, sBeforeRegion);
 foreach (string group in sGroups.Split(','))
 foreach (SPUser thisuser in properties.Web.Groups[group].Users)
                                sEmails += thisuser.Email + ";";
                        oSPItem["Subject"] = "Employee Transfer to a WHQ Department";
                        oSPItem["To"] = sEmails;
                        oSPItem["Body"] = string.Format("{0} {1} has been transferred to {2} from {3}. Please update EPD ASAP",
item["First Name"], item["Last Name"], sAfterWHQDepartment, sBeforeRegion);
                        oSPItem.Update();
  //send email
  SmtpClient sendEmail = new SmtpClient();
  MailMessage message = new MailMessage();
  sendEmail.Host = "[email protected]";
  message.IsBodyHtml = true;
  message.From = new MailAddress("[email protected]");
  message.To.Add("[email protected]");
  message.Subject = "Test Email on Transfer Jan 13th";
  message.Priority = MailPriority.Normal;
  sendEmail.Send(message);
catch (Exception ex)
throw ex;
This is really frustrating.  Any help is appreciated.
Talibah C

Hello,
Can you debug your solution and let us know the line where your code is failing. Also tell what form you are editing and Is there any checkin/Checkout feature enable on that library?
BTW i have found two similar threads for same error:
http://social.technet.microsoft.com/Forums/sharepoint/en-US/2096609e-036e-4e5a-bd69-3cded4d3ca89/sharepoint-2010-error-failed-hr-detected-unable-to-update-list-item?forum=sharepointgeneralprevious
http://social.msdn.microsoft.com/Forums/sharepoint/en-US/2277fdab-5652-4627-9879-da199089d6e6/how-can-i-get-around-this-error-when-modifying-a-document-via-itemadded-event?forum=sharepointdevelopmentlegacy
Hemendra:Yesterday is just a memory,Tomorrow we may never see
Please remember to mark the replies as answers if they help and unmark them if they provide no help

Similar Messages

  • 1043 error when trying to use dynamic events on RT system

    Hello,
    I am trying to define some dynamic events as specified it the LabView help for RT targets. But when trying to run the vi I get the 1043 error. What am I doing wrong?
    Thank you,
    Przemek
    Attachments:
    RT test.vi ‏17 KB

    Dear Przemek,
    to fully understand you problem and to be able to help you, I will have to ask you a few questions:
    What version of LabVIEW are you using?
    What RT target are you using?
    What specific help file are you referring to?
    Are you creating an executable? If yes, this document could be helpful:
    http://digital.ni.com/public.nsf/allkb/1E180530E05E4DB28625731C006CCB5A?OpenDocument
    Regards,
    Mateusz Stokłosa
    Applications Engineer
    National Instruments

  • Error when editing archives using the VI.

    good afternoon to all.
    I am having the error below when I try to edit an archive with publisher vi. Somebody has some idea?
    root@cvrd0504 # vi startAPPMAXTAT.sh
    xterm: Unknown terminal type
    [Using open mode]
    Segmentation Fault (core dumped)

    What window manager (if any) are you using?
    Try
    # echo $TERM
    to see if the value of your terminal variable
    is set correctly:
    dtterm for the CDE window manager
    SUN for a Sun monitor in console mode
    ?? for a Gnome window manager

  • Frm-92101 getting error when running form using webutil

    hi
    I get an error FRM-92101:There was a failure in the Forms Server during startup. This could happen due to invalid configuration. Please look into the web-server log file for details
    i am using form version
    Forms [32 Bit] Version 10.1.2.0.2 (Production)
    problem is some time form runs and some time dont any solution or possibility???

    check this for configuration of webutil
    http://baigsorcl.blogspot.com/search/label/WebUtil
    Baig
    [My Oracle Blog|http://baigsorcl.blogspot.com/]

  • Getting error when submitting form using IE but not when using FF

    Error: Error #2101: The String passed to URLVariables.decode() must be a URL-encoded query string containing name/value pairs.
        at Error$/throwError()
        at flash.net::URLVariables/decode()
        at flash.net::URLVariables()
        at flash.net::URLLoader/onComplete()
    Has anyone had this problem?

    I don't know how I would test that I don't know of any way to test it locally.
    here's the code for the form:
    import flash.net.*;
    import flash.events.*;
    import flash.text.TextField;
        var status_txt:TextField = new TextField();
        var myFormat:TextFormat = new TextFormat();
        myFormat.font = "Georga";
        myFormat.color = 0x00ff00;
        myFormat.size = 21;
        status_txt.autoSize = TextFieldAutoSize.LEFT;
        status_txt.x = -240;
        status_txt.y = -225;
        addChild(status_txt);
    submit_btn.addEventListener(MouseEvent.CLICK, ValidateAndSend);
    stage.addEventListener(KeyboardEvent.KEY_DOWN, reportKeyDown);
    //this.status_txt.mouseEnabled = false;
    //this.parent.mouseEnabled = true;
    function reportKeyDown(e:KeyboardEvent):void {
        var KeyCode:uint = e.charCode;
        if (KeyCode == 13){
            submit_btn.dispatchEvent(new MouseEvent(MouseEvent.CLICK));
    function ValidateAndSend(e:MouseEvent):void {
    var variables:URLVariables = new URLVariables();
    var request:URLRequest = new URLRequest();
    // variables.recipient = "[email protected]";
    if(!name_input.length){    createStatus("please enter a name"); }
    else if(!email_input.length) {createStatus("please enter a email address");}
    else if(!validateEmail(email_input.text)){createStatus("enter valid email address");}
    else if(!message_input.length){createStatus("please enter a message");}
    else {
        variables.name = name_input.text;
        variables.email = email_input.text;
        variables.message = message_input.text;
    request.url = "gdform.php";
    request.method = URLRequestMethod.POST;
    request.data = variables;
    var loader:URLLoader = new URLLoader();
    loader.dataFormat = URLLoaderDataFormat.VARIABLES;
    loader.load(request);
    createStatus("Thanks " + name_input.text + ", your message has been sent!");
    function createStatus(msg:String):void {
        status_txt.text = msg;
        status_txt.setTextFormat(myFormat);   
    function validateEmail(str:String):Boolean {
        var pattern:RegExp = /(\w|[_.\-])+@((\w|-)+\.)+\w{2,4}+/;
        var result:Object = pattern.exec(str);
        if(result == null) {
            return false;
        return true;
    this is the php on the server that I submit to.
    <?php
        $request_method = $_SERVER["REQUEST_METHOD"];
        if($request_method == "GET"){
          $query_vars = $_GET;
        } elseif ($request_method == "POST"){
          $query_vars = $_POST;
        reset($query_vars);
        $t = date("U");
        $file = $_SERVER['DOCUMENT_ROOT'] . "/../data/gdform_" . $t;
        $fp = fopen($file,"w");
        while (list ($key, $val) = each ($query_vars)) {
         fputs($fp,"<GDFORM_VARIABLE NAME=$key START>\n");
         fputs($fp,"$val\n");
         fputs($fp,"<GDFORM_VARIABLE NAME=$key END>\n");
         if ($key == "redirect") { $landing_page = $val;}
        fclose($fp);
        if ($landing_page != ""){
        header("Location: http://".$_SERVER["HTTP_HOST"]."/$landing_page");
        } else {
        header("Location: http://".$_SERVER["HTTP_HOST"]."/");
    ?>

  • Symbol error when submitting form

    experiencing a symbol error when submitting form.

    Hi Gen,
    Unfortunately, the error came from a client who was submitting a form via Mac OS.  He stated that when he attempted to submit he received a symbol error.
    On another note, I did experience issues with periods (.) within another form such as 2009.01 and 2011.25.  When I downloaded the files corresponding to the numbers, it wouldn’t allow me to save it with the period (used an underscore instead).
    Warmest regards,
    Delia
    Delia Boyd
    Program Manager, Standards Development
    Executive Office
    AOAC INTERNATIONAL
    481 N. Frederick Avenue, Suite 500
    Gaithersburg, MD 20877-2417
    301-924-7077 x126
    301-924-7089 - Fax
    [email protected]<mailto:[email protected]>
    www.aoac.org<http://www.aoac.org/>
    cid:[email protected]
    127th AOAC Annual Meeting & Exposition
    Palmer House Hilton
    Chicago, Illinois
    August 25-28, 2013
    For more information visit our website
    at: http://www.aoac.org/meetings1/127th_annual_mtg/main_2.htm
    þ Please consider the environment before printing this email.
    ...you will see it when you believe it!

  • With the following warning "ligheroom encountered an error when reading form its preview cache and n

    with the following warning "ligheroom encountered an error when reading form its preview cache and needs to quit.  lightroom will attempt to fix this problem the next time it lanuchse "
    ligheroom progrem 5.4 64-bit is stopped
    i can't use the Lightroom Progrem
    and want to solve the problem As soon as possible

    Delete preview cache - that should solve the problem.
    It's the .lrdata folder in with your catalog, named something like "My Catalog Previews.lrdata".
    Delete entire .lrdata folder, making sure you get the one in the same folder as the catalog you're opening. Do not delete anything else, and if you have something like "My Catalog Smart Previews.lrdata" - that's not it.
    http://helpx.adobe.com/lightroom/kb/preference-file-locations-lightroom-41.html
    When Lr comes up, consider initiating whole-catalog building of standard previews (Library -> Previews menu), lest you be "forever" greeted by temporarily gray thumbnails and "loupe loading" indicator in the future..

  • Hp pavilion dv6 6180 help me for this error when I am using my recovery disk

    hp pavilion dv6 6180 help me for this error when I am using my recovery disk
    The destination drive is not connected

    Hello Mohammadshamlou.  I understand that you're having some issues using your Recovery Disc.  It is giving you the error that the drive is not connected.  Is this correct?  How long have you had the notebook?
    What issue originally led you to want to try a recovery?
    The error seems to imply that it is not detecting the hard drive as this would be the most logical destination drive.  So, I feel the best thing to try first is verify that the hard drive is in proper working order.  Follow these steps and please post the result. 
    Please click the white star under my name to give me Kudos as a way to say "Thanks!"
    Click the "Accept as Solution" button if I resolve your issue.

  • "500 internal server error" when trying to use F4 help in the variable sele

    Hi Experts,
    I am getting "500 internal server error" when trying to use F4 help in the variable selection screen (in WAD).
    How could this be resolved?
    Quick reply would be very helpfull.
    Thanks in advance !!

    It seems you are using wrong client ID. Make sure your logon pad has right details. You should verify this with your basis team.
    If the problem persists then try re-installing. But before you do that you can execute sapbexc.xla which is in the c:\program files\sap\bw. Type c:\ in cell c3 and click "start button". Any red flag means you have wrong version dll/ocx on your local drive, in that case you should reinstall with right patches.
    if this solution helps u then pls assign points

  • ORA-04062 error when running forms with different users

    ORA-04062 error when running forms with different users
    I have a form that has a block that should display some data from another users tables. (The other user's name is dynamic, it's selected from a list box)
    I wrote a stored procedure to get the data from other user's tables.
    When I compile the form and run it with the same user I compiled, it works without any error. But when I run the compiled form with another user I get the ORA-04062 (signature of procedure has been changed) error.
    I tried setting REMOTE_DEPENDENCIES_MODE to SIGNATURE in init.ora but it didn't help.
    My Forms version is 6i with Patch 15.
    Database version is 9.
    Here is my stored procedure:
    TYPE Scenario_Tab IS TABLE OF NUMBER(34) INDEX BY BINARY INTEGER;
    TYPE Open_Curs IS REF CURSOR;
    PROCEDURE Get_Scenarios(User_Name IN VARCHAR2, Scen_Table OUT Scenario_Tab) IS
    Curs Open_Curs;
    i NUMBER;
    BEGIN
    OPEN Curs FOR
    'SELECT Seq_No FROM '|| User_Name ||'.scenario';
    i := 1;
    LOOP
    FETCH Curs INTO Scen_Table(i);
    EXIT WHEN Curs%NOTFOUND;
    i := i + 1;
    END LOOP;
    END Get_Senarios;
    I would be happy to solve this problem. It's really important.
    Maybe somebody can tell me another way to do what I want to do. (getting a list of values from another users tables)

    I think it should be a better solution to create a package,
    and put your own TYPES and procedure into it.
    CREATE OR REPLACE PACKAGE PKG_XXX IS
    TYPE TYP_TAB_CHAR IS TABLE OF .... ;
    PROCEDURE P_XX ( Var1 IN VARCHAR2, var2 IN OUT TYP_TAB_CHAR );
    END ;
    Then in your Form :
    Declare
    var PKG_XXX.TYP_TAB_CHAR ;
    Begin
    PKG_XXX.P_XX( 'user_name', var ) ;
    End ;

  • Runtime error when trying to use Thinkvantage system updater

    I get a runtime error when trying to use the Thinkvantage system updater.Have tried it numerous times and this is the exact message:
    "Runtime error!
    Program:C:\Program Files\Lenovo\System Update\tvsu.exe
    This application has requested the Runtime to terminate it in an unusual way.
    Please contact the application's support team for more information."
    Can somebody please help me to get the Thinkvantage system updater working properly?
    Thanks-George
    This issue has since been resolved.Thanks-G

    I'm getting the same error.   I tried reinstalling system updater but it didn't help.

  • Why do I get this error when trying to use my bluetooth headset as a listening device? There was an error connecting to your audio device. Make sure it is turned on and in range. The audio portion of the program you were using may have to be restarted.

    Why do I get this error when trying to use my bluetooth headset as a listening device? There was an error connecting to your audio device. Make sure it is turned on and in range. The audio portion of the program you were using may have to be restarted.

    I may have already resolved this issue buy removing the device from my computer and re-pairing it. It is currently working just fine.

  • "Finding occurrences" error when editing .mxml file in Flash Builder 4.6 Premium (Trial)

    I am evaluating Flash Builder 4.6.  Windows 7 Ultimate x64
    I am trying to go through the Flex in a week training series but I am getting a lot of the "Finding occurrences" errors when editing the mxml files.
    The error:
    An internal error occurred during: "Finding occurrences".
    java.lang.NullPointerException
    This error occurs almost every time an xml tag is edited.
    I can dismiss the error window that pops up by hitting 'Enter' and can continue editing the .mxml file but the error keeps repeating.
    I was getting this error in the Day 1 set of exercises but after awhile the errors just stopped.
    Now that I have imported the Day 2 starter projects, the error has started again but is occurring on almost every keystroke when editing an xml tag/element!.
    Anyone have any ideas how to correct this issue?

    Ok, I seemed to have found a solution/workaround for the error.
    After importing the Day 2 starter projects, I did not exit and restart Flash Builder. After exiting/restarting Flash Builder, I can now edit the .mxml files without the annoying "Finding occurrences" errors.

  • Can anyone list problems/errors when uploading data using BDC's and BAPI's?

    Can anyone list the problems/errors when uploading data using BDC's and BAPI's?

    Hi,
    If you are actually creating a BDC to load data pls be more specific.
    Data format incorrect. Tab delimited/ etc
    Dates in wrong formats
    Currency incorrect formats
    Missing screens
    Wrong transaction code
    File not found,
    Missing Mandatory fields,
    Screen resoultion.
    You should always use refresh for your Bdcdata table.
    Loop at internal table.
    refresh Bdcdata.
    regards,
    sowjanya.

  • I get the following error when trying to use the itunes store "your apple id has been disabled"

    I get the following error when trying to use the itunes store "your apple id has been disabled".  My account was disabled when someone else had been using it without my knowledge.  I changed my apple id password and the apple id is still fine, but itunes has it disabled.  I verified that the computer is authorized for this apple id.  What to do now?

    Welcome to the Apple Community.
    Contact Apple through iTunes Store Support

Maybe you are looking for

  • Why cant i airprint documents from my idisk app on my iphone 4?

    I cant seem to use airprint for documents that are on my idisk. i have an i phone 4 (verizon) and mobile me account with the idisk app installed. i have updated the ios to the most recent update and have a compatible hp printer that works with other

  • Is it possible to install kde 4.8b1 from binary?

    I've been on a mac for ages and have really grown out of love with it.  The KDE 4.9b1 announcement got me moist and thinking again about moving all my computers to linux. I was wondering what the easiest way to install KDE 4.9b1 would be?  I'm not a

  • Interlinear greek/english

    WinXP, CS2 4.0.5 setting up greek/english interlinear translation book900+pgs. Text is coming in with tabs between words/phrases. Need to set it up so there will be equal # after greek or eng. text whichever word or phrase is the longest. Orig. plan

  • Download Error? Help?!

    Morning Forums! I recently purchased a new song. I did this on my MBP, in iTunes, with my iTunes account. I have a USB hard drive attached which is the "Save To" location for iTunes. I have confirmed that the settings are accurate in preferences. I a

  • Unable to reinstall January Software Update

    I recently had to move to a new Mac after installing the January Software Update on the Touch. After ensuring I had all the songs and other content from the old machine I restored the iPod Touch wanting to rebuild all songs etc. from scratch. However