Sharepoint calculated value ID

%3CLINGO-SUB%20id%3D%22lingo-sub-736265%22%20slang%3D%22en-US%22%3ESharepoint%20calculated%20value%20ID%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-736265%22%20slang%3D%22en-US%22%3E%3CP%3EHey%20All!%3C%2FP%3E%3CP%3EI%20would%20like%20to%20ask%20for%20your%20help%20%3A)%3C%2Fimg%3E%3C%2FP%3E%3CP%3E1.%20I%20have%20numbers%20calculated%20value%20column%20based%20on%20ID.%20For%20some%20reason%20after%20few%20days%2C%20some%20of%20the%20items%20(which%20exists)%20shows%200%20on%20the%26nbsp%3Bcolumn%20(even%20though%20the%20ID%20itself%20is%20not%200).%20I%20have%20tried%20change%26nbsp%3Bcolumn%20setting%20to%20Text%20instead%20of%20numbers-%20it%20helped%20but%20after%20few%20days%20the%20zeros%20shows%20up%20again.%20Any%20ideas%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E2.%20Is%20there%20an%20option%20on%20SharePoint%20table%20to%20freeze%20panes%20like%20in%20Excel%3F%20We%20have%20big%20tables%20and%20it%20is%20really%20hard%20work%20without%20seeing%20the%20header%20%3A(%3C%2Fimg%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThanks!%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-736265%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3ESharePoint%20Online%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ESites%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-736956%22%20slang%3D%22en-US%22%3ERe%3A%20Sharepoint%20calculated%20value%20ID%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-736956%22%20slang%3D%22en-US%22%3E%3CP%3E%3CSPAN%3EThe%20reason%20you%20are%20seeing%20a%20%220%22%20when%20you%20initially%20save%20the%20item%20is%20that%20there%20is%20no%20value%20for%20%22ID%22%20yet.%20%26nbsp%3BSo%20the%20better%26nbsp%3B%3C%2FSPAN%3Eapproch%20will%20be%20create%20a%20workflow%20to%20generate%20the%20calculated%20value%20on%20item%20created%2Fmodified%20event.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-736960%22%20slang%3D%22en-US%22%3ERe%3A%20Sharepoint%20calculated%20value%20ID%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-736960%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F370469%22%20target%3D%22_blank%22%3E%40RomiGorlachov%3C%2FA%3E%26nbsp%3BAnd%20regarding%20%232.%20The%20easy%20option%20is%20to%20prepare%202%20view%20with%20limited%20number%20of%20records%2C%20and%20make%20the%20connected%20web%20parts.%20So%20when%20the%20user%20select%20item%20from%20the%20first%20Webpart%20corresponding%20data%20will%20be%20shown%20in%20the%20second%20Webpart%20too.%3C%2FP%3E%3C%2FLINGO-BODY%3E
Highlighted
Occasional Visitor

Hey All!

I would like to ask for your help :)

1. I have numbers calculated value column based on ID. For some reason after few days, some of the items (which exists) shows 0 on the column (even though the ID itself is not 0). I have tried change column setting to Text instead of numbers- it helped but after few days the zeros shows up again. Any ideas?

 

