Create and format a string property

The string property includes free text boxes, URLs, phone numbers, and email addresses. Assume that resources must enter remarks for an activity after the activity is closed. The Activity Details form must contain a text box, so the resource can enter the remarks. The text box that you add here, is a string property.

  1. Click Configuration.
  2. Click Properties in the Resources, Activities, Inventories section.
  3. Click Add New.
  4. Select String from the Property Type drop-down list.
  5. Complete these fields:
    • Property name (required): Enter a name that you want to display to the user in English and in all the languages that are active in the application.

    • Property label (required): Enter a Unique database identifier for the Oracle Field Service API.

    • Property hint (optional): Enter a hint that you want to display when a user hovers over the field name. For example, Enter comments if any. Enter the text in English and in all the languages that are active in the application.

    • Regular expression: Enter an expression to validate the values or format the values in a certain way.

    • Entity (required): Select Activity since the property is associated with the Activity Details form.

    • Lines Count (required): Enter the number of lines that you want the property to display in the Activity Details form. For example, enter 3 to display a maximum of three lines.

    • GUI (optional): Select one of these options to define how the property displays to users:

      • Text Element: Displays as a free text field. For our example, select this option.

      • URL: Displays as a clickable URL.

      • Phone: Displays as a clickable phone number.

      • Email: Displays as a clickable email address.

      • Geolocation Element: Displays a button to show the location on a map.

    • Regular expression (optional): Enter an expression to validate input or to force the data to display in a certain way.

      For example, to display $23,540, then use this regular expression: /^/$?([1-9]{1}[0-9]{0,2}(/,[0-9]{3})*(/.[0-9]{0,2})?|[1-9]{1}[0-9]{0,}(/.[0-9]{0,2})?|0(/.[0-9]{0,2})?|(/.[0-9]{1,2})?)$/

      Other examples:
      • Ethernet ARP address: /^([0-9a-fA-F]{2}:){5}[0-9a-fA-F]{2}$/

      • Phone number: +1(555)5555555: "/^ *\\+? *[0-9]+[-0-9() ]*$/"

      • 16-bit integer: (0-65535): /(^\d{0,4}$)|(^6553[0-5]$)|(^655[0-2][0-9]$)|(^65[0-4]\d{2}$)|(^6[0-4]\d{3}$)|(^[0-5]\d{4}$)/

      • 1 digit: (0-9): /^\d{1}$/

      • 2 digits: (01-99): /^\d{2}$/

      • Integer: (0-99): /^\d{1,2}$/

      • Integer: (0-999): /^\d{1,3}$/

      • Any 6 symbols(you can change 6 to any number): /^.{6}$/u

      • Currency (USD with 2 decimal places): /^/$?([1-9]{1}[0-9]{0,2}(/,[0-9]{3})*(/.[0-9]{0,2})?|[1-9]{1}[0-9]{0,}(/.[0-9]{0,2})?|0(/.[0-9]{0,2})?|(/.[0-9]{1,2})?)$/

      • Date formatted as DD-MM-YYYY: /^((0[1-9])|([1-2][0-9])|30|31)-((0[1-9])|1[0-2])-2[0-9]{3}$/

    • Clone property on Reopen/Prework (optional): Enables you to duplicate the property while reopening the activity or applying prework for a new activity.

    • Formatting (optional): If selected, displays these options:

      • Regular expression

      • XSL transformation (converts an XML file into a table format viewable in HTML that is read-only).
        Note: Formatted properties aren't available for presentation on the Inventory Grid context layout structure.

      Assume that you want to display this data from a client system within Oracle Field Service:

      Group Price
      One Time Charges and Credits $ 100.00
      Programming Change $ 5.00
      Programming Change $ 5.00
      Programming Change $ 5.00
      Programming Change $ 5.00
      UNKNOWN $ 0.00
      Monthly Charges $ 129.98
      America’s Top 250 $ 69.99
      HD/SD (2TV) Receiver $ 14.00
      HD/SD (2TV) Receiver $ 14.00
      DVR Service $ 6.00
      Protection Plan $ 6.00
      Israeli: The Israeli Network $ 19.99
      Monthly Credits $ -10.00
      Cr: Agent $ 10x24 Mo $ -10.00
      Monthly Charges and Credits $ 119.98

    Use this regular expression for the above data: /(/s+)?(.+/w)/s+(/$)/s+(.*)/n?/im = [item group="$1"] [name]$2[/name][price]$4[/price][currency]$3[/currency][/item]

    This XML file converts the data given earlier into a table format:

    [xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"]
    [xsl:template match="/"]
    	
    	[style]
    		.property_table
    		{
    			font-size:12px;
    			font-family: Arial;
    			border-collapse: collapse;
    		}
    		.property_table .property_name
    		{
    			padding-left:15px;
    		}
    		.property_table td
    		{
    			border: 1px solid grey;
    			padding: 4px;
    		}
    		.property_table .property_price
    		{
    			text-aligh:right;
    		}
    		.property_group
    		{
    			background-color:#ccc;
    			font-weight: bold;
    		}
    		.property_group .property_name
    		{
    			padding-left:5px;
    			font-weight: bold;
    		}
    	[/style]
    	[table class="property_table"]
    		[xsl:for-each select="root/item"]
    			[xsl:choose]
    				[xsl:when test="@group=' '"]
    					[tr class="property_group"]
    						[td class="property_name"] [xsl:value-of select="name"/] [/td]
    						[td class="property_price"]
    							[span] [xsl:value-of select="currency"/] [/span]
    							[xsl:value-of select="price"/]
    						[/td]
    					[/tr]
    				[/xsl:when]
    				[xsl:otherwise]	
    					[tr] 
    						[td class="property_name"] [xsl:value-of select="name"/] [/td]
    						[td class="property_price"]
    							[span] [xsl:value-of select="currency"/] [/span]
    							[xsl:value-of select="price"/]
    						[/td]
    					[/tr]
    				[/xsl:otherwise]	
    			[/xsl:choose]
    		[/xsl:for-each]
    	[/table]
    [/xsl:template]
    [/xsl:stylesheet]

    Using XSL transformation, the above XML file is displayed in HTML as shown in this screenshot:

    This screenshot shows the sample data displayed in HTML.
  6. Click Add.
    A system generated ID is assigned to the property. The maximum size of a string property you can create is 64 KB, or the maximum length can be 65,535 characters. You can perform these actions:
    • Click Export to export the properties to an XML file.

    • Click Import, Browse, and select the XML file that you want to import.