(GMWEB) - Error, Failed to Create Contact, error when creating a new contact record within GoldMine Web when a LOOKUP.INI is in place which is triggering Ownership and Record Curtaining

Version 1

    Details

    (GMWEB) - Error, Failed to Create Contact, error when creating a new contact record within GoldMine Web when a LOOKUP.INI is in place which is triggering Ownership and Record Curtaining


    [PRE-REQUISITES]

    - Have a LOOKUP.INI in place assigning Ownership and Curtaining, here based on the COUNTRY value
    Note: Other fields would be also affected, due to the workflow how GMWEB is creating a new record

    [AUTOUPDATE]
    NewRecord=owner,status
    country=owner

    [owner]
    Lookup1=contact1->country
    Algeria=4algeria
    overwrite=1
    otherwise=5argenti

    [status]
    Lookup1=contact1->country
    overwrite=1
    otherwise=I2

    [STEPS TO PREPARE]
    1. Log in with master rights
    2. Tools > User Groups
    3. Create the following user groups one by one via 
    a. Button New
    b.  group1 (this will be 1group1 as Ownership value), group2 (ownership =  2group2), group3 (ownership = 3group3), Algeria (ownership = 4algeria),  Argentina (ownership = 5argenti)
    c. OK Button
    4. Close
    - Make sure that the testing non master user is member of the user group Algeria, but NOT of the user group Argentina
    5. Tools > Users Settings
    6. Highlight the user (here PATRICKS) > Button Properties
    7. Membership Tab
    8. Double click on Algeria which makes PATRICKS a Member of the group Algeria, he is still excluded from the group Argentina
    9. OK > Close
     
    [STEPS TO REPRODUCE]
    1. Log into GMPE as the non master user (PATRICKS)
    2. Button New Record
    3. Enter any values, but in Country enter Algeria
    4. OK
    5. verify the record created is available and set to correct ownership upon the LOOKUP.INI

    [RESULT]
    - The record is set to owner=4algeria and curtaining=I2 as  expected and PATRICKS as member of 4algeria can see the record normally




    6. Close GoldMine
    7. Log into GMWEB as the same non master user PATRICKS
    8. Just for verification > search and open the previously created  record so that you can verify that it is available also in GMWEB for the  user
    9. From the add data icon > Add Contact
    10. Enter again any values but make sure that the Country is filled with Algeria



    11. Create

    [RESULT]
    - On GMWEB screen: Server Error Error, failed to Create Contact. message on screen



    - The GMConnect.Log shows the error

    2015-10-13 12:27:26,254 - [ERROR] Thread id[20] - GoldMine.Models.ApplicationExceptions.ClientInformationException: Error running API method, statusCode = -5
     Error code: 32
    2015-10-13 12:27:26,254 - [ERROR] Thread id[20] - GoldMine.Models.ApplicationExceptions.ClientInformationException: Error, failed to Create Contact.,
    GoldMine.Models.ApplicationExceptions.ClientInformationException: Error running API method, statusCode = -5
       at GoldMine.Models.GoldMineAPI.GoldMineAPIEntry.ValidateStatusCode(XDocument xDocument)
       at GoldMine.Models.GoldMineAPI.GoldMineAPIEntry.CreateContact(IDictionary`2 fieldDictionary)
     
    - Iin GMPE, a master user can see that the contact record was created BUT  some of the information , here the Country is missing and the ownership  seems to be 'wrongly' set to 5argenti




    [DISCUSSION]

    - The root cause is how GMWEB creates the contact record opposite to GMPE, which can be seen in a SQL trace
    A. When a new record in GMPE is created the INSERT statement looks like and includes all entered fields

    exec  sp_executesql N'INSERT INTO "GMPE201410412LargeUSDemo"."dbo"."CONTACT1"   ("ACCOUNTNO","COMPANY","PHONE1","ZIP","COUNTRY","KEY1","STATUS","CREATEBY","CREATEON","CREATEAT","OWNER","LASTUSER","LASTDATE","LASTTIME","U_COMPANY","U_CONTACT","U_LASTNAME","U_CITY","U_STATE","U_COUNTRY","U_KEY1","U_KEY2","U_KEY3","U_KEY4","U_KEY5","recid")  VALUES  (@P1,@P2,@P3,@P4,@P5,@P6,@P7,@P8,@P9,@P10,@P11,@P12,@P13,@P14,@P15,@P16,@P17,@P18,@P19,@P20,@P21,@P22,@P23,@P24,@P25,@P26)',N'@P1  varchar(20),@P2 varchar(14),@P3 varchar(1),@P4 varchar(1),@P5  varchar(7),@P6 varchar(8),@P7 varchar(2),@P8 varchar(8),@P9  datetime,@P10 varchar(5),@P11 varchar(1),@P12 varchar(8),@P13  datetime,@P14 varchar(8),@P15 varchar(14),@P16 varchar(1),@P17  varchar(1),@P18 varchar(1),@P19 varchar(1),@P20 varchar(7),@P21  varchar(8),@P22 varchar(1),@P23 varchar(1),@P24 varchar(1),@P25  varchar(1),@P26 varchar(15)','B5101349120(#)>G>RM ','RM 233594  GMPE','','','Algeria','Prospect','U0','PATRICKS','2015-10-13  00:00:00','13:38','','PATRICKS','2015-10-13 00:00:00','13:38:40','RM  233594 GMPE','','','','','ALGERIA','PROSPECT','','','','','IORCRZ3!C[SC>)^'

    When  the Lookup triggers the Algeria is already available in Country and  therefore the LOOKUP.INI triggers correctly and UPDATES the ownership  and status with 4algeria and I2

    exec  sp_executesql N'UPDATE "GMPE201410412LargeUSDemo"."dbo"."CONTACT1" SET  "STATUS"=@P1,"OWNER"=@P2 WHERE "STATUS"=@P3 AND "OWNER"=@P4 AND  "recid"=@P5',N'@P1 varchar(2),@P2 varchar(8),@P3 varchar(2),@P4  varchar(1),@P5 varchar(15)','I2','4algeria','U0','','IORCRZ3!C[SC>)^'


    B. opposite to GMWEB where
    1. the INSERT statement looke liks (as can be seen there are only some few fields included) There is NOWHERE the COUNTRY
    exec  sp_executesql N'INSERT INTO "GMPE201410412LargeUSDemo"."dbo"."CONTACT1"   ("ACCOUNTNO","COMPANY","CONTACT","LASTNAME","PHONE1","EXT1","ZIP","STATUS","CREATEBY","CREATEON","CREATEAT","OWNER","LASTUSER","LASTDATE","LASTTIME","U_COMPANY","U_CONTACT","U_LASTNAME","U_CITY","U_STATE","U_COUNTRY","U_KEY1","U_KEY2","U_KEY3","U_KEY4","U_KEY5","recid")  VALUES  (@P1,@P2,@P3,@P4,@P5,@P6,@P7,@P8,@P9,@P10,@P11,@P12,@P13,@P14,@P15,@P16,@P17,@P18,@P19,@P20,@P21,@P22,@P23,@P24,@P25,@P26,@P27)',N'@P1  varchar(20),@P2 varchar(1),@P3 varchar(15),@P4 varchar(5),@P5  varchar(1),@P6 varchar(1),@P7 varchar(1),@P8 varchar(2),@P9  varchar(8),@P10 datetime,@P11 varchar(5),@P12 varchar(1),@P13  varchar(8),@P14 datetime,@P15 varchar(8),@P16 varchar(1),@P17  varchar(15),@P18 varchar(5),@P19 varchar(1),@P20 varchar(1),@P21  varchar(1),@P22 varchar(1),@P23 varchar(1),@P24 varchar(1),@P25  varchar(1),@P26 varchar(1),@P27 varchar(15)','B5101349430&,AQZ>RM  ','','RM 233594 GMWEB','GMWEB','','','','U0','PATRICKS','2015-10-13  00:00:00','13:43','','PATRICKS','2015-10-13 00:00:00','13:43:50','','RM  233594 GMWEB','GMWEB','','','','','','','','','IORD3XV&?2A4>)^'

    2.  The LOOKUP.INI triggers and adjusts the ownership 'incorrectly' with  the otherwise statement as at this point NO COUNTRY value is available  which closes the door for the Non master user, which leads to the error  message on screen

    exec sp_executesql N'UPDATE  "GMPE201410412LargeUSDemo"."dbo"."CONTACT1" SET "STATUS"=@P1,"OWNER"=@P2  WHERE "STATUS"=@P3 AND "OWNER"=@P4 AND "recid"=@P5',N'@P1  varchar(2),@P2 varchar(8),@P3 varchar(2),@P4 varchar(1),@P5  varchar(15)','I2','5argenti','U0','','IORD3XV&?2A4>)^'


    C. The complete GMWEB process can be seen when the user is also member of Argentina user group

    1. SQL:
    exec  sp_executesql N'INSERT INTO "GMPE201410412LargeUSDemo"."dbo"."CONTACT1"   ("ACCOUNTNO","COMPANY","CONTACT","LASTNAME","PHONE1","EXT1","ZIP","STATUS","CREATEBY","CREATEON","CREATEAT","OWNER","LASTUSER","LASTDATE","LASTTIME","U_COMPANY","U_CONTACT","U_LASTNAME","U_CITY","U_STATE","U_COUNTRY","U_KEY1","U_KEY2","U_KEY3","U_KEY4","U_KEY5","recid")  VALUES  (@P1,@P2,@P3,@P4,@P5,@P6,@P7,@P8,@P9,@P10,@P11,@P12,@P13,@P14,@P15,@P16,@P17,@P18,@P19,@P20,@P21,@P22,@P23,@P24,@P25,@P26,@P27)',N'@P1  varchar(20),@P2 varchar(1),@P3 varchar(31),@P4 varchar(9),@P5  varchar(1),@P6 varchar(1),@P7 varchar(1),@P8 varchar(2),@P9  varchar(8),@P10 datetime,@P11 varchar(5),@P12 varchar(1),@P13  varchar(8),@P14 datetime,@P15 varchar(8),@P16 varchar(1),@P17  varchar(31),@P18 varchar(9),@P19 varchar(1),@P20 varchar(1),@P21  varchar(1),@P22 varchar(1),@P23 varchar(1),@P24 varchar(1),@P25  varchar(1),@P26 varchar(1),@P27 varchar(15)','B5101349784#`NX+>RM  ','','RM 233594 now also in  argentina','argentina','','','','U0','PATRICKS','2015-10-13  00:00:00','13:49','','PATRICKS','2015-10-13 00:00:00','13:49:44','','RM  233594 NOW ALSO IN  ARGENTINA','ARGENTINA','','','','','','','','','IORDHKR&I?$R>)^'
    NO COUNTRY
    2. SQL
    trigger the LOOKUP.INI incorrectly as the country is also here blank:
    exec  sp_executesql N'INSERT INTO "GMPE201410412LargeUSDemo"."dbo"."CONTACT1"   ("ACCOUNTNO","COMPANY","CONTACT","LASTNAME","PHONE1","EXT1","ZIP","STATUS","CREATEBY","CREATEON","CREATEAT","OWNER","LASTUSER","LASTDATE","LASTTIME","U_COMPANY","U_CONTACT","U_LASTNAME","U_CITY","U_STATE","U_COUNTRY","U_KEY1","U_KEY2","U_KEY3","U_KEY4","U_KEY5","recid")  VALUES  (@P1,@P2,@P3,@P4,@P5,@P6,@P7,@P8,@P9,@P10,@P11,@P12,@P13,@P14,@P15,@P16,@P17,@P18,@P19,@P20,@P21,@P22,@P23,@P24,@P25,@P26,@P27)',N'@P1  varchar(20),@P2 varchar(1),@P3 varchar(31),@P4 varchar(9),@P5  varchar(1),@P6 varchar(1),@P7 varchar(1),@P8 varchar(2),@P9  varchar(8),@P10 datetime,@P11 varchar(5),@P12 varchar(1),@P13  varchar(8),@P14 datetime,@P15 varchar(8),@P16 varchar(1),@P17  varchar(31),@P18 varchar(9),@P19 varchar(1),@P20 varchar(1),@P21  varchar(1),@P22 varchar(1),@P23 varchar(1),@P24 varchar(1),@P25  varchar(1),@P26 varchar(1),@P27 varchar(15)','B5101349784#`NX+>RM  ','','RM 233594 now also in  argentina','argentina','','','','U0','PATRICKS','2015-10-13  00:00:00','13:49','','PATRICKS','2015-10-13 00:00:00','13:49:44','','RM  233594 NOW ALSO IN  ARGENTINA','ARGENTINA','','','','','','','','','IORDHKR&I?$R>)^'

    3. SQL:
    Updating the Country and therefore again straight away the Ownerhship
    exec  sp_executesql N'UPDATE "GMPE201410412LargeUSDemo"."dbo"."CONTACT1" SET  "DEPARTMENT"=@P1,"TITLE"=@P2,"ADDRESS2"=@P3,"COUNTRY"=@P4,"OWNER"=@P5,"U_COUNTRY"=@P6  WHERE "DEPARTMENT" IS NULL AND "TITLE" IS NULL AND "ADDRESS2" IS NULL  AND "COUNTRY" IS NULL AND "OWNER"=@P7 AND "U_COUNTRY"=@P8 AND  "recid"=@P9',N'@P1 varchar(2),@P2 varchar(8),@P3 varchar(4),@P4  varchar(7),@P5 varchar(8),@P6 varchar(7),@P7 varchar(8),@P8  varchar(1),@P9  varchar(15)','KA','Director','test','Algeria','4algeria','ALGERIA','5argenti','','IORDHKR&I?$R>)^'

     



    Resolution

    [CAUSE]
    This is RM # 233594 - (GMWEB) - Error, Failed to Create Contact, due  to the initial INSERT statement for new records taking over only some  fields, causing the LOOKUP.INI already triggering on wrong values.

    [RESOLUTION]
    - This RM # 233594 was fixed in GoldMine 2015.2 Hot fix 1 and higher
    - While usually GoldMine Connect 2015.2 Hot fix 1 and GoldMine Premium Edition 2015.2 Hot fix 1 do not need to be installed in tandem, for the specific behavior it is necessary to upgrade both applications to GoldMine 2015.2 Hot fix 1
    - This means that GoldMine Premium Edition must be at least on 2015.2 Hot fix 1 (build 2015.2.0.173) and GoldMine Connect must be at least on 2015.2 Hot fix 1 (build 2015.2.0.348).  Once both  applications are on a 2015.2. Hot fix 1 version the scenarios described in related Knowledge Article # 20096 will apply, unless there will be a further exception documented.