2. Is there an option on SharePoint table to freeze panes like in Excel? We have big tables and it is really hard work without seeing the header :(

 

Thanks!

3 Replies
Highlighted

The reason you are seeing a "0" when you initially save the item is that there is no value for "ID" yet.  So the better approch will be create a workflow to generate the calculated value on item created/modified event.

Highlighted

@RomiGorlachov And regarding #2. The easy option is to prepare 2 view with limited number of records, and make the connected web parts. So when the user select item from the first Webpart corresponding data will be shown in the second Webpart too.

Highlighted
Regarding #2, How to freeze a header row I found how to make the header row stay frozen at the top in CLASSIC mode, yet not in MODERN mode The headers stay frozen at the top when in VIEW mode AND when in EDIT mode. In order to get the header row to stay frozen at the top in EDIT mode: 1. Add a Script Editor Web Part at the top of the library or list AND add the JavaScript below 2. View the library or list in a browser 3. Open the library or list in EDIT mode 4. Refresh the browser 3 or 4 times and the headers should appear at the top 5. If they don't, select one of the cells and then repeat Step 4 above <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js" type="text/javascript"></script> <script type="text/javascript"> jQuery(document).ready(function(){ stickyHeaders() }) function stickyHeaders(){ if( jQuery.inArray( "spgantt.js", g_spPreFetchKeys ) > -1){ SP.SOD.executeOrDelayUntilScriptLoaded(function () { findListsOnPage(); }, "spgantt.js"); } else { findListsOnPage(); } $(window).bind('hashchange', findListsOnPage); } function findListsOnPage() { var lists = $('.ms-listviewtable') var quickEditLists = []; var listViews = []; $(lists).each(function(i){ if($(this).find('div[id^="spgridcontainer"]').length > 0 ){ quickEditLists.push($(this)) } else if( $(this).hasClass("ms-listviewgrid") == false ) { listViews.push($(this)) } }) if(quickEditLists.length > 0) { SP.GanttControl.WaitForGanttCreation(function (ganttChart) { initializeStickyHeaders(quickEditLists, "qe"); }); } if(listViews.length > 0) { initializeStickyHeaders(listViews, "lv"); } } function initializeStickyHeaders (lists, type) { var top_old = [], top_new = [], bottom_old = [], bottom_new = [], stickies = [], headers = [], indexOffset = 0 ; var style = "position:fixed;" + "top:65px;" + "z-index:1;" + "background-color:beige;" + "box-shadow:3px 3px 5px #DDDDDD;" + "display:none" $(window).unbind('resize.' + type); $(window).bind ('resize.' + type, updatestickies ); $('#s4-workspace').unbind('scroll.' + type); $('#s4-workspace').bind ('scroll.' + type, updatestickies ); $(lists).each(function(){ headers.push($(this).find($('.ms-viewheadertr:visible'))) }); $(headers).each(function (i) { var table = $(this).closest("table"); if(table.find("tbody > tr").length > 1) { table.parent().find(".sticky-anchor").remove() table.parent().find(".sticky").remove() var anchor = table.before('
') stickies.push($(this).clone(true,true).addClass("sticky").attr('style', style).insertAfter(anchor)) var tbodies = $(this).parent("thead").siblings("tbody") if(tbodies.length > 1) { tbodies.bind("DOMAttrModified", function(){ setTimeout(function(){ $('#s4-workspace').trigger("scroll", true) }, 250) }) } } else { headers.splice(i-indexOffset,1) indexOffset++; } }) //Do it once even without beeing triggered by an event updatestickies(); function updatestickies (event, DOMchangeEvent) { $(headers).each(function (i) { if(DOMchangeEvent) { width(); return false; } function width() { stickies[i].width(headers[i].width()).find('th').each(function (j) { $(this).width(headers[i].find('th:nth-child(' + (j+1) + ')').width()) }) } top_old[i] = top_new[i] top_new[i] = Math.round($(this).offset().top - 45) bottom_old[i] = bottom_new[i] bottom_new[i] = Math.round(top_new[i] - 30 + $(this).closest('table').height()) stickies[i].offset({ left: Math.round(headers[i].closest("div[id^=WebPartWPQ]").offset().left) }); if(top_old[i] >= 0 && top_new[i] <= 0 || bottom_old[i] <= 0 && bottom_new[i] >= 0 || top_old[i] === undefined && bottom_old[i] === undefined && top_new[i] < 0 && bottom_new[i] > 0 ) { width(); stickies[i].fadeIn(); } else if (top_old[i] <= 0 && top_new[i] >= 0 || bottom_old[i] >= 0 && bottom_new[i] <= 0 ) { stickies[i].fadeOut(); } }) } } </script>