Search code examples
javascriptsharepoint-2010sharepoint-clientobject

Cannot load value of "multiple line of text" using COM in javascript


The column name is "Dialog Box". I tried this

                var context = new SP.ClientContext.get_current();
                var targetList = context.get_web().get_lists().getByTitle("myList");
                var targetListItem = targetList.getItemById(_spGetQueryParam('id'));
                context.load(targetListItem, "Dialog Box");
                context.executeQueryAsync(Function.createDelegate(this, onStatusQuerySucceeded), Function.createDelegate(this, onStatusQueryFailed));

                function onStatusQuerySucceeded() {

                    alert(targetListItem.get_item("Dialog Box"));
                }

                function onStatusQueryFailed(sender, args) {
                    alert("failed Dialog Box");                                            
                }

Solution

  • "Dialog Box" is title, you should try with internal name. You can use SharePoint manager to get internal name of column. But to make sure create new column without space and with non existing name and try to get value. Column name without space have same internal name if its not exist.