jessi_graves
ServiceNow Employee
ServiceNow Employee

Welcome to the ServiceNow Knowledge19 Pre-Conference - Service Portal Advanced Class!

This is a dedicated Community Article for class communication, collaboration, and fun!!

Comments
Jesper Sandberg
Tera Expert

Godmorning everyone!

Jesper from Denmark here.

Stijn Verhulst3
Kilo Guru

Good morning Jesper and a warm welcome to the Service Portal Advanced training!

Josh Soutar
ServiceNow Employee
ServiceNow Employee

Morning everyone, looking forward to getting stuck into the advanced portal class with you all today 🙂

mike_visser
Tera Expert

find_real_file.png

 

Mike from Olympia Washington here. Looking forward to advanced portal. 

caroleanderson
ServiceNow Employee
ServiceNow Employee

Good morning Josh!! Welcome!

caroleanderson
ServiceNow Employee
ServiceNow Employee

Should be fun!

snyderb
Tera Explorer

Good morning...

Josh Soutar
ServiceNow Employee
ServiceNow Employee

That's a very advanced portal, A+ Mike

sneqat
Tera Contributor

Hi everyone, good morning!

Ross22
Kilo Explorer

Good morning!

Abhinay Erra
Giga Sage

Good Morning Everyone from a 3 time ServiceNow Community MVP!! 😉 Looking forward to this class. Excited !!:)

User672379
Tera Contributor

Good morning everyone, looking forward to a great class!

Julien Albinet
Kilo Explorer

Good morning!

Stijn Verhulst3
Kilo Guru

Good morning and welcome to our Service Portal Advanced training!

Stijn Verhulst3
Kilo Guru

Good morning 🙂

Stijn Verhulst3
Kilo Guru

Good morning! Welcome to our Service Portal Advanced training, you won't be dissapointed 🙂

Stijn Verhulst3
Kilo Guru

A good morning Ross, let the portal fun begin!

Stijn Verhulst3
Kilo Guru

Good morning Abhinay, enjoy!

Benjamin Nuttin
Giga Expert

See attached for all events and all registrations

Josh Soutar
ServiceNow Employee
ServiceNow Employee

For those that don't have any demo data, you can import the following XML records to your instance

caroleanderson
ServiceNow Employee
ServiceNow Employee

DEMO DATA for CloudDimensions Events application

Some student instances are missing the demo data for the application. Files for events and registrations are attached.

Philip Lee2
Giga Contributor

Howdy!

caroleanderson
ServiceNow Employee
ServiceNow Employee

The cde_background.png file is attached here as well.

caroleanderson
ServiceNow Employee
ServiceNow Employee

Hello Phillip! Welcome!

caroleanderson
ServiceNow Employee
ServiceNow Employee

Update Sets for Service Portal Advanced Modules 1 and 2.

As each lab is completed, the applicable update set will be posted to this comment so those who may be behind can catch up. 

 

 

Chris Yang3
Kilo Contributor

Note: Don't confuse AngularJS with Angular. Service Portal uses AngularJS

Daniel Gens
Tera Contributor

Hello all,

 

Will the Lab book be available online? Thanks.

caroleanderson
ServiceNow Employee
ServiceNow Employee

The lab book is not available online. 

Daniel Gens
Tera Contributor

😞

calissevolz
Mega Contributor

Attached are the update sets through 2.3

caroleanderson
ServiceNow Employee
ServiceNow Employee

See comment including update sets (above)

Stijn Verhulst3
Kilo Guru

Hi Daniel,

hardcopy books cannot be consulted online as you'll need to purchase a seperate ebook instead; please contact training@servicenow.com if you'd like to do so.

 

Stijn Verhulst3
Kilo Guru

For those people who want to have more in-depth coverage of scoping and $scope - controllerAs; please consult the following URLs:

 

Understanding AngularJS | Pluralsight

AngularJS: MVC implementation | Pluralsight

AngularJS - Controllers: The Comprehensive How To | Pluralsight | Pluralsight

AngularJS Models: The Scoop on Scopes | Pluralsight | Pluralsight

 

"The Comprehensive How To" blog focuses on the ControllerAs concept of AngularJS works and also why we apply the controllerAs (ref "var c = this") instead of $scope in the Service Portal widget controller scripts (= client script) on the NOW platform. In order to understand this, if you're not familiar with AngularJS, it's recommended to read through top 2 blogs first.

 

