GoldMine Web (GMWEB) - When drilling down into an Opportunity - Server Error: Unknown Server Error or Server Error: Error, one of the arguments provided to a method is not valid.

Version 2

    Details

    GoldMine Web (GMWEB) - When drilling down into an Opportunity - Server Error: Unknown Server Error or Server Error: Error, one of the arguments provided to a method is not valid.
    - Log file Error: Error, one of the arguments provided to a method is not valid., System.ArgumentException: Object of type 'System.Byte[]' cannot be converted to type 'System.String'.


    [STEPS]
    - Opportunities seem to work in GoldMine Premium Edition as expected



    1. Log into GMWEB
    2. Open the OPPORTUNITIES  page
    >> RESULT: the list of all Opportunities will be loaded as expected
    3. Try to drill down into any opportunity or search and open a certain opportunity
    >> RESULT:
    - Error message in GMConnect 2015.2 HF1 when drilling down into an opportunity from the OPPORTUNITIES page



    - Error message in GMConnect 2015.2 HF2 when drilling down into an opportunity from the OPPORTUNITIES page




    - The related GMConnect.Log error when drilling down on an opportunity on the OPPORTUNITIES page

    2016-02-03 16:25:45,611 - [ERROR] Thread id[7] - GoldMine.Models.ApplicationExceptions.ClientInformationException: Error, one of the arguments provided to a method is not valid.,
    System.ArgumentException: Object of type 'System.Byte[]' cannot be converted to type 'System.String'.

       at System.RuntimeType.TryChangeType(Object value, Binder binder, CultureInfo culture, Boolean needsSpecialCast)
       at System.RuntimeType.CheckValue(Object value, Binder binder, CultureInfo culture, BindingFlags invokeAttr)
       at System.Reflection.MethodBase.CheckArguments(Object[] parameters, Binder binder, BindingFlags invokeAttr, CultureInfo culture, Signature sig)
       at System.Reflection.RuntimeMethodInfo.InvokeArgumentsCheck(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
       at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
       at QueryBuilder.Entity`1.SetPopertyValueFromDataReader(PropertyInfo prop, Object obj, SqlDataReader reader, Int32 iCol)
       at QueryBuilder.Entity`1.SetValueFromDataReader(PropertyInfo prop, Object obj, SqlDataReader reader, Int32 iCol, SelectStruct sel)
       at QueryBuilder.Entity`1.CreateResultingEntity(List`1 sel, SqlDataReader reader)
       at QueryBuilder.Entity`1._GetResult(ICustDatabase database, Boolean CheckIfEntityCanBeAdd)


    Additional Note:
    - Error message in GMConnect 2015.2 HF2 when opening Opportunities section on a contact record from the CONTACTS page




    >> There is no related GMConnect.Log error when opening the Opportunities section on a contact's record from the CONTACTS page (see also related Knowledge Article # 21319)


    Resolution

    [CAUSE]
    - In this specific case the identified reason for the experienced  behavior for drilling down on opportunities on the OPPORTUNITIES is the  NOTES field, which is of data type image instead of text. This was most  likely done by accident during the upgrade process when some conversion  issues were experienced. It is necessary to correct this structural  problem within the OPMGR table within the GoldMine database.

    - If another field would be affected the error message should be usually the same but may appear already when opening the OPPORTUNITIES page, and log file entries may be identical from the error but the additional information might be different for example

    2016-02-03 17:12:55,217 - [ERROR] Thread id[7] - GoldMine.Models.ApplicationExceptions.ClientInformationException: Error, one of the arguments provided to a method is not valid.,
    System.ArgumentException: Object of type 'System.String' cannot be converted to type 'System.Nullable`1[System.DateTime]'.

       at System.RuntimeType.TryChangeType(Object value, Binder binder, CultureInfo culture, Boolean needsSpecialCast)
       at System.RuntimeType.CheckValue(Object value, Binder binder, CultureInfo culture, BindingFlags invokeAttr)
       at System.Reflection.MethodBase.CheckArguments(Object[] parameters, Binder binder, BindingFlags invokeAttr, CultureInfo culture, Signature sig)
       at System.Reflection.RuntimeMethodInfo.InvokeArgumentsCheck(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
       at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
       at QueryBuilder.Entity`1.SetPopertyValueFromDataReader(PropertyInfo prop, Object obj, SqlDataReader reader, Int32 iCol)
       at QueryBuilder.Entity`1.SetValueFromDataReader(PropertyInfo prop, Object obj, SqlDataReader reader, Int32 iCol, SelectStruct sel)
       at QueryBuilder.Entity`1.CreateResultingEntity(List`1 sel, SqlDataReader reader)
       at QueryBuilder.Entity`1._GetResult(ICustDatabase database, Boolean CheckIfEntityCanBeAdd)

    - It is necessary to verify the default and necessary back end structure of the OPMGR (it is recommended also to check the OPMGRFLD table although currently this table is not used in GoldMine Web)

    - The GoldMine database structure from the specific version for the default tables is determined and CANNOT be changed apart from user defined fields in the CONTACT2 and OPMGR table. The definition of all tables is written into the DATADICT.XML file in the GoldMine installation folder. This file can be reviewed in order to determine the correct data types and length for the specific table in question. For further information about this file, please refer to the related Knowledge Article # 21320


    [STEPS]

    A. Try to rebuild the OPMGR and OPMGRFLD table

    - Depending on the specific mismatch on the structure  of the table a rebuild may fail, but this should be always the first  attempt >> the event viewer shows further details and may appear  with an error    Description: Operand type clash: image is incompatible with text

    - The following changes need to be made

    • Before or after business hours
    • When no one is logged into GoldMine and all related services, integration or applications are shut down or stopped.
    • After making sure to have a full running backup of the GoldMine database
    • The IIS is stopped on the GoldMine Web web server

    1. Make sure that all users are logged out of GoldMine and all services related to GoldMine are shut down (e.g. GoldSync)

    2. Make sure that all users are logged off or have closed all applications with an integration into GoldMine (e.g. GMConnect, Outlook, Word etc)

    3. Make sure to have a full running backup of your GoldMine database

    4. In GoldMine with master rights

    5. Tools >> Databases >> Maintain Database…
    6. Individual Files >> Next

    7. Select OPMGR and OPMGRFLD tables from the list >> Next

    8. Select Rebuild and Pack the database files >> there appears a message that SQL tables need not to be rebuilt unless a table restructure is required… >> confirm this message

    9. Select Sort the database files + Verify the data and synchronization information >> Next

    10. Although there should be no user logged in anymore it might be recommended to select the Force all users to exit GoldMine with 1 minute >> Next

    11. Finish

    12. Re-test the behavior



    B. In case the Rebuild fails with an error message - Failed to to copy records from OPMGR to GOLDMINECOPYTEMPTABLE


    -  Database structure changes are outside the Support Boundaries of  GoldMine Technical Support, in the same manner as correcting them via a  back end manipulation again.


    >> The below steps to resolve are  provided as is without any warranties of any kind. The customer may  want to discuss with a SQL DBA prior adjusting the back end. Especially  in this case no data loss is expected as the field was already changed a  while ago and existing data at that point were already lost, also in  the interface of GMPE this specific field is not used anymore as  Opportunity notes were 'moved' into the NOTES table with a RECTYPE =  'OP' since GMPE 8.5.x

    - If other fields need to be changed it is necessary to discuss further with your GoldMine partner or a SQL DBA as due to the conversion or recreation of a field existing values might be lost

    - From some research it appears that one should not simply  change the datatype on the existing column but instead rename this  existing column and then create a new matching column.

    - The following changes need to be made
    • Before or after business hours
    • When no one is logged into GoldMine and all related services, integration or applications are shut down or stopped.
    • After making sure to have a full running backup of the GoldMine database
    • The IIS is stopped on the GoldMine Web web server
    1. Open the SQL Server Management Studio on the SQL server
    2. Browse to the GoldMine database
    3. Browse to the table OPMGR
    4. Expand the Columns
    5. Right click on the column NOTES >> Rename
    6. Change the name from NOTES to NOTES_OLD
    7. Right click on the table OPMGR >> Design
    8. On the right pane >> at the bottom enter a new row (this will be the new NOTES column)
    9. Column name = NOTES, Data type = text, make sure Allow NULLS is activated
    10. By highlighting the new row, drag it between CLOSEAMT and PRODUCTNAME
    11. By highlighting the row NOTES_OLD, drag it to the bottom of the table (after recid row)
    12.  In the SQL Server Management Studio menu >> Select Tools >>  Options >> on the left pane select Designers >> Table and  Database Designers >> make sure to deactivate on the right the  option Prevent saving changes that require table re-creation >> OK
    13. Save now the changes via the disc icon
    14. Make a refresh on the GoldMine database and browse again to the OPMGR table >> expand the Columns
    >> the structure should now look like the following


    15. Start GoldMine and verify that you can access Opportunities
    16. Start IIS again
    17.  Log into GMWEB and verify that you now can also access and drill down  into opportunities from the OPPORTUNITIES page and also from a certain  contact record on the CONTACTS page

    - Once it is verified that the behavior does not occur anymore, make sure to select again  the option Prevent saving changes that require table re-creation in the  SQL Server Management Studio's Options (as described in step 12)

    - A SWF flash video for review or download is available at http://www.screencast.com/t/EWxkw2A4