WSFN Tag Overview

These are the special tags that can be used on WSFN templates.

Tag Function
<?action()?> Create link to an action
<?add()?> Add two numbers
<?auth?> If <auth> <html> <?endif?>
<?calc()?>  
<?calcdate()?> Dynamics NAV calcdate
<?caption()?> Field caption
<?close()?> Close a table
<?codeunit()?> Execute a codeunit
<?company?> Company name
<?count?> Record count
<?edit()?> Field edit control
<?else?> “else” in “if” and other branching statements
<?endif?> “endif” in “if”
<?field()?> Field value
<?fieldname()?> Field name
<?filter()?> Set a filter on a table
<?findfirst()?> Set cursor to first record
<?findlast()?> Set cursor to last record
<?get()?> Get a record (on primary key)
<?hidden()?> Hidden form value
<?if()?> “if”
<?init?> Init page, and insert header plumming
<?key()?> Build a key string from data or querystring
<?loginok?> “if” login OK
<?logout?> Logout
<?lookup()?> Lookup control
<?loop()?> Loop a table
<?loopend()?> End of table loop
<?loopno()?> Loop counter
<?mle?> Multi line edit control
<?new()?> Init a new record
<?next()?> Next page control
<?no?> “Navision No” – The user’s Number
<?options()?> Combo box control
<?pageno()?> Page number (in loop structure)
<?pages()?> Total pages (in loop structuce)
<?parse()?> Embed another template
<?parm()?> Get parameter from querystring
<?prev()?> Previous page control
<?profile()?> “if” member of security profile
<?profiles()?> “if member of security profiles (filter)
<?raw()?> Raw field value
<?rawedit()?> Raw field value edit control
<?rawselect()?> Raw combobox control
<?report()?> Execute report and insert result
<?row()?> Row number (in table loop)
<?security()?> “if” security profile
<?select()?> Combobox control from optionfield
<?select2()?> Combobox control from optionfield
<?sessionid?> Session ID
<?set()?> Set session parameter
<?show()?> Show field value control (read only)
<?super?> “if” super user
<?table()?> Open table
<?tablename()?> Table name
<?time?> Current Time
<?today()?> Current Date
<?upload()?> Upload control
<?userid?> User ID
<?usertype?> “if” user type (customer/vendor etc..)
<?wsfn?> Server path (for navision.aspx)

General System functions

<?action(WSFNACTION)?>

The <?action(WSFNACTION)?> is used to make a link to other pages Parameters: WSFNACTION: String <a href=”<?action(‘TAGS_HELP’)?>”>Link to this page</a> Output: Link to this page

<?add(TABLENO,FIELDNO,DECIMALVALUE)?>

The <?add(TABLENO,FIELDNO,DECIMALVALUE)?> can be used to add together a decimal value from a NAV field with a constant value. The output is the sum of the 2 decimals Parameters: TABLENO: Integer. Table no. of the record containing the first decimal value to add. FIELDNO: Integer. Field no. of the first decimal value to add The table must be declared and the actual record must be fetched. DECIMALVALUE: String of second decimal value to be added. <?table(17,’WHERE (Field1=0(1))’)?> <?add(17,17,’123′)?> <?close(17)?> Output:

<?auth?>

The <?auth?> can be used to tell whether the user is logged in or not Like the <?if()?> tag, it must be terminated with a <?endif?> tag. <?auth?> User is Authenticated <?else?> User is NOT Authenticated <?endif?> Output: User is Authenticated User is NOT Authenticated

<?caption(<table>,<field>)?

<?close(<table>)?

<?codeunit(<codeunit no.>,<ID>,<parameter1>,<parameter2>, …)?>

<?company?>

<?count(<tableno>)?>

<?edit(tableno,fieldno,extra settings)?>

<?if(<tableno>,<fieldno>,<operator>,<comparevalue>)?> <?else?> <?endif?>

<?init?>

The <?init?> tag inserts a link to the navisionajax.js file. This tag must be placed the head section of the html file, i.e. between the <head> and the </head> tags. <head> <?init?> </head> Output: <SCRIPT language=javascript src=”/wsfn/navisionajax.js”></SCRIPT>

<?key(tableno)?>

(This is a really bad example, the same can be done with the <?action?> tag)

<?loginok?>

