licenseProfObject

You can use this object to interact with the reference licensed professional entities in Civic Platform and to provide many methods to streamline the most common interactions.

Version

2.0

Constructors

Populates licenseProfObject with the license number and license type.

Constructor Type Description
licnumber string License number to retrieve. This number is the RSTATE_LIC value.
lictype string License type to retrieve.

Example

var myLic = licenseProfObject("1234","Business");

Parameters

Parameter Description
attribs An associate array populated with all the valid licensed professional attributes. When valid attributes exist the validAttrs flag sets to true indicating values are available. Use the getAttribute and setAttribute methods to access the licensed professional attribute instead of directly accessing the attribs parameter.
infoTables This parameter exposes the people info tables multiple dimension array of the following format: infoTables[tableName][row][column]. To access the value of this field you must use the getValue() for the column and to set the value you must use the setValue(val). To add or delete rows please review the methods section for addTableRow(), removeTable(), and removeTableRow().
refLicModel This parameter loads on object creation and provides direct access to the licensed professional model.
valid Boolean flag set to indicate if object has a valid reference license professional loaded.
  • true = valid professional found
  • false = no professional found
validAttrs Boolean flag set to indicate if object has valid reference licensed professional attributes loaded.
  • true = valid professional found
  • false = no professional found
validTables Boolean flag set to indicate if object has valid people info tables loaded.
  • true = valid professional found
  • false = no professional found

Example (attribs)

Ex.  
if(myLic.validAttrs) 
  var myValu = myLic.attribs["Is Valid Business?"]; 
 
//List attributes 
if(myLic.validAttrs) 
   for(attrib in myLic.attribs) 
      logDebug(attrib + " : " + myLic.attribs[attrib]); 

Example (infoTables)

//get value 
myLic.infoTables["Codes"][0]["Type"].getValue(); 
 
//set value 
myLic.infoTables["Codes"][0]["Type"].setValue("Type III"); 
 
