Populating Field On Load with current username & other tricks requ

A

Adam Harding

I have read loads of other posts about this subject but as i am new to
programming i can't quite understand HOW it relates to my problem.

I am not running .NET, IIS, or any other helpful stuff as I am not working
in the IT Department.

I am looking to poulate a hidden field on the form with the username for my
originator on the orginator view. When a new person accesses the form it
checks to see if their username is identical to the originators, if so then
they get the originator form, if not they get the Authorisation View as their
default.

Can anyone offer any ideas. I am sure it is written here somewhere, but
there are so many suggestions i don't know where to start.
 
F

Franck Dauché

Hi Adam,

You will need to use scripting to do it (Tools \ Programming \ MS Script
Editor). Most of the action will take place in your: function
XDocument::OnLoad(eventObj)

To get to the user, you can use:
var objNwk = new ActiveXObject("WScript.Network");
//Logged-on user name:
var userName = objNwk.UserName;
//Populate Hidden field:
XDocument.DOM.selectSingleNode(YourHiddenFieldXPath).text = userName;

Based on who your user is, you will default to one View or the other using:
XDocument.ViewInfos["YourViewName"].IsDefault = true

Hope that it gets you started.

Regards,

Franck Dauché
 
A

Adam Harding

Cheers Frank with that i have it sorted.

FANTASTIC seeing as we go live Tuesday!!!

Thanks Again

Franck Dauché said:
Hi Adam,

You will need to use scripting to do it (Tools \ Programming \ MS Script
Editor). Most of the action will take place in your: function
XDocument::OnLoad(eventObj)

To get to the user, you can use:
var objNwk = new ActiveXObject("WScript.Network");
//Logged-on user name:
var userName = objNwk.UserName;
//Populate Hidden field:
XDocument.DOM.selectSingleNode(YourHiddenFieldXPath).text = userName;

Based on who your user is, you will default to one View or the other using:
XDocument.ViewInfos["YourViewName"].IsDefault = true

Hope that it gets you started.

Regards,

Franck Dauché


Adam Harding said:
I have read loads of other posts about this subject but as i am new to
programming i can't quite understand HOW it relates to my problem.

I am not running .NET, IIS, or any other helpful stuff as I am not working
in the IT Department.

I am looking to poulate a hidden field on the form with the username for my
originator on the orginator view. When a new person accesses the form it
checks to see if their username is identical to the originators, if so then
they get the originator form, if not they get the Authorisation View as their
default.

Can anyone offer any ideas. I am sure it is written here somewhere, but
there are so many suggestions i don't know where to start.
 
F

Franck Dauché

Glad I could help.

Good luck for Tuesday.

Franck



Adam Harding said:
Cheers Frank with that i have it sorted.

FANTASTIC seeing as we go live Tuesday!!!

Thanks Again

Franck Dauché said:
Hi Adam,

You will need to use scripting to do it (Tools \ Programming \ MS Script
Editor). Most of the action will take place in your: function
XDocument::OnLoad(eventObj)

To get to the user, you can use:
var objNwk = new ActiveXObject("WScript.Network");
//Logged-on user name:
var userName = objNwk.UserName;
//Populate Hidden field:
XDocument.DOM.selectSingleNode(YourHiddenFieldXPath).text = userName;

Based on who your user is, you will default to one View or the other using:
XDocument.ViewInfos["YourViewName"].IsDefault = true

Hope that it gets you started.

Regards,

Franck Dauché


Adam Harding said:
I have read loads of other posts about this subject but as i am new to
programming i can't quite understand HOW it relates to my problem.

I am not running .NET, IIS, or any other helpful stuff as I am not working
in the IT Department.

I am looking to poulate a hidden field on the form with the username for my
originator on the orginator view. When a new person accesses the form it
checks to see if their username is identical to the originators, if so then
they get the originator form, if not they get the Authorisation View as their
default.

Can anyone offer any ideas. I am sure it is written here somewhere, but
there are so many suggestions i don't know where to start.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top