Showing posts with label Comments. Show all posts
Showing posts with label Comments. Show all posts

Monday, October 22, 2018

PeopleCode Color Coding for Comments


If you are PeopleSoft Developer you must have noticed this annoying bug which was introduced in PT 8.56. As you can see in the screenshot below, the color coding for comments (green) does not work anymore for multi-line comments!

MOSC Discussion: https://community.oracle.com/thread/4179817


Demo of the Problem

We can see from the demo video that it is easy to get lost while reading/writing PeopleCode without proper color coding for comments.


Workaround

A colleague at work showed me a trick to force the color coding in PT 8.56 to workaround the original problem. Simply add a SPACE after /* or <*.

Demo of workaround


PeopleTools 8.57

I can confirm that this bug is fixed in PT 8.57.01!

Demo in PT 8.57

Monday, November 20, 2017

Commenting JavaScript in PeopleTools

If we look at some of the HTML objects which store JavaScript in PeopleTools, we will find many styles of comments. Here are a few options.

Option 1
// Option 1 - Single Line Comment;

/*
Option 1 - Multi-line Comment 1;
Option 1 - Multi-line Comment 2;
*/

Option 2
//% Option 2 - Single Line Comment;

<!%
Option 2 - Multi-line Comment 1;
Option 2 - Multi-line Comment 2;
 -->

What is the benefit of using % meta-html?

The screenshot below shows how the javascript is rendered at runtime. We can see that using the % sign allows the meta-HTML processor to recognize the comments and delete them during runtime.


PeopleBooks: Comments in HTML

Does commenting style (% meta-html) really matter for JavaScript?

Not really. PeopleTools 8.53 introduced JavaScript Minification by default. The screenshot in the previous section was generated by disabling minification (using Signon - Page Generation trace settings). Therefore, the commenting style in JavaScript does not really matter if we don't override/disable the PeopleTools (8.53+) default minification which will delete all comments (regardless of style) in JavaScripts.

PeopleBooks: Working with JavaScript in HTML Definitions