• Release History
  • Documentation
  • Back to www.mscrm-addons.com
  • Release History
  • Documentation
  • Back to www.mscrm-addons.com
home/Knowledge Base/Template Designer(DCP)/The code behind the ordinals field function (Advanced)

The code behind the ordinals field function (Advanced)

96 views 0 Updated on July 27, 2022

The following information provides you with a technical description of the ordinals field functionality. For further information on the functionality itself, please have a look at this article. 

This is how the function looks like:

The below table describes what happens behind the scenes. The left column contains a structure chart that visualizes the procedure. The two columns on the right contain examples that run parallel to the structure chart and intend to help to understand the algorithm.

SET date field to internal variable “day” with the formatting “d”
(the “d” formatting only displays the day as a number; (this would also work with actual number fields and might require no or a different formatting)

Example “createdon” with the value “11/24/2016” and the switch formatting d results in “24”

Example “createdon” with the value “11/3/2016” and the switch formatting d results in “3”

SHOW day

24

3

SET the helper variable “goon” to 0

“goon” is 0

“goon” is 0

CALCULATE the module of day by 100 and store the result in variable “result1”

“result1” is 24

“result1” is 3

CALCULATE the module of day by 10 and store the result in variable “result2”

“result2” is 4

“result2” is 3

IS “result1” equal “11”

No

No

Yes

No

No

No

Print “th”

IS “result1” equal “12”

Yes

No

No

No

Print “th”

IS “result1” equal “13”

Yes

No

“goon” is 1

“goon” is 1

Print „th”

SET the helper variable “goon” to 1

IF “goon” is equal to “1”

Yes

Yes

No

Yes

No

No

Nothing

IS “result2” equal “1”

Yes

No

Nothing

Nothing

Print „st”

Nothing

IS “result2” equal “2”

No

No

Yes

No

Nothing

Nothing

Print „nd”

Nothing

IS “result2” equal “3”

No

Yes

Yes

No

Nothing

Print “rd”

Print „rd”

Noting

IS “result2” higher than “3”

Yes

No

Yes

No

Print “th”

Nothing

Print „th”

Nothing

That’s it! We appreciate your feedback! Please share your thoughts by sending an e-Mail to support@mscrm-addons.com.

reworkneeded.. still valid.. do we have other better possibilities?

Was this helpful?

Yes  No
Related Articles
  • Sample Templates 
  • Step-by-Step: How to create an account sales report template
  • Step-by-Step: How to create a NDA-contract template 
  • Step-by-Step: How to create a work order template
  • Step-by-Step: How to create a quote template 
  • Step-by-Step: How to create an initial contact template for a lead
Latest Articles
  • Sample Templates 
  • Step-by-Step: How to create an account sales report template
  • Step-by-Step: How to create a NDA-contract template 
  • Step-by-Step: How to create a work order template
  • Step-by-Step: How to create a quote template 
Popular Articles
  • DocumentsCorePack Template Designer – Getting Started
  • Step-by-Step: How to configure a One-Click-Action
  • Where do I find the Unique Organization name in Microsoft Dynamics 365?
  • mscrm-addons.com Application Access for Dynamics 365 (App Access) – DocumentsCorePack
  • DocumentsCorePack Online Service Configuration
Top Rated Articles
  • “Undefined”-labels in Chrome and Edge 114 and higher
  • IMPORTANT information for Dynamics 365 online customers using DocumentsCorePack and/or AttachmentExtractor
  • How to activate the DocumentsCorePack connector for PowerApps & Microsoft Flow
  • Step-by-Step: How to configure a One-Click-Action
  • How licenses are counted
Categories
  • *News and General Infos* 52
  • Webinars 37
  • Template Designer(DCP 192
  • DocumentsCorePack(DCP 204
  • TelephoneIntegration (TI 65
  • AttachmentExtractor (AE 64
  • PowerSearch (PS 48
  • ActivityTools (AT 59
  • SmartBar (SB 53
  • GroupCalendar (GC 46
Our Vision

“We see it as our purpose to provide products that simplify and speed up our customers’ Microsoft Dynamics 365 experience.”

Knowledgebase
LogIn
mscrm-addons.com
  • Products
  • Online Shop
  • Downloads
  • My Account
About Us
  • About Us
  • Case Studies
  • Newsletter
  • Partner Program
  • Contact
Support
  • Support
  • Terms & Conditions
  • Documentation
  • Webinars
  • Legal Documents
  • Impressum
  • © 2022 www.mscrm-addons.com. All Rights Reserved.