//list all values 
If(myLic.validTables) 
   for(table in myLic.infoTables) 
      for(row in myLic.infoTables[table]) 
         for(col in myLic.infoTables[table][row]) 
            logDebug(table + " : " + row + " : " + col + " : " + myLic.infoTables[table][row][col].getValue(); 

Example (refLicModel)

myLic.refLicModel.getLicenseType(); 

Example (valid)

var myLic = licenseProfObject("1234","Business"); 
if(myLic.valid) 
  //do actions 

Methods

  • addTableFromASIT

    This method copies ASI Tables to reference licensed professional people info tables. This method attempts to add all rows from the ASI Table array to the people info table array for all matching columns.

    • Parameters

      Parameter Type Description
      tableName string Name of people info table.
      ASITArray ASIT Array ASI table array that master script loads.
    • Return

      If ASI Table loads successfully into the people info tables, the method returns true. If the load fails the method returns false.

    • Example

      myLic.addTableFromASIT("myTable", CERTIFICATIONS);
  • addTableRow

    Add a new row to the people info table utilizing an associative string array.

    • Parameters

      Parameter Type Description
      tableName string Name of people info table.
      valueArray string array Associative string array where the index name is the column name to load.
    • Example

      var newRow = new Array(); 
      newRow["Column1"] = "A"; 
      newRow["Column2"] = "B"; 
      myLic.addTableRow("myTable",newRow); 
      myLic.updateRecord(); 
  • copyToRecord

    Copies the current reference licensed professional to the specified record id.

    • Parameters

      Parameter Type Description
      capId CapIDModel Record to copy the licensed professional to.
      replace boolean Flag if existing LP should be replace if found.
    • Example

      myLic.copyToRecord(capId,true);
  • disable

    Disables the licensed professional

    • Parameters

      None

  • enable

    Enables the licensed professional

    • Parameters

      None

  • getAssociatedRecords

    Retrieves all records associated to the reference licensed professional in an array.

    • Parameters

      None

    • Example

      var capArray = myLic.getAssociatedRecords();
  • getAttribute

    Get method for getting a licensed professional attribute value.

    • Parameters

      Parameter Type Description
      attributeName string Reference license professional attribute name.
    • Notes

      Method handles error checking. Use this method instead of directly accessing the parameter.

    • Example

      var val = myLic.getAttribute("myValue");
  • getMaxRowByTable

    Gets the max row number for a people info table.

    • Parameters

      Parameter Type Description
      tableName string People info table name to get the max row from.
    • Return

      Returns -1 if no rows exist.

  • refreshTables

    Refreshes the people info table arrays in the object with the data found in database.

    • Parameters

      None

  • removeTable

    Removes all rows from a people info table.

    • Parameters

      Parameter Type Description
      tableName string People info table name to remove.
  • removeTableRow

    Removes provided row index from provided table.

    • Parameters

      Parameter Type Description
      tableName string People info table name to remove row from.
      rowIndex long Row index to remove.
    • Return

      If method removes the row, returns true. Otherwise, returns false.

  • setAttribute

    Sets a reference license professional attribute to the provided value and performs error checking.

    • Parameters

      Parameter Type Description
      attributeName string Reference license professional attribute name.
      attributeValue string Reference license professional attribute value to set.
    • Return

      If method sets value, returns true. Otherwise, returns false.

    • Example

      If( myLic.setAttribute("myValue","newValue") ) 
          logDebug("Value Updated"); 
  • setDisplayInACA4Table

    Sets the flag to display the reference people info table in Citizen Access.

    • Parameters

      Parameter Type Description
      tableName string Name of the people info table.
      visibleFlag string Valid flag values are Y to display the table in Citizen Access or N to hide the table from Citizen Access.
  • setTableEnabledFlag

    Sets the enabled flag displayed on the people info tables to yes or no for the provided table row.

    • Parameters

      Parameter Type Description
      tableName string People info table name to remove row from.
      rowIndex long Row index to remove.
      isEnabled boolean Enabled flag.
    • Return

      Returns true if update is successful.

    • Example

      myLic.setTableEnabledFlag("myTable",0,false);
  • updateFromAddress

    This method updates the reference professional with the address information from the provided record.

    • Parameters

      Parameter Type Description
      capId CapIDModel Record to get the address information from.
    • Return

      If update is successful the method returns true, otherwise the method returns false.

    • Notes

      The method first attempts to use the primary address. If no primary address exists the method selects the first address available on the Record.

      If the method finds an address the method then attempts to copy the Address Line 1, Address Line 2, City, State, and Zip to the reference licensed professional. In the event an Address Line 1 is not available it attempts to create the line one by concatenating the house number, street direction, street name, street suffix, unit type, and unit number.

  • updateFromRecordContactByType

    This method attempts to update the contact information on a reference licensed professional from a record contact.

    • Parameters

      Parameter Type Description
      capId CapIDModel Record to get the contact information from.
      contactType string Contact type to search, use "" for primary.
      updateAddress boolean Set to true to update address information.
      updatePhoneEmail boolean Set to true to update phone information and email information.
    • Return

      If the update is successful the method returns true. If the update fails it returns false.

    • Notes

      To attempt to use the primary contact use an empty string ("") from the contact type. If you provide a contact type and there are multiple with the same contact type, the method uses the first occurrence of the contact type in the event .

      When found the method updates the first, middle, last, and business name on the reference licensed professional with the first, middle, last, and business name of the contact record.

      If the updateAddress flag is true then the method attempts to copy the address line 1, address line 2, address line 3, city, state, and zip from the contact record to the associate fields of the reference licensed professional.

      If the updatePhoneEmail flag is true then the method also attempts to copy the phone1, phone2, phone3, email, and fax to the associate fields on the reference licensed professional record.

  • updateFromRecordLicensedProf

    This method attempts to update the reference licensed professional utilizing a transactional licensed professional.

    • Parameters

      Parameter Type Description
      capId CapIDModel Record to get the license professional information from.
    • Return

      If the update is successful the method returns true. If the update fails it returns false.

    • Notes

      This method searches the provided record for a transactional license professional of the same number and the same type. If the method finds a match, the method attempts to copy all licensed professional information from the transactional record to the reference record.

  • updateRecord

    This method commits all changes made to the reference licensed professional object to the database.

    • Parameters

      None

    • Return

      If the update is successful the method returns true. If the update fails it returns false.

    • Notes

      If you do not invoke this method, you lose all updates made to the licensed professional prior to the last update.

    • Example

      myLic.updateRecord();