Determining the data type of the list item

Hi experts,
i have a dpop down list item in my form and from it i want
to select some of the columns of emp table like mobile_number or address
and send the selected field,along with name and empno to reports.
But when i am trying to determine the data type of the selected
item i am faceing some difficulties.
i am trying this
param := emp.:emp.LIST10%type;
can you please help me.
Regards
rajat

param := emp.:emp.LIST10%type;I'm not quit sure what you are trying to achieve with this.
If have build a poplist as a block-item you know the datatype of that item. When you know want to create a local variable to take the value from that list, either define it just with the datatype taken from the item, or take it dynamically from the column from the database the item is based on, so
DECLARE
  -- explicit
  vcParam  VARCHAR2(50);
  -- takeing datatype from db-column
  vcParam  TABLENAME.COLUMNNAME%TYPE;
BEGIN
  -- Assignment
  vcParam:=:EMP.LIST10;
END;

Similar Messages

  • Invalid data has been used to update the list item. The field you are trying to update may be read only (Lookup Field).

    Hi.
    I am getting below error while adding value to look-up field.
    Invalid data has been used to update the list item. The field you are trying to update may be read only.
    I have tried many forums ans post but didn't come to know what's the root cause of issue. I am also posting Code for creating and adding lookup field.
    CAML to create lookup field (It works Fine)
    string lkproductNumber = "<Field Type='Lookup' DisplayName='Product Number' StaticName='ProductNumber' ReadOnly='FALSE' List='" + pNewMaster.Id + "' ShowField='Product_x0020_Number' />";
    Code to insert value to lookup field
    ClientContext client = new ClientContext(SiteUrl);
    client.Load(client.Web);
    client.Credentials = new NetworkCredential(this.UserName, this.Password, this.Domain);
    // Lookup Lists
    List pmList = client.Web.Lists.GetByTitle("Product_Master");
    //List Conatining Lookup Columns
    List piList = client.Web.Lists.GetByTitle("Product_Inventory");
    client.Load(piList);
    query.ViewXml = "<View/>";
    ListItemCollection collection = pmList.GetItems(query);
    client.Load(collection);
    client.ExecuteQuery();
    int prodid=0;
    foreach (ListItem item in collection)
    if (Convert.ToString(item["Product_x0020_Number"]) == ProductNumber)
    { prodid = Convert.ToInt32(item["ID"]); }
    ListItem piItem = piList.AddItem(new ListItemCreationInformation());
    piItem["Product_x0020_Number"] = new FieldLookupValue() { LookupId = prodid };
    piItem.Update();
    client.ExecuteQuery();
    Exception Detail
    Microsoft.SharePoint.Client.ServerException was caught
    Message=Invalid data has been used to update the list item. The field you are trying to update may be read only.
    Source=Microsoft.SharePoint.Client.Runtime
    ServerErrorCode=-2147352571
    ServerErrorTypeName=Microsoft.SharePoint.SPException
    ServerStackTrace=""
    StackTrace:
    at Microsoft.SharePoint.Client.ClientRequest.ProcessResponseStream(Stream responseStream)
    at Microsoft.SharePoint.Client.ClientRequest.ProcessResponse()
    at WebServiceProviders.ClientServices.NewProductInventory() in Z:\.............ClientServices.cs:line 889
    InnerException:
    Quick response is highly appreciated.
    Thanks
    Mehar

    Try some thing like below,
    your data value that needs to be update should be in this format "ID of the lookup";#"Title of the Lookup" 
    For example,
    listItem["Product_x0020_Number"]
    = "1;#iPhone";
    listItem["Product_x0020_Number"]
    = "2;#Mobile";
    Hope this helped you....

  • WebPart is raising the following error "Invalid data has been used to update the list item.The field you are trying to update may be read only"

    I have created a farm solution and then i deploy it to SharePoint server, the code looks as follow, and i use it to update a page info values (as the current page values represents old info):-
    [ToolboxItemAttribute(false)]
    public partial class VisualWebPart1 : WebPart
    // Uncomment the following SecurityPermission attribute only when doing Performance Profiling using
    // the Instrumentation method, and then remove the SecurityPermission attribute when the code is ready
    // for production. Because the SecurityPermission attribute bypasses the security check for callers of
    // your constructor, it's not recommended for production purposes.
    // [System.Security.Permissions.SecurityPermission(System.Security.Permissions.SecurityAction.Assert, UnmanagedCode = true)]
    public VisualWebPart1()
    protected override void OnInit(EventArgs e)
    base.OnInit(e);
    InitializeControl();
    using (SPSite site = new SPSite(SPContext.Current.Site.Url))
    using (SPWeb web = site.OpenWeb())
    SPList list = web.Lists["Pages"];
    web.AllowUnsafeUpdates = true;
    foreach (SPListItem items in list.Items)
    items["Author"] = "SharePoint";
    items["Created"] = "01/08/2014 01:44 PM";
    items.Update();
    list.Update();
    web.AllowUnsafeUpdates = false;
    protected void Page_Load(object sender, EventArgs e)
    but when i try adding this web part to a page i got the following error:-
    Invalid data has been used to update the list item.The field you are trying to update may be read only
    so can anyone advice?

    i only changed lines bitween 
    web.AllowUnsafeUpdates = true;
    and
    web.AllowUnsafeUpdates = false;
    and other parts of code remains without change
    so it will updates all pages in current web
    yaşamak bir eylemdir

  • Invalid data has been used to update the list item. The field you are trying to update may be read only.

    Trying to follow Serge Luca's Step by Step Tutorial. Creating Workflows for Windows Sharepoint Services and MOSS2007.  http://sergeluca.spaces.live.com/blog/cns!E8A06D5F2F585013!859.entry
    I have an onWorkflowActivated, followed by an ifElse condition and a log to history.
    In the IfElse, each branch has a code segment, that trys to update the status column in the list that the workflow is attached to.
    private void Authorize_ExecuteCode(object sender, EventArgs e)
    // tried serveral methods
    WorkflowProperties.Item["Status"] = "Automatically Approved";
    // tried all of the following (one at a time)
    item.update();
    WorkflowProperties.Item.Update();
    WorkflowProperties.Item.SystemUpdate();
    //tried this as well.
    Microsoft.SharePoint.SPListItem item = WorkflowProperties.Item;
    item["Status"] = "Automatically Approved";
    item.Update() ;
    On the update call I keep getting "Invalid data has been used to update the list item. The field you are trying to update may be read only."
    Could someone explain how to update "Status" column of the list item that the workflow is working on?
    Thank you very much.
    Bill
     

    Hi:
    you can do the following:
    add the following code to the workflow.xml file (under the MetaData section)
    Code Snippet
    <ExtendedStatusColumnValues>
    <StatusColumnValue>Branch1</StatusColumnValue>
    <StatusColumnValue>Branch2</StatusColumnValue>
    </ExtendedStatusColumnValues>
    then add 2 SetState activities one in each branch of the IfElse.
    for the code behind of setState1 (branch1) write the following code:
    Code Snippet
    state = Convert.ToInt32(SPWorkflowStatus.Max);
    for setState2 (branch2) write the following:
    Code Snippet
    state = Convert.ToInt32(SPWorkflowStatus.Max) + 1;
    where state is the variable assigned to the field State in the properties of the SetState(design lever), or instead of state u can use the following code:
    Code Snippet
    ((SetState)sender).State
    where sender is the object sent through the function parameter.
    hope this answered your question
    Best Regards

  • Termstore changes are not getting reflected in the list items in SharePoint 2010 farm environment

    Hi,
    I had created managed metadata with termstores from central admin. Then I had created one list in which added a column of type managed metadata using the managed metadata which I had created. And also added few list items to this list.
    The problem is that after updating a termstore the changes are not reflecting in the list items which were added before the update.
    I have referred the following links:
    http://www.paulgrimley.com/2011/02/managed-metadata-changes-not-applied-to.html
    http://davidfrette.wordpress.com/2010/05/26/taxonomy-update-scheduler%C2%A0timer%C2%A0job/
    According to the links we need to run Taxonomy Update Scheduler on the server for updated termstore to get reflected. After running
    this scheduler on development environment changes are getting reflected but not working on the production environment.
    Kindly help!
    Regards, Shruti

    You should check the obvious.  You made the change in dev, but did you make the change in production too?  And, is the term you updated, actually the one that you are looking at in the list item?
    There is not much, if anything, that can go wrong with that timer job. so I'd guess that the term you are looking at is not the one you think you are updating.
    If you have double checked everything (the term is is in fact the same term id), then you may have something erroring in the update process.  In this case, you should check the ULS logs for any errors.
    Chris
    Chris Givens CEO, Architecting Connected Systems
    Blog Twitter

  • Need to update the list item in the same sharepoint list with particular condition with Sharepoint Designer 2013.

    Hi All
    I have one sharepoint list with huge data i.e with 20columns and more than 200 records with the fields .
    Suppose lets consider there are A,B,C,D,E,F,G,H columns.
    Now i want to create one form with the fields A,C,E.
    When the user enter the existing data of list for columns A,C..based on C value the E column value should change and update that particular item in the list.
    Please guide me without visual web part can we acheive this by Sharepoint designer 2013 or what would be the preferable solution.
    Please help me on this as it is very urgent from me..
    Thanks in Advance
    Sowjanya G

    Hi,
    According to your post, my understanding is that you wanted to update the list item in the same sharepoint list with particular condition with Sharepoint Designer 2013.
    I recommend to create workflow associated to the list and then start the workflow automatically when an item is changed.
    In the workflow, you can add condition and actions as below:
    If current item: C equal to Test1
         Set E to Test2
    Then the value of the filed E will be changed based on the value of the filed C.
    In addition, if you create the form using InfoPath, you can add rule to the filed C as below:
    Best Regards,
    Linda Li
    Linda Li
    TechNet Community Support

  • 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

  • How to implement tooltip for the list items for the particular column in sharepoint 2013

    Hi,
    I had created a list, How to implement tooltip for the list items for the particular column in SharePoint 2013.
    Any help will be appreciated

    We can use JavaScript or JQuery to show the tooltips. Refer to the following similar thread.
    http://social.technet.microsoft.com/forums/en/sharepointdevelopmentprevious/thread/1dac3ae0-c9ce-419d-b6dd-08dd48284324
    http://stackoverflow.com/questions/3366515/small-description-window-on-mouse-hover-on-hyperlink
    http://spjsblog.com/2012/02/12/list-view-preview-item-on-hover-sharepoint-2010/

  • Validation settings for a list in Sharepoint 2010 to find if there is a document attached to the list item

    Hi Everyone,
    Greetings!!!
    I have a very peculiar question on List validation settings. I want to validate a list item whether user has attached a document to the list item or not? The list item should not be saved until a document is attached to it. Is it possible to perform this
    validation for a list item in a list?
    Please let me know.
    Thanks,
    Thiru
    Tirumal

    Can be done using java script as below
    http://social.technet.microsoft.com/Forums/sharepoint/en-US/c93d7611-f634-4c03-ae0d-3b5ecfe5ca6a/how-to-make-attachment-required-field?forum=sharepointadminlegacy
    http://social.msdn.microsoft.com/Forums/sharepoint/en-US/5a3fe11a-75ea-44bd-aab9-80817640290f/how-to-make-an-attachment-required-field-in-a-custom-newform-sharepoint-2010-list?forum=sharepointcustomizationprevious
    Dont think below is right
    http://social.technet.microsoft.com/Forums/sharepoint/en-US/fba48bc1-8708-401c-8a37-bc00f77eeae3/making-attachments-required-in-a-custom-list?forum=sharepointadminlegacy

  • The workflow could not check out the list item.

    Hi Guys,
    I have a workflow enabled on document library and it needs to started manually.
    Whenever user starts workflow manually, gets following error:
    "the workflow could not check out the list item. Make sure the list item is not checked out." list item is not checked out & this workflow was working smoothly earlier.
    OutCome: The workflow operation failed because the workflow lookup found no matching item.
    I have gone through below links:
    https://christopherclementen.wordpress.com/2014/05/23/oob-approval-workflow-error/
    https://social.msdn.microsoft.com/Forums/office/en-US/f673d0f6-92eb-4057-95ff-ed3cb7790360/the-workflow-operation-failed-because-the-workflow-lookup-found-no-matching-item?forum=sharepointcustomizationprevious
    Any clue on this?
    Thanks, Nilesh

    maybe check out for editing documents setting is turned on so wokrflow needs doc to ce cheked out before proceding and user might not have permission to do that.
    please refer below link:
    http://sharepoint.stackexchange.com/questions/32399/workflow-error-the-workflow-could-not-update-the-item-possibly-because-one-or
    http://community.office365.com/en-us/f/154/t/243062.aspx
    http://stackoverflow.com/questions/1272957/document-checked-out-in-sharepoint-when-workflow-starts
    Please mark as answer if you find it useful else vote for it if it is close to answer..happy sharepointing

  • How to avoid the Blank elemts in the List Item

    Dear All,
    I am using a List Item
    List Elements List Item Value
    Yes 1
    No 2
    Only two elements in this List Item.But at Run time there is one Blank element.
    I need to display only two elements from the List Item .How to avoid the Blank.
    Thanks and Regards,
    Fazil

    Fazil,
    I am using a List ItemList Elements List Item Value
    Yes 1
    No 2
    Only two elements in this List Item.But at Run time there is one Blank element.
    I need to display only two elements from the List Item .How to avoid the Blank.>
    Maybe you actually have null entries in your list. You can clean it up using keys as discussed here http://paranoid-engineering.blogspot.in/2008/05/wonderland-of-oracle-forms-builder.html (Ignore the personal opinions of the author if you will ;) ).
    Cheers,

  • Post Code : Want to determine the list of Business Partner !!!

    Hi all
       I have given Post Code of BP.
       I want to determine the <b>list of Business Partner</b> present in the specified <b>Post Code Location</b>.
      Is their any direct way around to determine the list of
    Business Partner ?  or Please let me know the possible ways to determine the BPs with the given Post Code !!!!
    Many Thanks
    Jack

    Hi Jack,
    Have a look at BAPI_BUPA_SEARCH function module.
    Enter the Post Code in the ADDRESSDATA structure and it will return list of Business Partners for the same.
    Also ,have a look at BUPA_PARTNER_CONTACT_SEARCH function module.
    <b>Reward points if it helps.</b>
    Message was edited by: Amit Mishra

  • How to modify the list item drop down context menu in SharePoint 2010

    Hi All,
    I have a requirement to add my name in the list item drop down context menu, already "Assigned ticket" option is available in the context menu and some names are available in the assigned ticket option. but i can't able to add my name in this options.
    Attached screenshot for reference. Thanks in advance for your assistance!
    Thanks
    Arun Prakash

    Do you know how the currently listed values got there in the first place? Some sort of custom code or action? Some background information would help. There is obviously a source feeding it from somewhere, but it's impossible for us to tell you exactly
    what just by looking at your scribbled-over screenshot
    Check WSPs that are deployed to the farm. Check for any non-OOTB site features that are turned on...

  • Ribbon + s4-title s4-lp | Hides when clicked on the list item

    Hello,
    Using
    SPSecurityTrimmedControl, I hide the ribbon for a user having
    view only rights. Now when this user clicks on any list item (grid view), the div "s4-title" containing the logo, and title text hides too.
    Please help.

    Thanks for the reply Shakir.
    I tried to find the div with id ms-designer-ribbon to make the changes and add the JavaScript. I failed to do so. Please helpme with me with this.
    I'll try to explain a bit more:
    The View Only user shouldn't have the ribbon for any editing changes. To achieve this, I followed the steps given in the article (URL below).
    http://blogs.msdn.com/b/zwsong/archive/2010/04/29/how-to-hide-ribbon-from-users-without-edit-page-privilege.aspx
    Now when the user clicks anywhere on "Line Item", the div containing logo i.e.
    <div class="s4-title s4-lp">
    gets hide. There should be some click event on the list items which onclick opens the edit option.
    Any help is appreciated

  • Error: "The workflow could not delete the list item"

    Have set up 2 lists:  Events and EventsArchive.  They have all the same fields.  I have created a workflow in SPD using an impersonation step (I have Full control of the site/site collection).  Workflow is essentially this:
        If Curent Item:Expired 
    equals
    Yes
           Copy item in Current Item to
    EventsArchive
           then Delete item in
    Current Item.
    The item is copying over to the EventsArchive list just fine, but the "delete" part is not happening.  Instead, I get the following error:
    The workflow could not delete the list item. Make sure the list exists and the user has permissions to delete items in the list.
    The list obviously exists (or I wouldn't be able to copy an item from it), and I have as much permissions as anyone can have, so I'm not sure where else to turn with this. 
    Thanks in advance for your help!

    Hi,
    To test the issue, I create a simple workflow without using Impersonation step:
    It works.
    Could you please create new lists to avoid custom settings and test the issue again?
    Similar thread:
    https://social.msdn.microsoft.com/Forums/office/en-US/3fa94026-4487-4e4c-a5b4-12a79d6ee6a2/workflow-delete-item-not-working?forum=sharepointcustomizationprevious
    Regards,  
    Rebecca Tu
    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected]

  • DHTML Tree - Expand on click on the List Item Label

    Hello,
    I'd like that when the user click on the List Item Label the sublist expand. I tryed with javascript:htmldb_ToggleWithImage() but I don't know what the first parameter is. I think it is the "+" image.
    Do you know a beter way for achieving this?
    Tyia,
    Cheers,
    Arnaud

    Problem solved, I modified the template and add a on click "htmldb_Toggle..." to the a href
    Cheers,
    AR

Maybe you are looking for

  • Error while invoke ADF BC Service component

    I have an ADF Service component, which I'm trying to call from BPEL. A process can be sucessfuly build and deployed, but at run time I'm getting error: Could not determine WSDL port. A error stack trace from server is below: 2008-12-04 21:02:33.003 W

  • I can no longer restrict which apps use dataplan.    Help!

    Until 3 days ago, I was able to restrict which apps can use my data plan.  Now I can turn them off but as soon as I back out of the settings, it clears any changes I made to the restriced apps.  I have had to keep my dataplan off for most of the time

  • Problem of using "org.w3c.dom.Node" class

    I try to use removeChild(child) method of "org.w3c.dom.Node" object. it don't work. is it better to do child=null;

  • How to declare this restriction on generic

    I ' d like to declare static method that when being invoked as A.<ClassRestriction.class, ItemRestriction.class> ( parameter);can check whether this parameter is the type SomeClass<SomeItem> where SomeClass is compatible (inherit, implement) ClassRes

  • Question on ROS - 2

    Hi, 2)     In ROS it is possible to define different kind of qualification questionnaires depending on the Category Id choosen by the potential supplier during the Self Service Registration; Is it possible to influence the content of a questionnaire