Handling list items.

Hi Masters
I have a requirement where in there will be two list items. The first and second list items default value has to be taken from the database for the record.
I have acheived this in post-query trigger. like take the values for the list tiems form the database and set them as default values. this is done programatically. The user has to be able to select a different value from the first list. Then a correspoding list fo values for the second list has to be retrieved from the database. after selecting the required changes the user will have to be able to submit the form where the changes get recorded in the database.
how ever i am facing the problem, as i am doing this work in post-query trigger . what ever the value i select it is not changing.
the code in the post_query looks like
if populate_group(grp_id) = 0 then
populate_list('datablock.list_item1',grp_id);
select rec_id into v_rec_id from my_table where primary_key = 1;
:datablock.list_item1 := v_rec_id ;
else
message('error ');
end if;
can you suggest a better way to implement the requirement.
Thank you very much for the answers.

Say you have created procedure to populate list 2
PROCEDURE populate_list2 IS
group_query varchar2(1000);
group_id RECORDGROUP ;
errorcode Number;
begin
group_id := Find_Group('MY_GROUP1');
if not id_null(group_id) then
delete_group('my_group1');
end if;
-- Here I'm assuming that datablock.list_item1 is varchar. You can make changes according to your datatype
group_query := 'SELECT a, b FROM test where b = '''||:datablock.list_item1||'''';
group_id := create_group_from_query('MY_GROUP1',group_query);
errorcode := populate_group(group_id);
if errorcode = 0 then
populate_list('datablock.list_item2',group_id);
else
message('Error populating group '||errorcode);
end if;
end;
Now in Post-Query you have following code :
-- Code to populate first list item
if populate_group(grp_id) = 0 then
populate_list('datablock.list_item1',grp_id);
select rec_id into v_rec_id from my_table where primary_key = 1;
:datablock.list_item1 := v_rec_id ;
else
message('error ');
end if;
-- Code to populate second list item
If :datablock.list_item1 Is Not Null
Populate_list2;
End If;
This way your second list will be populated.
Now in the When-List-Changed trigger of datablock.list_item write
--Code to populate second list item
Populate_list2.
This will re-populate the list2 when you change the selection in List1.
Hope this helps.

Similar Messages

  • Please tell me how to handle list item in this concern

    please tell me how to handle list item in this concern
    My problem is:
    i have a category table with column categoryname(varchar type)
    I want to display the records of categoryname in a drop down list (i.e., list item )
    So ..please tell me how to do it
    Thanks in advance..

    This code is just a sample from the Help documentation. It won't work until you modify it for your form.
    Why do you have "steps" in your code? You are suppose to do what the steps tell you. You don't place the steps in your code. The steps must be removed from your code.
    Step 1 code goes in a program unit, not in a trigger.
    Step 2 and 3 code usually goes in a trigger.
    You will have to replace the names of the items and record group with your own names as you have defined them in your form.
    step 1: create a procedure in your application
    procedure load_list(itm in VARCHAR2, rg in VARCHAR2) is
    group_id RecordGroup := Find_Group(rg);
    list_id Item := Find_Item(itm);
    Begin
    if Populate_Group(group_id)<>0 then
    Message('Unable to populate record group');
    Raise Form_Trigger_Failure;
    end if;
    Clear_List(list_id);
    Populate_list(list_id, group_id);
    end;
    step 2: create a record group named rg_cat and assign Record Group Query to something like "select categoryname from category"
    step 3: call this procedure as
    load_list('categoryname','rg_cat');

  • Setting Item level access rights on sharepoint list item in ItemAdding event handler

    Hi ,
    I am using sharepoint 2013. I am trying to set item level access rights when a list item is added using the following code snippet,
    public override void ItemAdding(SPItemEventProperties properties)
    base.ItemAdding(properties);
    ConfigureItemSecurity(properties);
    private void ConfigureItemSecurity(SPItemEventProperties properties)
    var item=properties.ListItem;
    SPSecurity.RunWithElevatedPrivileges(delegate()
    using (SPSite site = new SPSite(properties.SiteId))
    using (SPWeb oWeb = site.OpenWeb())
    item.ParentList.BreakRoleInheritance(true);
    oWeb.AllowUnsafeUpdates = true;
    var guestRole = oWeb.RoleDefinitions.GetByType(SPRoleType.Reader);
    var editRole = oWeb.RoleDefinitions.GetByType(SPRoleType.Editor);
    SPGroup HRGroup = oWeb.SiteGroups.Cast<SPGroup>().AsQueryable().FirstOrDefault(g => g.LoginName=="HR Team");
    SPRoleAssignment groupRoleAssignment = new SPRoleAssignment(HRGroup);
    groupRoleAssignment.RoleDefinitionBindings.Add(guestRole);
    SPUserCollection users = oWeb.Users;
    SPFieldUserValueCollection hm = (SPFieldUserValueCollection)item["HiringManager"];
    SPFieldUserValueCollection pm = (SPFieldUserValueCollection)item["ProjectManager"];
    SPFieldUserValueCollection pmChiefs = (SPFieldUserValueCollection)item["ProjectManagerChief"];
    item.BreakRoleInheritance(true);
    item.RoleAssignments.Add(groupRoleAssignment);
    foreach (SPFieldUserValue staffMember in hm)
    SetRightsOnItem(item, staffMember, editRole);
    foreach (SPFieldUserValue staffMember in pm)
    SetRightsOnItem(item, staffMember, guestRole);
    foreach (SPFieldUserValue staffMember in pmChiefs)
    SetRightsOnItem(item, staffMember, guestRole);
    item.Update();
    private void SetRightsOnItem(SPListItem item, SPFieldUserValue staffMember, SPRoleDefinition role)
    SPUser employeeUser = staffMember.User;
    var userRoleAssignment = new SPRoleAssignment(employeeUser);
    userRoleAssignment.RoleDefinitionBindings.Add(role);
    item.RoleAssignments.Add(userRoleAssignment);
    Nothing is happening though... Is the event handler the right place to do this?
    thank you

    Hi ,
    You can refer to the code working in my environment:
    using System;
    using System.Security.Permissions;
    using Microsoft.SharePoint;
    using Microsoft.SharePoint.Utilities;
    using Microsoft.SharePoint.Workflow;
    namespace ItemLevelSecurity.ItemSecurity
    /// <summary>
    /// List Item Events
    /// </summary>
    public class ItemSecurity : SPItemEventReceiver
    /// <summary>
    /// An item was added.
    /// </summary>
    public override void ItemAdded(SPItemEventProperties properties)
    SPSecurity.RunWithElevatedPrivileges(delegate()
    try
    using (SPSite oSPSite = new SPSite(properties.SiteId))
    using (SPWeb oSPWeb = oSPSite.OpenWeb(properties.RelativeWebUrl))
    //get the list item that was created
    SPListItem item = oSPWeb.Lists[properties.ListId].GetItemById(properties.ListItem.ID);
    //get the author user who created the item
    SPFieldUserValue valAuthor = new SPFieldUserValue(properties.Web, item["Created By"].ToString());
    SPUser oAuthor = valAuthor.User;
    //assign read permission to item author
    AssignPermissionsToItem(item,oAuthor,SPRoleType.Reader);
    //update the item
    item.Update();
    base.ItemAdded(properties);
    catch (Exception ex)
    properties.ErrorMessage = ex.Message; properties.Status = SPEventReceiverStatus.CancelWithError;
    properties.Cancel = true;
    public static void AssignPermissionsToItem(SPListItem item, SPPrincipal obj, SPRoleType roleType)
    if (!item.HasUniqueRoleAssignments)
    item.BreakRoleInheritance(false, true);
    SPRoleAssignment roleAssignment = new SPRoleAssignment(obj);
    SPRoleDefinition roleDefinition = item.Web.RoleDefinitions.GetByType(roleType);
    roleAssignment.RoleDefinitionBindings.Add(roleDefinition);
    item.RoleAssignments.Add(roleAssignment);
    Thanks,
    Eric
    Forum Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
    [email protected].
    Eric Tao
    TechNet Community Support

  • How do we handle a item in both as a select list & text

    Hi All,
    In my application, i have used Create button..when ever a create button is clicked a "Select List" will apper..
    Similarly i have also a "Edit" icon when ever a icon is clicked it will also the same "select list item"...
    Now the end user is asking to make the select list item as redaonly when we clik on Edit icon...
    How to handle this scenerio..
    The way i have done is as of now is that i have created two items with the same name one is for select list &
    the other is for the text item using conditional i have managed..
    But i would like to know is there any other way with out creating any extra item & by using only the select lits item can we achieve it or not.
    Thanks,
    Anoo..

    Hi Anoo,
    You mentioned in your original post that you have a select list item and a text item, and that you're using a condition to determine which one to show. For the Read Only condition for a single select list item, you would specify the condition you currently have that is telling ApEx to show the text item rather than the select list.
    The idea here is that if the Read Only condition evaluates to TRUE (currently in edit mode), then the select list item will render as read-only; if it evaluates to FALSE (currently in create mode), it will render as a normal select list.
    Hope this helps,
    John
    If you find this information useful, please remember to mark the post "helpful" or "correct" so that others may benefit as well.

  • Create New List Item

    I am getting an error each time I try to run this code and get the error message "There was a problem submitting your answers. Please try again later."I have looked at this for so long now I am not sure if I am missing something or what. I have referenced SPServices and jquery and it is working correctlyI am trying to make a crossword using some code I found online and I followed it andstill get this error. // Create an object to associate each SharePoint column with the class name used for the input and the user's response for that column
    var responses = {
    "oneAcross": {
    "selector": "one-across",
    "column": "OneAcross",
    "answer": ""
    "oneDown": {
    "selector": "one-down",
    "column": "OneDown",
    "answer": ""
    "twoDown": {
    "selector": "two-down",
    "column": "TwoDown",
    "answer": ""
    "threeDown": {
    "selector": "three-down",
    "column": "ThreeDown",
    "answer": ""
    "fourAcross": {
    "selector": "four-across",
    "column": "FourAcross",
    "answer": ""
    // Create the batchCmd variable that will be used to create the new list item
    var batchCmd = '<Batch OnError="Continue"><Method ID="1" Cmd="New">';
    // Concatenate values of each response input by iterating over the object representing the responses
    $.each( responses, function() {
    // Cache the current item in the responses object.
    var $response = this;
    // For each input in the crossword associated with the current response object, get the values and save them in the answer property.
    $( '.' + $response.selector ).each( function() {
    $response.answer += $( this ).val().toLowerCase();
    // Add the response to the batchCmd
    batchCmd += '<Field Name="' + $response.column + '"><![CDATA[' + $response.answer + ']]></Field>';//Create a new list item on the destination list using the batchCmd variable
    $().SPServices({
    operation: "UpdateListItems",
    async: true,
    webURL: "http://operations.home.blah.com/sites/EIS/SEEIS/SSC/Lists/",
    listName: "Crossword",
    updates: batchCmd,
    completefunc: function( xData, Status ) {
    // If the AJAX call could not be completed, alert the user or include your own code to handle errors.
    if ( Status !== "success" ) {
    alert( "There was a problem submitting your answers. Please try again later." );
    else {
    // If there was an error creating the list item, alert the user or include your own code to handle errors.
    if ( $( xData.responseXML ).find( 'ErrorCode' ).text() !== "0x00000000" ) {
    alert( "There was a problem submitting your answers. Please try again later." );
    // if the list item was successfully created, alert the user and navigate to the Source parameter in the URL (or to a URL of your choosing).
    else {
    alert( "Your answers were submitted successfully! Click OK to continue." );
    if ( window.location.href.indexOf( "Source=" ) !== -1 ) {
    var url = window.location.href.split( "Source=" )[1].split( "&" )[0];
    window.location.href = url;
    else {
    window.location.href = "/";

    When I look at the demo on the page it fires the same response as that is part of the error handling because it is a standalone HTML and not on a sharepoint server so I am wondering if something I am missing on the submit.click function or batchcmd. 
    I included the entire code for it to see if maybe you can see something I am not.  My crossword is on a Sharepoint Server
    $( '#crossword-submit' ).click( function( event ) {
    // If you decide to use a hyperlink instead of a button input, this will prevent
    //the hyperlink from actually navigating away from the page or to an anchor.
    event.preventDefault();
    // Disable the button so the user can't click it again and submit the answers more than once.
    $( this ).prop( 'disabled', true );
    // Prevent submission if the crossword isn't completed.
    if ( $( '#crossword' ).find( 'input' ).filter( function() { return $( this ).val() === ""; }).length !== 0 ) {
    alert( "You have left some answers blank. Please complete all answers before submitting." );
    $( this ).removeProp( 'disabled' );
    return false;
    // Confirm that the user wants to submit their answers.
    var confirmResponse = confirm( "Are you sure you are ready to submit your answers? Once submitted they cannot be changed.\n\nClick OK to continue or Cancel to review your answers." );
    if ( confirmResponse === false ) {
    $( this ).removeProp( 'disabled' );
    return false;
    // Create an object to associate each SharePoint column with the class name used for the input and the user's response for that column
    var responses = {
    "oneAcross": {
    "selector": "one-across",
    "column": "OneAcross",
    "answer": ""
    "oneDown": {
    "selector": "one-down",
    "column": "OneDown",
    "answer": ""
    "twoDown": {
    "selector": "two-down",
    "column": "TwoDown",
    "answer": ""
    "threeDown": {
    "selector": "three-down",
    "column": "ThreeDown",
    "answer": ""
    "fiveDown": {
    "selector": "five-down",
    "column": "FiveDown",
    "answer": ""
    "sixDown": {
    "selector": "six-down",
    "column": "SixDown",
    "answer": ""
    "sevenDown": {
    "selector": "seven-down",
    "column": "SevenDown",
    "answer": ""
    "eightDown": {
    "selector": "eight-down",
    "column": "EightDown",
    "answer": ""
    "fourAcross": {
    "selector": "four-across",
    "column": "FourAcross",
    "answer": ""
    "nineAcross": {
    "selector": "nine-across",
    "column": "NineAcross",
    "answer": ""
    "tenAcross": {
    "selector": "ten-across",
    "column": "TenAcross",
    "answer": ""
    "elevenAcross": {
    "selector": "eleven-across",
    "column": "ElevenAcross",
    "answer": ""
    "twelveAcross": {
    "selector": "twelve-across",
    "column": "TwelveAcross",
    "answer": ""
    // Create the batchCmd variable that will be used to create the new list item
    var batchCmd = '<Batch OnError="Continue"><Method ID="1" Cmd="New">';
    // Concatenate values of each response input by iterating over the object representing the responses
    $.each( responses, function() {
    // Cache the current item in the responses object.
    var $response = this;
    // For each input in the crossword associated with the current response object
    //, get the values and save them in the answer property.
    $( '.' + $response.selector ).each( function() {
    $response.answer += $( this ).val().toLowerCase();
    // Add the response to the batchCmd
    batchCmd += '<Field Name="' + $response.column + '"><![CDATA[' + $response.answer + ']]></Field>';
    // Close the batchCmd variable
    batchCmd += '</Method></Batch>';
    // Create a new list item on the destination list using the batchCmd variable
    $().SPServices({
    operation: "UpdateListItems",
    async: true,
    webURL: "http://operations.homestead.abc.com/sites/EIS/SEEIS/SSC/Lists/",
    listName: "Crossword",
    updates: batchCmd,
    completefunc: function( xData, Status ) {
    // If the AJAX call could not be completed, alert the user or include your own code to handle errors.
    if ( Status !== "success" ) {
    alert( "There was a problem submitting your answers. Please try again later." );
    else {
    // If there was an error creating the list item, alert the user or include your own code to handle errors.
    if ( $( xData.responseXML ).find( 'ErrorCode' ).text() !== "0x00000000" ) {
    alert( "There was a problem submitting your answers. Please try again later." );
    // if the list item was successfully created, alert the user and navigate
    //to the Source parameter in the URL (or to a URL of your choosing).
    else {
    alert( "Your answers were submitted successfully! Click OK to continue." );
    if ( window.location.href.indexOf( "Source=" ) !== -1 ) {
    var url = window.location.href.split( "Source=" )[1].split( "&" )[0];
    window.location.href = url;
    else {
    window.location.href = "/";
    </script>

  • How to download list item attachment from display.aspx

    Im uploading documents
    to list item in list by
    using file upload control. Now I should download that file. I can able to insert documents into list item in attachment column which is predefined but am how can I download the attachments by clicking on the link in display.aspx.
    I have written this for uploadFile controller.
    SPSite site = SPContext.Current.Site;
    SPWeb web = site.OpenWeb();
    SPList list = web.Lists["list2"];
    //SPListItem itemId = list.GetItemById(5);
    int itemId=3;
    SPListItem newItem = list.GetItemById(itemId);
    byte[] contents = null;
    if (FileUpload1.PostedFile != null && FileUpload1.HasFile)
    using (Stream fileStream = FileUpload1.PostedFile.InputStream)
    contents = new byte[fileStream.Length];
    fileStream.Read(contents, 0, (int)fileStream.Length);
    fileStream.Close();
    SPAttachmentCollection attachments = newItem.Attachments;
    string fileName = Path.GetFileName(FileUpload1.PostedFile.FileName);
    attachments.Add(fileName, contents);
    newItem["CLMSAttachments"] = fileName;
    newItem.Update();
    Thanks in advance.

    Hi ,
    It is your browser that decides to download/open the file.
    If you have compatible client software for the file (word for docx) your computer will by default automatically try to open it.
    But we can force the download. You have to develop a handler/aspx page that will just handle the file download and you have to override the http header "content-disposition" to "attachment;filename=yourfilename"
    Here a sample :
    var fileName = "myfile.sql";
    var r = context.Response;
    r.AddHeader("Content-Disposition", "attachment; filename=" + fileName);
    r.ContentType = "text/plain";
    r.WriteFile(context.Server.MapPath(fileName));
    Hope that will help you
    Moudhafer

  • List item - Population - Based on Data setup

    Dear All,
    I need to populate the list item based on data defined at the database level.
    Tables Used:
    Table 1 : JBCAI_JOB_COM_ADD_INFO
    Column Name     Pk     Null?     Data Type     Default     
    JBEDC_UID          1     N     NUMBER (22)          
    JBCAI_ADD_INFO_CODE     2     N     VARCHAR2 (2 Char)          
    JBCAI_INFO_CODE_SEQUENCE      3     N     NUMBER (3,1)     1     
    JBCAI_ADD_INFO_TEXT     Y     VARCHAR2 (35 Char)          
    SHIPCOMP_CODE     N     VARCHAR2 (4 Char)     
    Table 2 :CODES
    CODE_TYPE CODE_VALUE DESCRIPTION NEXT_VALUE CODE_FLAG
    MCAR 01 Customs References 01 NULL N
    MCAR 02 Customs References 02 NULL N
    MCAR 03 Value of Commodities NULL N
    MCAR 04 Currency of commodities NULL N
    MCAR 05 Purchase Order Number NULL N
    MCAR 06 Other NULL N
    MCAR 07 Consignee Name NULL N
    MCAR 08 VIN NULL N
    FORMS Section
    =========
    JBCAI_ADD_INFO_CODE are the list items which needs to be populated; JBCAI_ADD_INFO_TEXT(free text) which user can enter any descriptions.
    References - Label of the Block
    JBCAI_ADD_INFO_CODE JBCAI_ADD_INFO_TEXT
    Customs References 01 - Free Text()
    Customs References 02 - Free Text()
    Value of Commodities - Free Text()
    Currency of commodities - Free Text()
    Purchase Order Number - Free Text()
    Other - Free Text()
    Consignee Name - Free Text()
    VIN - Free Text()
    VIN - Free Text()
    Business Rules:
    If JBCAI_ADD_INFO_CODE has the flag as 'N' in CODES table then user can select only one time from the list item.
    If JBCAI_ADD_INFO_CODE has the flag as 'Y' in CODES table then user can do multi-selection from the list item e.g; VIN
    How the records are fetched:
    Value for the list item are been populated from CODES table ; which am doing through the below query.
    In WHEN-NEW-FORM-INSTANCE am using the below code:
    PROCEDURE p_fetch_code_value
    IS
              l_query VARCHAR2(200) ;
              l_rg_name VARCHAR2(40) := 'CODES';
              l_errcode NUMBER;
              l_rg RECORDGROUP;
         BEGIN
              l_query := 'SELECT adcod.description description,adcod.code_flag code_flag FROM codes adcod WHERE adcod.code_type = ''MCAR''                    AND adcod.code_value IN (''01''''02'',''03'',''04'',''05'',''06'',''07'',''08'') ORDER BY code_value';
              l_rg := FIND_GROUP( l_rg_name );
              IF ID_NULL(l_rg) THEN
              l_rg := CREATE_GROUP_FROM_QUERY(l_rg_name, l_query);
              END IF;
              l_errcode := POPULATE_GROUP( l_rg );
              POPULATE_LIST('BLK_CONTROL.JBCAI_ADD_INFO_CODE',l_rg);
    EXCEPTION
    Handled WHEN OTHERS exception
    END p_fetch_code_value;
    Saving of Record:
    List value selection are saved to JBCAI_JOB_COM_ADD_INFO.JBCAI_ADD_INFO_CODE column.
    Free Text is saved to JBCAI_JOB_COM_ADD_INFO.JBCAI_ADD_INFO_TEXT column.
    Doubt:
    When i select the first list item value i.e Customs References 01 and then enter some description i.e free text and moved to the next list item; the value Custom reference 01 should not be visible wheras the other values should have to be visible e.g; Customs Reference 02,Value of Commodities.....
    Please help and let me know how can i acccomplish this task?
    Thanks....
    Regards,
    Sunil.G

    Hi Sarah,
    Thanks for your reply.
    There is no issue in the population of the list item; it is working fine with the query which i have pasted.
    My doubt is:
    There are few places where i have set the code_flag as 'Y' / 'N'.
    For the first time when user selects the list item; all the values should be shown.....
    If user has selected the first list item i.e Customs Reference 01 for which the code_flag is 'N' from a multi-record block; then when he moves to the further lines the previous selection for which the flag is set as 'N' should not be shown(if user has already selected once) e.g; 'Customs Reference 01' should not be shown again if user has made the selection before.
    Plz revert incase more explanations required.
    Thanks...
    Regards,
    Sunil.G
    Edited by: Sunil G on Nov 29, 2009 12:16 AM

  • List data validation failed when creating a new list item but does not fail when editing an existing item

    Dear SharePoint Experts,
    Please help.
    Why does my simple formula work in Excel but not-work in SharePoint?
    Why does this formula...
    =IF([Request Type]="Review",(IF(ISBLANK([Request Date]),FALSE,TRUE)),TRUE)
    ...work in Excel but fail when I try to use it in SharePoint?
    The intent of this formula is the following...
    If the field "Request Type" has the value "Review" and the field "Request Data" is blank then show FALSE, otherwise show TRUE.
    SharePoint saves the formula, but when a list item is saved where the formula is implemented, (under List Settings, List Validation), SharePoint does not, say anything other than that the formula failed.
    Note that the "list data validation failed" error only happens when I am creating a new item-- the formula above works just fine when one is trying to Save on the edit form. 
    Can you help?
    Thanks.
    -- Mark Kamoski

    Dear Jason,
    I appreciate your efforts.
    However, it seems to me that this statement of yours is not correct...
    "If it meet the validation formula, then you can new or edit the item, otherwise, it will throw the 'list data validation failed' error, it is by design".
    I believe this is NOT the answer for the following reasons.
    When I create a new item and click Save, the validation error is "list data validation failed".
    When I edit an existing item and click Save, the validation error is "my custom error message" and this is, I believe, the way it needs to work each time.
    I think, at the core, the error my formula does not handle some condition of null or blank or other default value.
    I tried a forumla that casts the date back to a string, and then checked the string for a default value, but that did not work.
    I tried looking up the Correlation ID in the ULS when "list data validation failed" occurs, but that gave no useful information because, even though logging was set to Verbose, the stack trace in the error log was truncated and did not given any
    good details.
    However, it seems to me that SharePoint 2013 is not well-suited for complex validation rules, because...
    SharePoint 2013 list-level validation (NOT column-level validation) allows only 1 input for all the multi-field validation formulas in a given list-- so, if I had more than 1 multi-field validation rule to implement on a given list, it would need to be packed
    into that single-line-of-code forumla style, like Excel does. That is not practice to write, debug, or maintain.
    SharePoint 2013 list-level validation only allows 1 block of text for all such multi-field validation rules. So that will not work because I would have something like "Validation failed for one or more of the following reasons-- withdrawal cannot exceed
    available balance, date-of-birth cannot be after date-of-death,... etc". That will not work for me.
    The real and awesome solution would simply be enhancing SP 2013 so that column-level validation forumlas are able to reference other columns.
    But, for now, my workaround solution is to use JavaScript and jQuery, hook the onclick handler on the Save button, and that works good. The only problem, is that the jQuery validation rules run before any of the column-level rules created  with OOTB
    SP 2013. So, in some cases, there is an extra click for the enduser.
    Thanks,
    Mark Kamoski
    -- Mark Kamoski

  • Display SharePoint:RichTextField value as is from list item into application page

    Hello,
    I would like to show value entered in Rich Text Field in list on one application page.
    I am displaying it like below as I would like to use the default functionality provided by SharePoint and this is an application page replacing the default page for list form.
    <SharePoint:RichTextField ID="RTTaskDescription" runat="server"  FieldName="Task Description" ControlMode="Display"/>
    But when it renders the output as below with DIV and STRONG as description word is bold in list item.
    <DIV>THis is task <STRONG>description</STRONG>.</DIV>
    Any way to handle this to show as it is in list item with proper HTML from server side?

    Hi,
    Did you try this
    http://social.technet.microsoft.com/Forums/sharepoint/en-US/2efb5464-e4d1-4a81-bb96-ebcde5aeffc8/want-to-remove-divdiv-tag-while-displaying-list-columntypemultiline-text?forum=sharepointdevelopmentlegacy

  • Hide blanks in a list item – Tricky Situation!

    Dear All,
    Let me explain the set up first...
    We have a Data Block A based on a join between two tables. In this data block we have a list item Note Type A and a text item Note Text A, both belongs to the secondary table of the join. This data block is the query data block of the form.
    We have another Data Block B which is not the query data block but is in relation (as a child) with the Data Block A. Data Block B also has a list item Note Type B and a text item Note Text B, and these fields too refer to the same columns and table as the ones in Data Block A.
    This arrangement is in place because business requires enabling query on only those note types which are listed in Note Type A. But once the records are fetched one should be able to see the data for Note Type B and Note Text B as well.
    Now the problem is... when doing a query all for the Data Block A, those records which does not have any note type as listed in Note Type A but have note types as listed in Note Type B will not get listed. This is not desirable, so to fetch all records I have included the list item values of Note Type B in Note Type A and for these values list elements are kept blank. Because of these blank elements we now see a blank space in the list box which might cause a disagreement over the solution.
    My question, is there a way we can avoid this blank space to be shown on the list box while keeping other things as they are, OR is there a different solution altogether to handle this whole requirement? Please suggest, and let me know if more details are required.
    Thanks,
    Amit

    Thanks Andreas. I was able to resolve the issue using Populate_List built in.
    However I'm now stuck with a different problem now [t-844659]. Please see if you can help.
    Regards,
    Amit
    [t-844659]

  • How to refresh list item values before report is run?

    We have two SELECT LIST items (drop boxes) on our report. One SELECT LIST has values of "World Region" (e.g. NORTH AMERICA, SOUTH AMERICA, EUROPE, ASIA)
    the other SELECT LIST has values of "Subregion" (e.g. NORTHERN EUROPE, SOUTHERN EUROPE, SOUTHEAST ASIA etc...)
    The values in the Subregion list are dependent on the value that is chosen from the "World Region" List. Can someone tell up how to update the values in the Subregion list BEFORE we submit the page? We can get these values to update (via sql query) when the page is submitted but that is only happening after the report gets run- which is not what we want. We want the user to select a Region from one SELECT LIST and then see all the qualifying Subregions for that Region in the Subregion SELECT LIST. Only after both Region and Subregion have been selected do we want to run the report. Thank for any help on this.

    hey john--
    john) things like Scott's reference to "The name of the LOV Item". What does this really mean?
    raj) in htmldb there's a concept of items at the page and at the app level. page level items have ui component associated with them. in scott's explanation above, he's talking about using a page-level item with a "Display as" type of "select list w/submit" for your first select list. in that case, he's suggesting you have one select list item drive the values of another. when the self-submitting select list submits the page, it sets an htmldb built-in variable called :REQUEST to the name of the self-submitting select list item. in your follow-up post's example, that'd be "REGION_LIST". scott was explaining how you could control the functionality on your page by adding conditions to things like...
    :REQUEST = 'REGION_LIST'
    ...or using declarative Condition options like "Request = Expression 1" and then putting the string "REGION_LIST" in that Expression1 field. so in your case, you have a report region that you don't want displayed until the user's done selecting from your Subregion list. an easy way to handle that would be to add a hidden item (where "Display as" is set to "Hidden") to your page, for example :P1_LAST_REQUEST, to store the last value of :REQUEST. put a Computation on your page that populates :P1_LAST_REQUEST with :REQUEST each time the page is submitted. then put a Condition on your report region that makes it only render when :P1_LAST_REQUEST != 'REGION_LIST'. so this way your users can select a Region and have the page submit itself. the page will then redraw with the values of subregion list correctly populated (you'd presumably use :REGION_LIST in your subregion LOV query to achieve the filtered values) w/o your report region displayed. the user would then select a correct subregion and click some sort of "run my report" button. this time when the page redraws, :P1_LAST_REQUEST would be set so something other than "REGION_LIST" (it'd be set to whatever you named your "run my report button") and so your report region would display as desired.
    hope this helps,
    raj

  • Handling list box in alv

    hai all
    please check the code and tell how i can call in both open and close sales orders
    NAME = 'CATEGORY'.
      VALUE-KEY = 'OPEN'.
      VALUE-TEXT = 'OPEN'.
      APPEND VALUE TO LIST.
      VALUE-KEY = 'CLOSE'.
      VALUE-TEXT = 'CLOSE'.
      APPEND VALUE TO LIST.
      CALL FUNCTION 'VRM_SET_VALUES'
        EXPORTING
          ID     = NAME
          VALUES = LIST.

    Reported to SCN Moderators for multiple postings:
    handling list box in alv
    The specified item was not found.
    pk

  • Multiple SharePoint 2010 list items edited simultaneously in InfoPath 2010?

    I am looking to distribute a list of accounts to salespeople, so they can update some of the fields for their own accounts and save the changes back to SharePoint. We are currently sending them Excel workbooks, but this isn't ideal.  Since the requirements
    include drop-down choices, conditional formatting, and data validation, I'm wondering if InfoPath can be utilized so that a salesperson can filter the list by their name and see (only) all of their own accounts (records/rows/list items) at once in InfoPath,
    then make multiple changes to different fields (columns) for their accounts, and finally submit the form--saving multiple edited records simultaneously.  Think Datasheet View, but with conditional formatting and data validation. Is this
    possible in any application?

    Hi ired25,
    Few point to mention here.
    InfoPath form will be linked with each SharePoint List item
    user can change/update their own record using Datasheet view(validation will be applied for sure if it configured as formula)
    you can think to use edit form InfoPath form to leverage infopath's powerful rule engine, which might delayed user's productivity but very safe for data.
    I dont think a InfoPath for can handle multiple item in one single form.
    For permission you can think of "Item level permission" from list settings => Advance settings
    As a thought "Content approval" can be used for data sanity.
    Hope this will help
    Please 'propose as answer' if it helped you, also 'vote helpful' if you like this reply.

  • Handling dynamic item data in VSTS

    Hi Team,
    Can you please let us know how to handle dynamic item data in VSTS.
    Regards
    Raghavendra
    8105577088

    Hi Raghavendra,
    Based on your previous threads posted by you in the test forum, I doubt that you want to create the coded UI test, am I right?
    If so, which kind of app did you want to test, WPF or others? Could you share us a screen shot about the real UI controls you want to test? What real Controls you want to test, list item controls or others?
    You know that to find a control in coded UI test, we have to use the unique peoperties as the search properties, so if your controls are dynamic, the real issue would be related to the search properties you use in your code.
    Like this case:
    https://social.msdn.microsoft.com/Forums/en-US/4c4805f0-230d-459d-a3e5-61e62746c5b9/list-box-item-is-not-get-selected-while-play-back-the-recorded-script-in-coded-ui-test?forum=vsautotest
    As Pankaj's suggestion, if the list items are dynamic then you can use the index values instead of the innertext, so the real issue would be related to how to use the search perperties in your side. If you item text value is dynamic, you'd better not
    use the text value as the search properties. 
    About "How does “Coded UI test” finds a control ??", reference:
    http://blogs.msdn.com/b/balagans/archive/2009/12/28/9941582.aspx
    If I have misunderstood this issue, please feel free to let me know.
    Best Regards,
    Jack
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • How to display the Attachment(picture) on the list item page?

    I have attached a picture to the list item and then when I click the item, there is a link of the attachment but not the picture graphics! I want to display the picture on the list item page and how to do it?
    I am a beginner of SharePoint 2010 and my English is not very good! Thanks!

    Hi,
    Using few easy steps you can set image in your out of the box List View, Edit and View Item Page.
    1. Create one Picture type Column in your list.
    2. Just create one Event Handler with Item
    /// <summary>
    /// An attachment was added to the item.
    /// </summary>
    public override void ItemAttachmentAdded(SPItemEventProperties properties)
    base.ItemAttachmentAdded(properties);
    SPListItem item = properties.ListItem;
    //SPAttachmentCollection attach = item.Attachments;
    string attachmentUrl = item.Attachments.UrlPrefix + item.Attachments[0];
    item["PictureColumnName"] = attachmentUrl;
    item.Update();
    Now, just add item with attachment and you will see attached image in Picture Column field.
    Manoj | SharePoint

Maybe you are looking for