Get All Values From NewForm.aspx using Event Receiver Item Adding

HI All,
         I have conditions to check before the insertion of "Calendar Event".For this I am using Item Adding Event Receiver ,When Click on Save button I need to get all the values of Items filled in NewForm.aspx and check
the condition,If condition satisfies make them insert else show alert info  as"Not Valid",Below is code and error message
public override void ItemAdding(SPItemEventProperties properties)
            base.ItemAdding(properties);
           string StartTime = properties.AfterProperties["Start Time"].ToString();
           string EndTime = properties.AfterProperties["End Time"].ToString();
Error
Object reference not set to an instance of an object.
Use the New "Keyword to create an object instance
Can any one help me how can I do it.
Thanks,
Quality Communication Provides
Quality Work.
http://siddiq-sharepoint2010.blogspot.in/
Siddiqali Mohammad .

Hi,
      Have you tried with the code snippet as mentioned below
string EndDate = Convert.ToString(properties.AfterProperties["EndDate"]);
string StartDate = Convert.ToString(properties.AfterProperties["EventDate"]);
If my post is helpful - please click on the green arrow to mark it as answer

Similar Messages

  • How to get all values from an interval using select statement

    Hi,
    Is it possible to write a select statement that returns all values from an interval? Interval boundaries are variable.
    something like this:
    select (for x in 1,1024 loop x end loop) from dual
    (this, of course, doesn't work)
    The result in this example should be 1024 rows of numbers from 1 to 1024. These numbers are parameters, so it is not possible to create a table with predefined values.
    Thanks in advance for your help,
    Mia.

    For your simple case, with a lower boundary of 1, you can use:
    SELECT rownum
    FROM all_objects
    WHERE rownum <= 1024For a set of number between say 50 - 100, you can use something like:
    SELECT rownum + (50 - 1)
    FROM all_objects
    WHERE rownum <= (100 - 50 + 1)Note, that all_objects was used only because it generally has a lot of rows. Any table with at least the number of rows in your range will work.
    TTFN
    John

  • How can i get all values from jtable with out selecting?

    i have one input table and two output tables (name it as output1, output2). Selected rows from input table are displayed in output1 table. The data in output1 table is temporary(means the dat wont store in database just for display purpose).
    Actually what i want is how can i get all values from output1 table to output2 table with out selecting the data in output1 table?
    thanks in advance.
    raja

    You could set the table's data model to be the same:
    output2.setModel( output1.getModel() );

  • How to get string value from database table using Visual Studio 2005?

    Hi,
    Im developing plugin in illustrator cs3 using visual studio 2005. I need to get the values eneterd in database. Im able to get the integer values. But while getting string values it is returning empty value.
    Im using the below code to get the values from database table
    bool Table::Get(char* FieldName,int& FieldValue)
        try
            _variant_t  vtValue;
            vtValue = m_Rec->Fields->GetItem(FieldName)->GetValue();
            FieldValue=vtValue.intVal;
        CATCHERRGET
        sprintf(m_ErrStr,"Success");
        return 1;
    Im using the below code to get the values.
    AIErr getProjects()
        char buf[5000];
        int i;   
        std::string  catName;
        ::CoInitialize(NULL);
        Database db;
        Table tbl;
        errno_t err;
        err = fopen(&file,"c:\\DBResult.txt","w");
        fprintf(file, "Before Connection Established\n");
        //MessageBox(NULL,CnnStr,"Connection String",0);
        if(!db.Open(g->username,g->password,CnnStr))
            db.GetErrorErrStr(ErrStr);
            fprintf(file,"Error: %s\n",ErrStr);
        fprintf(file, "After Connection Established\n");
    if(!db.Execute("select ProjectID,ProjectName from projectsample",tbl))
            db.GetErrorErrStr(ErrStr);
            fprintf(file,"Error: %s\n",ErrStr);
        int ProjectID;
        int UserID;
        int ProjectTitle;
        char ProjectName[ProjectNameSize];
        if(!tbl.ISEOF())
            tbl.MoveFirst();
        ProjectArrCnt=0;
        for(i=0;i<128;i++)
            buf[i]='\0';
            int j=0;
        while(!tbl.ISEOF())
            if(tbl.Get("ProjectID",ProjectID))
                fprintf(file,"Project ID: %d ",ProjectID);
                ProjectInfo[ProjectArrCnt].ProjectID = ProjectID;
                sprintf(buf,"%d",ProjectID);
                //MessageBox(NULL, buf,"f ID", 0);
                j++;
            else
                tbl.GetErrorErrStr(ErrStr);
                fprintf(file,"Error: %s\n",ErrStr);
                break;
            //if(tbl.Get("ProjectTitle",ProjectName))
            if(tbl.Get("ProjectName",ProjectName))
                MessageBox(NULL,"Inside","",0);
                fprintf(file,"ProjectTitle: %s\n",ProjectName);
                //catName=CategoryName;
                ProjectInfo[ProjectArrCnt].ProjectName=ProjectName;
                //sprintf(buf,"%s",ProjectName);
                MessageBox(NULL,(LPCSTR)ProjectName,"",0);
            else
                tbl.GetErrorErrStr(ErrStr);
                fprintf(file,"Error: %s\n",ErrStr);
                break;
            ProjectArrCnt++;
            //MessageBox(NULL, "While", "WIN API Test",0);
            tbl.MoveNext();
        //MessageBox(NULL, ProjectInfo[i].ProjectName.c_str(),"f Name", 0);
        ::CoUninitialize();
        //sprintf(buf,"%s",file);
        //MessageBox(NULL,buf,"File",0);
        fprintf(file, "Connection closed\n");
        fclose(file);
        for(i=0;i<ProjectArrCnt;i++)
            sprintf(buf,"%i",ProjectInfo[i].ProjectID);
            //MessageBox(NULL,buf,"Proj ID",0);
            //MessageBox(NULL,ProjectInfo[i].ProjectName.c_str(),"Project Name",0);
        return 0;
    In the above code im geeting project D which is an integer value. But not able to get the project name.
    Please some one guide me.

    As I said in the other thread, this really isn't the place to ask questions about a database API unrelated to the Illustrator SDK. You're far more like to find people familliar with your problem on a forum that is dedicated to answering those kinds of questions instead.

  • Getting all values from a queue

    Hi all,
    I have a queue as follows:
    [123] - intital Context
    [sollinger Str]
    [123] - CC
    [Solinger Str]
    [123] - Final context
    An image of the queue looks as follows:
    [http://i42.tinypic.com/hsj052.jpg]
    Iam getting this queue in a userdefined function. I want to get or copy all the values from this queue to a new array as follows without any contexts.
    That is, I want to have a queue as follows from the above queue.
    [123]
    [sollinger Str]
    [123]
    [Solinger Str]
    [123]
    How could that be done...
    Thanks
    P

    Hi guys...thanks 1 more thing
    If My inbound queue "a" is as follows:
    SUPRESS
    AP
    YG
    LF
    contextChange
    YG
    LF
    Final Context
    In my Queue "b" which is as follows
    SUPRESS
    123
    sollinger...
    123
    Sollinger...
    123
    FinalContext
    My requirement is in my "b" queue , I want to put a CC as follows by using a  standard node function if possible
    SUPRESS
    123
    sollinger...
    123
    contextChange
    Sollinger...
    123
    FinalContext
    IF THAT dont work Inside my UDF I want to put thE CC for the b queue.
    How will the loop behave then?
    What will be passed to my input queue "a" and "b" when execute "all values on context" is set.
    "a" has a context and "b" doent have one.
    My UDF
    public static void Test(String[] a,
                                           String[] b,
                                           ResultList result,
                                           Container container){
    //Contains no context change
        String b[] = {ResultList.SUPPRESS,"12","sollinger","12","sollinger","12",
                      ResultList.CC};
    I make the following steps
    copy to an arraylist. add a context change in between.
    copy back to string b.

  • Getting unique values from a list using XSL

    I have a requirement to dynamically generate a unique list of categories that will be used to populate a drop-down box.
    The XML that is being sent is in a format similar to this...
    <item>
    <title>random text1</title>
    <category>research</category>
    <category>marketing</category>
    <category>industry</category>
    </item>
    <item>
    <title>random text2</title>
    <category>research</category>
    <category>development</category>
    </item>
    <item>
    <title>random text3</title>
    <category>marketing</category>
    <category>fishing</category>
    <category>hunting</category>
    <category>development</category>
    </item>
    What i need is to be able to generate a list of all the unique "category" items, without having any duplicates.... eg in the example above, the list would be "marketing, fishing, hunting, research, development, industry"
    I've been using the following xsl, which works, but only when there is a single <category> in each <item> node, but i cant work out how to extend this to look at ALL the categories in the <item>. When i add additional <category> nodes, the xsl stops processing them. There was a lot of trial and error to get this far, but really struggling to get any further.
    <xsl:param name="cat">all</xsl:param>
    <xsl:key name="uniqueCategoryKey" match="item" use="./category"/>
    <select name="cat">
    <option value="all">all</option>
         <xsl:for-each select="//item[generate-id() = generate-id(key('uniqueCategoryKey', ./category))]">
              <xsl:choose>
                   <xsl:when test="$cat = category">
                        <option selected="{category}"><xsl:value-of select="category"/></option>
                   </xsl:when>
                   <xsl:otherwise>
                        <option value="{category}"><xsl:value-of select="category"/></option>
                   </xsl:otherwise>
              </xsl:choose>
         </xsl:for-each>
    </select>
    Any help appreciated on how to proceed
    Thanks

    Try changing these two lines:
    <xsl:key name="uniqueCategoryKey" match="/" use="/item/category"/>
    <xsl:for-each select="//[generate-id() = generate-id(key('uniqueCategoryKey', /item/category))]">And go back and read the article which you got the <xsl:key> idea from. It should explain why it did things that way. Understand that explanation and you should be able to modify the code to do what you like.

  • Get all values from request.getParameter

    In ASP, I can do something like that...
    For each item in Request.Form
    Response.write "Name is:" & item & " value is:" & Request(item)
    Next
    How about in JSP? How do i get the names and values of the form using a loop?

    You can use request.getParameterNames() which will return an enumeration, then you can iterate through the enumeration and use request.getParameterValue(String paramName) method to get the values.

  • How to get the value from a function using a select statement

    I have a function(user defined not built in) that returns multiple values(like an array). My question is how do i get those values in a select statement. when i tried to retrieve it,
    select pack.my_members from dual;
    i am getting an error
    ORA-00902: invalid datatype
    I am sure this must be a syntax error with the select statement
    The following is the function that give the array of data
    package pack
    package spec
    Type my_table is table of varchar2(25);
    function the_members
    return pack.my_table;
    pakcage body
    function the_members return pack.my_table
    Remarks: This function returns a table containing names of the
    members
    is
    tm pack.my_table:= pack.my_table('first member','second member','third member','fourth member');
    begin
    return tm;
    end the_members;

    Check this example on Pipelinedfunction

  • Not getting previous value of List in itemUpdated event receiver

     I have scenario that if i update any item in a listA(in sitecollection1) it should update in another listB(sitecollection2)..
    I am using beforeproperties it is throwing null value..
     but i need that previous value of listA which i have updated just now in "itemupdated" event receiver
    here is my code
     public override void ItemUpdated(SPItemEventProperties properties)
                base.ItemUpdated(properties);
                using (SPWeb web = new SPSite("http://natex2:1990/sites/ess/facilities/spaces").OpenWeb())
                    web.AllowUnsafeUpdates = true;
                    SPList list = web.Lists.TryGetList("LocationDetails");
                     //string querry = properties.ListItem["Title"].ToString();
                     string querry = properties.BeforeProperties["Title"].ToString();
                    SPQuery qury = new SPQuery();
                    qury.Query = "<Where><Eq>" +
                        "<FieldRef Name='Title' />" +
                       "<Value Type='Text'>" + querry + "</Value>" +
                      "</Eq>" +
                      "</Where>";
                    SPListItemCollection coll = list.GetItems(qury);
                    foreach (SPListItem item in coll)
                        string data = properties.AfterProperties["Title"].ToString();
                        item["Title"] = data;
                        list.Update();
                    web.AllowUnsafeUpdates = false;
    please anybody help me i need urgent help

    Are you working with a list or a library? In a list, you will need to handle the synchronous (ItemUpdating) event instead of the asynchronous (ItemUpdated) event in order to access the original value...but there's a catch!
    As per the table in
    this post, the BeforeProperties hashtable is not populated for list items. You can, however, access the original value using
    properties.ListItem (the line you have commented out above) in the
    ItemUpdating event.
    Confusing, I know...but hopefully that helps!
    Danny Jessee
    MCPD - SharePoint Developer 2010
    MCTS - SharePoint 2010, Configuring
    dannyjessee.com/blog

  • Get all values from multi select in a servlet

    Hello,
    I have a multi <select> element in a HTML form and I need to retrieve the values of ALL selected options of this <select> element in a servlet.
    HTML code snippet
    <select name="elName" id="elName" multiple="multiple">
    Servlet code snippet
    response.setContentType("text/html");
    PrintWriter out = null;
    out = response.getWriter();
    String output = "";
    String[] str = request.getParameterValues("elName");
    for(String s : str) {
    output += s + ":";
    output = output.substring(0, output.length()-1); // cut off last deliminator
    out.println(output);But even when selecting multiple options, the returned text only ever contains the value of the first selected option in the <select>
    What am I doing wrong? I'm fairly new to servlets
    Edited by: Irish_Fred on Feb 4, 2010 12:43 PM
    Edited by: Irish_Fred on Feb 4, 2010 12:44 PM
    Edited by: Irish_Fred on Feb 4, 2010 2:14 PM
    Edited by: Irish_Fred on Feb 4, 2010 2:26 PM
    Edited by: Irish_Fred on Feb 4, 2010 2:26 PM
    Edited by: Irish_Fred on Feb 4, 2010 2:32 PM

    I am using AJAX.
    I will show you how I'm submitting the <select> values by showing you the flow of code:
    This is the HTML code for the <select> tag and the button that sends the form data:
    <form name="formMain" id="formMain" method="POST">
         <input type="button" id="addOpts" name="addOpts" value="Add Options" style="width:auto; visibility:hidden" onClick="jsObj.addOptions('servletName', document.getElementById('elName'))">
         <br>
         <select name="elName" id="elName" multiple="multiple" size="1" onChange="jsObj.checkSelected()">
              <option value="0"> - - - - - - - - - - - - - - - - </option>
         </select>
    </form>Note that the "visibility:hidden" part of the button style is set to "visible" when at least one option is selected
    Note that "jsObj" relates to a java script object that has been created when the web app starts ( The .js file is included in the .jsp <head> tag )
    The following code is taken from the file: "jsObj.js"
    jsObj = new jsObj();
    function jsObj() {
    //=================================================
         this.addOptions = function(url, elName) {
              var theForm = document.getElementById('formMain');          
              if (window.XMLHttpRequest) { // code for IE7+, Firefox, Chrome, Opera, Safari
                   xmlhttp=new XMLHttpRequest();
              } else { // code for IE6, IE5
                   xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
              url += this.buildQueryString(theForm.name);
              xmlhttp.open("POST",url,true);
              xmlhttp.send(null);
              xmlhttp.onreadystatechange=function() {
                   if(xmlhttp.readyState==4) { // 4 = The request is complete
                        alert(xmlhttp.responseText);
    //=================================================
    this.buildQueryString = function(formName) {
              var theForm = document.forms[formName];
              var qs = '';
              for (var i=0; i<theForm.elements.length; i++) {
                   if (theForm.elements.name!='') {
                        qs+=(qs=='')? '?' : '&';
                        qs+=theForm.elements[i].name+'='+escape(theForm.elements[i].value);
              return qs;
         //=================================================
    }And this is a code snippet from the "servletName" servlet:public synchronized void doGet(HttpServletRequest request,
              HttpServletResponse response) throws ServletException,IOException {
              PrintWriter out = null;
              try {
                   response.setContentType("text/html");
                   out = response.getWriter();
                   String output = "";
                   String[] values = request.getParameterValues("elName");
                   for(String s : values) {
                        output += s + ":";
                   output = output.substring(0, output.length()-1); // cut off last delimitor
                   out.println(output);
                   } catch (Exception e) {
         }So anyway, everthing compiles / works, except for the fact that I'm only getting back the first selected <option> in the 'elName' <select> tag whenever I select multiple options
    Edited by: Irish_Fred on Feb 7, 2010 10:53 AM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • How to get multiple values from the db using select

    hi all,
    i am using oracle 9i database
    i created a procedure
    create or replace procedure sample_proce
    as
    to_i varchar2(50)
    begin
    select to_id into to_i from sample where flag in('y');
    dbms_output.put_line('hai'|| to_i);
    end;
    when i executed this procedure the following error occurred.
    error at line 5 fetching too many rows.
    but when i execute the select query alone i can able to view all the rows.
    how to resolve it

    i used the following procedure
    create or replace procedure sample_proc
    as
    begin
    for s in(select to_id from sample where flag='y')
    loop
    dbms_output.put_line(s.to_id);
    end loop.
    end;
    it is executed fine. i can able to fetch all the rows.
    how to pass all these values into the another procedure.
    we usually pass only one value into another procedure, i do no how to pass all the values . please help me.
    Thank u.

  • How to get the values of an Array using JSP Tags

    Hey guys,
    I need some help. I've splited a String using
    fn:split(String, delim) where String = "1,2,3,4" and delim is ,
    This method returns an Array of splited Strings. how do i get the values from this array using jsp tags. I don't wanna put java code to achive that.
    Any help would be highly appreciated
    Thanks

    The JSTL forEach tag.
    In fact if all you want to do is iterate over the comma separated list, the forEach tag supports that without having to use the split function.
    <c:set var="list" value="1,2,3,4"/>
    <c:forEach var="num" items="${list}">
      <c:out value="${num}"/>
    </c:forEach>The c:forTokens method will let you do this with delimiters other than a comma, but the forEach tag works well just with the comma-delimited string.

  • How to get selected value from selectOneRadio ???

    Hi...i want to how to get selected value from selectOneRadio and use it in another page and in backing bean.
    Note i have about 10 selectOneRadio group in one page i want to know value of each one of them.
    Plzzzzzzzz i need help

    You have a datatable in which each row is a question, correct?
    Also in each row you have 5 possible answers that are in a radio, correct?
    So,
    You need to put in your datatable model, a question, and a list of answers (5 in yor case) and the selected one.
    So you will have a get to the question, an SelectItem[] list to populate the radios and another get/set to the selected question.
    ex:
    <h:selectOneRadio value="#{notas.selectedString}" id="rb">
    <f:selectItem itemValue="#{notas.valuesList}"/>
    </h:selectOneRadio>
    Search the web for examples like yours.

  • From two given tables, how do you fetch the values from two columns using values from one column(get values from col.A if col.A is not null and get values from col.B if col.A is null)?

    From two given tables, how do you fetch the values from two columns using values from one column(get values from col.A if col.A is not null and get values from col.B if col.A is null)?

    Hi,
    Use NVL or COALESCE:
    NVL (col_a, col_b)
    Returns col_a if col_a is not NULL; otherwise, it returns col_b.
    Col_a and col_b must have similar (if not identical) datatypes; for example, if col_a is a DATE, then col_b can be another DATE or it can be a TIMESTAMP, but it can't be a VARCHAR2.
    For more about NVL and COALESCE, see the SQL Language manual: http://docs.oracle.com/cd/E11882_01/server.112/e26088/functions119.htm#sthref1310
    I hope this answers your question.
    If not, post a little sample data (CREATE TABLE and INSERT statements, relevant columns only) for all tables involved, and also post the results you want from that data.
    Explain, using specific examples, how you get those results from that data.
    Always say which version of Oracle you're using (e.g., 11.2.0.2.0).
    See the forum FAQ: https://forums.oracle.com/message/9362002

  • How to use a regural expression to get all digit from a string.

    Hi All,
    Do you know how to use regural expression to get all digits from the following string via ABAP program?
    "'Log Attributes                 0 (  0 )     (   10 % Available  )"
    Thanks,
    Andrew

    Hi,
    Try the code mentioned below:
      DATA: STR_LEN  LIKE SY-FDPOS,
            RSTR_LEN LIKE SY-FDPOS,
            OFF      LIKE SY-FDPOS.
      DATA: IDX      LIKE SY-FDPOS,        "mn B20K054003
            CL       LIKE SY-FDPOS.        "mn B20K054003
      DATA: RSTRING(40).
      DATA: STRING(40).   " value 'A,N,I,L'.
      FIELD-SYMBOLS: <NLS_CHAR>.           "mn B20K054003
    MOVE I_REGUH-ZNME1 TO STRING.
      MOVE SPACE TO RSTRING.
      STR_LEN = STRLEN( STRING ).
      DESCRIBE FIELD RSTRING LENGTH RSTR_LEN.
      IF RSTR_LEN < STR_LEN. RAISE TOO_SMALL. ENDIF.
      WHILE IDX < STR_LEN.                 "mn B20K054003
        ASSIGN STRING+IDX(*) TO <NLS_CHAR>.   "mn B20K054003
        IF SY-LANGU EQ '2'.                "mn B20K054003
          CALL FUNCTION 'NLS_THAI_CHARLEN' "mn B20K054003
               EXPORTING                   "mn B20K054003
                    THAI_STRING  = <NLS_CHAR>       "mn B20K054003
               CHANGING                    "mn B20K054003
                    THAI_CHARLEN = CL.     "mn B20K054003
        ELSE.                              "mn B20K054003
          CL = CHARLEN( <NLS_CHAR> ).      "mn B20K054003
        ENDIF.                             "mn B20K054003
        IF IDX NE 0.                       "mn B20K054003
          SHIFT RSTRING RIGHT BY CL PLACES."mn B20K054003
        ENDIF.                             "mn B20K054003
        RSTRING+0(CL) = STRING+IDX(CL).    "mn B20K054003
        IDX = IDX + CL.                    "mn B20K054003
      ENDWHILE.                            "mn B20K054003
    Regds,
    Anil
    Edited by: Matt on Jul 1, 2009 9:36 AM -added code tags

Maybe you are looking for

  • Are clusters or individual elements better for shared variables?

    So...  I have some RT code that is being updated, and pulled out of the Stone Ages of LabVIEW.  It was originally written for an old FieldPoint controller operating in "headless" mode, and used the "publish" and datasocket methods for communications

  • Is it possible to upgrade G62-361TX Notebook Processor and RAM?

    Hi Everyone, I have a question regarding UPGRADE! I am having G62-361TX model notebook, Processor of Core i3-370M, 3GB RAM (1 X 1GB & 2 X 2GB), 1GB ATI Mobility Rageon Premium Graphics Card, Windows 7 x64. 1. Is is possible to upgrade from Core i3-37

  • I want to upgrade my hard-drive in  2010 model MacBook Pro 13

    I would like to increase the hard drive size on my 13" Macbook Pro from 250 GB to 500 or 750 GB. Amazon carries the WD5000BEVT and the WD7500BPVT drives. Reading various comments about them, I'm concerned about how quiet and efficient they are in a M

  • Getting remote file using FTP Server Issue in OSB

    Hi Guys, I have configured a FTP server on my local system and I created a proxy service to get file from ftp location to some other location but it fails . I used ftp protocol for getting file and my ftp location is D:\host\ftp and it has another fo

  • Unable to find the LifecycleManager MBean error

    Hi, I need to export a skin associated with a webcenter portal application. However, when I execute the exportWebCenterResource(appName, fileName, resourceType, resourceGUID, [spaceName,  server, applicationVersion]) command from WLST, I get the erro