Thursday, February 19, 2015

Succession 360 - Hiding HCSC Folder Tabs

We are implementing Succession Planning and I was asked to hide Some Tabs on the Succession 360 page that we were not going to utilize.  My first thought was I could navigate to the Configure Folder Tabs and simply delete the tabs that we are not using.  You can find the Configure Folder Tabs using the navigation below:

Set Up HRMS > Common Definitions > Folder Tabs > Configure Folder Tabs

Or use 

Main Menu>>Enterprise Components>>Find Object Navigation and search for Component Name HCSC_TAB_DEFN

When I deleted the Tabs the component stopped loading and gave me hard peoplecode errors, because the component has hard coded values for the number of tabs it is expecting.  So to make this happen I configured all the tabs that I wanted to delete and moved them to the end of the Tabset and used JavaScript to hide them in the component. I also renamed the Tab Set Id from Tab## to ZZHIDE for the tabs that I wanted to hide.



This simplified my JavaScript to one line.



<script language="JavaScript">

$(document).ready(function(){

$( "a[name$='ZZHIDE']" ).css( "visibility", "hidden" );

})

</script>


Wednesday, February 11, 2015

Macro to Highlight Cells over 30 Chars (Scrubbing Data Pre Load)

When loading data into an delivered Component via CI, sometimes you get data that is larger than the target field's length.  For instance, 30 characters for the Field DESCR.

This macro will highlight a cell yellow if it is over the 30 Characters.  This identifies what data will be truncated.  Change the col variable, currently it is set to 3, this would be column C.  The macro also starts on the activecell, so highlight the row you want the macro to begin.


Sub scan()
Dim i As Long
Dim s As Long
Dim o As Long
Dim col As Long
Dim tgt As Long
 
 tgt = 30
 col = 3
 s = ActiveCell.Row
 For i = ActiveCell.Row To Rows.Count
  
 If Len(Cells(i, col).Value) > tgt Then
  Cells(i, col).Interior.ColorIndex = 6
  ActiveCell.Offset(o, 0).Select
  
   
 End If

Next i
End Sub

Results:


Tuesday, February 10, 2015

Bookmarklet for Navigation

Here is a quick bookmarklet to copy your Navigation to text while in Peoplesoft.  This works if your Class name for you breadcrumbs is pthnavbcanchor.

javascript:function getCref() { var x = document.getElementsByTagName('A'); var i; for (i = 0; i < x.length; i++) { var d = x[i].id; if (d.substring(0, 15) == 'pthnavbccrefanc') { return x[i].innerHTML }}}function getElementsByClassName(node, classname) { var a = []; var re = new RegExp('(^| )'+classname+'( |$)'); var els = node.getElementsByTagName('*'); for(var i=0,j=els.length; i>' +  nav[i].innerHTML;};}; var cref; cref = getCref();navPath = navPath + '>>' + cref; window.prompt('Copy to Clipboard: Ctrl+C, Enter',navPath);





To implement this Bookmarklet follow these instructions in Chrome:

Right click on your Bookmarks bar and select add page

*Note:  If you cannot see the bookmarks (ctrl+shift+B) will hide and show it in Chrome.

Edit the new book. I used GetNavPath as the name and them copy the JavaScript from the Blog to the URL.




Then test it.

From the Web Profile I get this text:

>>Favorites>>Main Menu>>PeopleTools>>Web Profile

It will show the Favorites, but I usually stop copying at Main Menu.  Then I press the Cancel button to prevent the page from redirecting in Chrome.