The <?loginok?> is normally used on the login page as value for the hidden input id=actionurl <input name=”actionurl” type=”hidden” id=”actionurl” value=”<?loginok?>”> The tags displays the requested ACTION <?loginok?> Output:

<?logout?>

The <?logout?> tag logs out the user by terminating the session, and the user is no longer authenticated This tag is only placed in the action used for login. This tag must be placed the head section of the html file, i.e. between the <head> and the </head> tags. <head> <?logout?> </head>

<?no?>

The <?no?> tag displays the User Navision Number This tag can also be used in combination with the <if>,<table><filter> tags as ‘..no()..’ <?no?> Output: <?usertype(‘0’)?> <?table(18,’where(field1=0(‘..no()..’)’))?> <?caption(18,2)?>:<?field(18,2)?> <?close(18)?> <?else?> <?usertype(‘1’)?> <?table(23,’where(field1=0(‘..no()..’)’))?> <?caption(23,2)?>:<?field(23,2)?> <?close(23)?> <?else?> <?usertype(‘2’)?> <?table(5050,’where(field1=0(‘..no()..’)’))?> <?caption(5050,2)?>:<?field(5050,2)?> <?close(5050)?> <?else?> <?usertype(‘3’)?> <?table(13,’where(field1=0(‘..no()..’)’))?> <?caption(13,2)?>:<?field(13,2)?> <?close(13)?> <?endif?> <?endif?> <?endif?> <?endif?> Output: : : : :

<?profile()?>

The <?profile({SECURITYPROFILE})?> can be used in replacement for the <?if()?> It tells whether the user has the current SECURITYPROFILE <?profile(‘KREDITOR’)?> User have the Security Profile ‘KREDITOR’ <?else?> User do NOT have the Security Profile ‘KREDITOR’ <?endif?> Output: User have the Security Profile ‘KREDITOR’ User do NOT have the Security Profile ‘KREDITOR’

<?profiles()?>

The <?profiles({SECURITYPROFILE1|*})?> can be used in replacement for the <?if()?> It tells whether the user has one of the SECURITYPROFILES <?profiles(‘KREDITOR|ANONYMERH|KUNDEERH1|KUNDEERH2’)?> User have one of Security Profiles KREDITOR|ANONYMERH|KUNDEERH1|KUNDEERH2 <?else?> User do NOT have the any of the Security Profilea KREDITOR|ANONYMERH|KUNDEERH1|KUNDEERH2 <?endif?> Output: User have one of Security Profiles KREDITOR|ANONYMERH|KUNDEERH1|KUNDEERH2 User do NOT have the any of the Security Profilea KREDITOR|ANONYMERH|KUNDEERH1|KUNDEERH2

<?security()?>

The <?security({tableno})?> give an ERRORS if the user do not have lookup rigths to tableno A Security Profile must exist with “Allow Ajax Lookup” {TRUE} <?security(18)?> Output:

<?show(tableno,fieldno,extra settings)?>

<?super()?>

The <?super?> can be used in replacement for the <?if()?> It tells whether the user is a superuser or not <?super?> User is Superuser <?else?> User is NOT Superuser <?endif?> Output: User is Superuser User is NOT Superuser

<?table?>

 

https://docs.microsoft.com/en-us/dynamics-nav/setview-function–recordref-

<?userid?>

The <?userid?> displays the User ID. <?userid?> Output:

<?usertype?>

The <?usertype?> can be used as replacement for the <?if()?> tag <?usertype({integer})?>{integer} = {0 = Customer, 1 = Vendor, 2 = Contact, 3 Salesperson} Sample <?no?>

<?wsfn?>

The <?wsfn?> displays the WSFN Setup Serverpath (/WSFN/) <?wsfn?> Output:

Field functions

<?caption(tableno,fieldno)?>

The <?caption(tableno,fieldno)?> is used to display the caption of a field. tableno is the no. of the table, to which the field belongs. fieldno is the no. of the field. This is particularly practical on pages, that show data in different languages. The table must be declared prior to using this tag. Example: <?table(17)?> The caption of field 3 (G/L Account No.) in table 17 (G/L Entry) is <?caption(17,3)?> <?close(17)?> Output: The caption of field 3 (G/L Account No.) in table 17 (G/L Entry) is