Hope it will bring you more clarity!

Igor Kozlov
Tera Expert

Followup on recordWatch().

The widget-data-table widget has  different implementation of subscription with force unsubscribe on widget destruction. 

 

I would like to know what is the difference.

	var watcher;
	function initRecordWatcher(table, filter){
		if (watcher)
			watcher.unsubscribe();

		if (table && filter) {
			var watcherChannel = amb.getChannelRW(table, filter);
			amb.connect();
			watcher = watcherChannel.subscribe(function(message) {
				if (!message.data)
					return;
				switch(message.data.action) {
					case "change":
						updateRowFromRW(message);
						break;
					case "exit":
						// A record was removed
					case "enter":
						// A record was added
					default:
						spUtil.update($scope);
						break;
				}
			});
		}
	}


$scope.$on('$destroy', function() {
		if (watcher)
			watcher.unsubscribe();
	});

 

cloudminus89
Mega Contributor

is this 

grNewRegistration.setValue('first_name', input.first_name);

the same as

grNewRegistration.first_name= input.first_name;

but without requiring .update()

?

cloudminus89
Mega Contributor
rashmirajaguru
Kilo Contributor

what are the all possible system variables that can be passed to the controller function

e.g $ scope,rootscope,location etc.. where can we find all the available list?

 

patrikschwarz
Kilo Contributor

I think you want to use subscribe + unsubscribe when you refresh/change the content of the widget without refreshing the page.

so in the case of the datatable widget, you could change the table on-the fly - you dont refresh the page, the widget just reloads with new data - the initRecordWatch fn then gets called again and unsubscribes from the old listeners. In This case also the table and filter parameters of the record watchers change because its new table

 

Most of the time you only listen for specific table and filter, so you can use the simple recordWatch

 

 

Daniel Gens
Tera Contributor

grNewRegistration.first_name= input.first_name;

 

would still require .update(). So it's the exactly same thing AFAIK.

cloudminus89
Mega Contributor

ah yes, my bad...just spotted the .insert()!

Chris Yang3
Kilo Contributor

They are angular services you can inject to the controller https://code.angularjs.org/1.5.11/docs/api/ng/service

caroleanderson
ServiceNow Employee
ServiceNow Employee

Knowledge Base Update set for Lab 3.3 (for those who were missing demo data on day 1)

  1. Retrieve the attached update set
  2. Preview the loaded update set
  3. Commit the update set

 

Once the update set is committed, verify the update was successful:

  1. Navigate to Knowledge > Create New
  2. Select the Knowledge knowledge base
  3. Click on the search icon and verify there are categories and subcategories for the knowledge base
caroleanderson
ServiceNow Employee
ServiceNow Employee

MODULE 3 UPDATE SETS

Igor Kozlov
Tera Expert

Can you share the code of DC task card widget?

wouter_de_waal
Tera Contributor

The example is explained in Dan Conroy's community article: https://community.servicenow.com/community?id=community_article&sys_id=29188f2cdb2b57c08e7c2926ca961983. There you can download the XML file.

Benjamin Nuttin
Giga Expert

When inserting a new record, what does gr.initialize() actually do? Inserting seems to work fine without that line, and I've seen OOB scripts that omit it.

User673228
Kilo Expert

About the solution for the error of using the "key" up and down in lab 3.4, step B2, you should remplace at line 9 (into the doc):

if(String(controller.options.enable_arrow_key_selection) == 'true')
        registerWindowEvents();
by

if (controller.options.enable_arrow_key_selection)
        registerWindowEvents();

Enjoy

Bryan Graham
Mega Contributor

There are 2 methods available (initialize and newRecord)  that do similar things and both explained here: https://community.servicenow.com/community?id=community_video&sys_id=d7e08749db947b44fece0b55ca9619c...

Essentially they're assigning default values, getting a number etc.

caroleanderson
ServiceNow Employee
ServiceNow Employee

MODULE 4 UPDATE SETS

Igor Kozlov
Tera Expert

Can you please a code example showing benefits of using controllerAs syntax instead of using $scope? 

Version history
Last update:
‎04-03-2019 02:35 PM
Updated by: