Error getting value from 'type_name' on 'GmModels.HistoryActivity'.  Error occurred while serialization to JSON type. - When trying to open contact in GoldMine Web or sometimes when opening history of a contact in GoldMine Web.

Version 1

    Details

    When attempting to drill down on a contact record after logging into GoldMine Web, the following error happens:

    Error getting value from 'type_name' on 'GmModels.HistoryActivity'.  Error occurred while serialization to JSON type


     GoldMine.Models.ApplicationExceptions.ClientInformationException: Error getting value from 'type_name' on 'GmModels.HistoryActivity'. Error occured while serialization to JSON type, 
    Newtonsoft.Json.JsonSerializationException: Error getting value from 'type_name' on 'GmModels.HistoryActivity'. ---> System.Exception: Unknown activity type Ca
       at GmModels.HistoryActivity.get_type_name()
       at Gettype_name(Object )
       at Newtonsoft.Json.Serialization.DynamicValueProvider.GetValue(Object target)
       --- End of inner exception stack trace ---
       at Newtonsoft.Json.Serialization.DynamicValueProvider.GetValue(Object target)
       at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializeObject(JsonWriter writer, Object value, JsonObjectContract contract, JsonProperty member, JsonContract collectionValueContract)
       at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializeValue(JsonWriter writer, Object value, JsonContract valueContract, JsonProperty member, JsonContract collectionValueContract)
       at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializeList(JsonWriter writer, IWrappedCollection values, JsonArrayContract contract, JsonProperty member, JsonContract collectionValueContract)
       at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializeValue(JsonWriter writer, Object value, JsonContract valueContract, JsonProperty member, JsonContract collectionValueContract)
       at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.WriteMemberInfoProperty(JsonWriter writer, Object memberValue, JsonProperty property, JsonContract contract)
       at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializeObject(JsonWriter writer, Object value, JsonObjectContract contract, JsonProperty member, JsonContract collectionValueContract)
       at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializeValue(JsonWriter writer, Object value, JsonContract valueContract, JsonProperty member, JsonContract collectionValueContract)
       at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.Serialize(JsonWriter jsonWriter, Object value)
       at Newtonsoft.Json.JsonSerializer.SerializeInternal(JsonWriter jsonWriter, Object value)
       at Newtonsoft.Json.JsonConvert.SerializeObject(Object value, Formatting formatting, JsonSerializerSettings settings)
       at GoldMineMobile.Controllers.Common.JsonSerializer.SerializeObject(Object data)
       at GoldMineMobile.Controllers.Common.JsonDataContractResult.ExecuteResult(ControllerContext context)

     


    Resolution

    [CAUSE]
    - An invalid RECTYPE value is in the CONTHIST database.
    - The key part of the error was obtained from the GMConnect.txt log.  Please see Knowledge Article 20382 regarding "How to gather GoldMine Connect Log files?"

    - The part of the log that was most important was:
    " GoldMine.Models.ApplicationExceptions.ClientInformationException: Error getting value from 'type_name' on 'GmModels.HistoryActivity'. Error occured while serialization to JSON type, 
    Newtonsoft.Json.JsonSerializationException: Error getting value from 'type_name' on 'GmModels.HistoryActivity'. ---> System.Exception: Unknown activity type Ca"

    - The reason the above portion "...Unknown activity type Ca..." was important because this tells us where to look.
    - Completed Activities are held in the CONTHIST table of GoldMine.
    - "activity type" data is held in the RECTYPE column in the CONTHIST table.
    - The RECTYPE column contains up to 10 characters of which the first two characters are the Activity Type.
    - Valid entries for the first two positions of the RECTYPE column of the CONTHIST table are as follows:
    A  Appointment
    C  Phone call
    CC  Call back
    CI Incoming call
    CM Returned message
    CO Outgoing call
    D To-do
    E Event
    L Form
    M Sent message
    MG E-mail message
    MI Received e-mail
    MO Sent e-mail
    O Other
    S Sale
    T Next action
    U Unknown


    [RESOLUTION]
    - The following query can be used in SQL Server Management Studio which will group all RECTYPE entries from the CONTHIST table:
    select count(*), Rectype from conthist group by rectype order by rectype asc

    - If just a handful of entries are found then it would be easily possible to find the record in the GoldMine front-end by copying the ACCOUNTNO value and searching in the Contact Search Center.  Then the history item could be opened via the interface and updated. (run query from above again to verify)
    - In this case there were over 2000 entries with the value of "Call" which is not a valid entry where position 1 is "C" and position 2 is "a" hence the error in the log stating "Unknown activity type Ca"


    - Update or delete the entries in the CONTHIST table where RECTYPE has a value of "Call"

    NOTE: Backend data manipulation is not advised or supported.  Backend data manipulation can have unintended and severe consequences It is best to seek the assistance of a GoldMine Solutions Partner to determine the best method to proceed.