When to change ownership for records via the LOOKUP.INI - there are field values with n/a after the LOOKUP.INI evaluated a contact record

Version 1

    Details

    Important consideration when Ownership shall be changed for records via the LOOKUP.INI - there are field values with n/a after the LOOKUP.INI evaluated a contact record

    [SCENARIO]
    - having 2 user groups - 1group1' or '2group2'
    - each user group owns their specific contact records - CONTACT1.OWNER = '1group1' or CONTACT1.OWNER='2group2'
    - each contact record shall be curtained completely from the other user group's members - CONTACT1.STATUS = &substr(contact1->status,1,1)+"2"+substr(contact1->status,3,1)
    - any user having access on current record can 'assign' the record to the other group which requires then that the ownership and the record curtaining is set correctly.


    [PRE-CONDITIONS]
    - GoldMine User groups:
    Group1 – (GoldMine internal '1group1') – Member is USER1 (NON MASTER)
    Group2 – (GoldMine internal '2group2') – Member is USER2 (NON MASTER)
    additionally a MASTER user

    - a user can 'reassign' a contact record by either changing the KEY4 to the other user group or from menu Edit >> Record Properties >> Record Related settings >> Tab ownership.
    - The LOOKUP.INI shall always make sure that the 2nd character within STATUS field is ‘changed’ to a 2 so that the record will be completely curtained.

    - The current LOOKUP.INI:
    [AutoUpdate]
    owner=key4,status
    key4=owner,status

    [key4]
    Lookup1=owner
    1group1=Group1
    2group2=Group2
    Overwrite=1

    [owner]
    lookup1=key4
    Group1=1group1
    Group2=2group2
    Overwrite=1

    [status]
    lookup1=contact
    otherwise=&substr(contact1->status,1,1)+"2"+substr(contact1->status,3,1)
    overwrite=1


    [STEPS TO PREPARE]
    1. Login as MASTER
    2. Browse to Lauren Hall
    3. Set in KEY4 = Group1
    4. Verify the OWNER and STATUS field
    >> the LOOKUP.INI works for the user with master rights as it changes OWNER="1group1" and STATUS=" 2 " as desired
    5. Browse to Art Bardtoll
    6. Set in KEY4 = Group2
    7. Verify the OWNER and STATUS field
    >> the LOOKUP.INI works for the user with master rights as it changes OWNER="2group2" and STATUS=" 2 " as desired


    [STEPS TO REPRODUCE]
    1. As USER1
    2. Browse to Lauren Hall
    3. Set in KEY4 = Group2
    4. Verify the OWNER and STATUS field
    >> RESULT1

    5. As USER2 (remember this is a NON MASTER user)
    6. Browse to Art Bardtoll
    7. Set in KEY4 = Group1
    8. Verify the OWNER and STATUS field
    >> RESULT2

    9. as MASTER
    10. Browse to Bea Defkow
    11. Set in KEY4 = Group1
    12. Verify the OWNER and STATUS field
    >> RESULT3

    [RESULT]
    RESULT1: the OWNER field is set correctly to 2group2, the STATUS field shows n/a. (incorrect)
    RESULT2: the OWNER field is set correctly to 1group1, the STATUS field shows n/a. (incorrect)
    RESULT3: the OWNER field is set correctly to 1group1, the STATUS field shows U2  (correct)
    >> Only changes from users with master rights are changed correctly



    Resolution

    [CAUSE]
    - The reason for this behavior is the logical workflow in the background. As soon as the OWNER is changed the contact record is not accessible anymore by the current user, means the STATUS field cannot be written back properly into the database and therefore appears as n/a.
    - The LOOKUP.INI takes field per field from the definition part key4=owner,status which means the first field triggered by the change will be OWNER. This field will be set e.g. to 2group2 and as USER1 is not a member of this group and therefore NO owner anymore any field afterwards cannot be processed correctly anymore.
    - This can easily be verified with the following change / amendment of the original LOOKUP.INI, means the STATUS field will be set before the OWNER field and instead the USERDEF01 will be added after the OWNER

    [AutoUpdate]
    owner=key4,status
    key4=status,owner, userdef01

    [key4]
    Lookup1=owner
    1group1=Group1
    2group2=Group2
    Overwrite=1

    [owner]
    lookup1=key4
    Group1=1group1
    Group2=2group2
    Overwrite=1

    [status]
    lookup1=contact
    otherwise=&substr(contact1->status,1,1)+"2"+substr(contact1->status,3,1)
    overwrite=1

    [userdef01]
    lookup1=contact
    otherwise=&substr(contact1->status,1,1)+"2"+substr(contact1->status,3,1)
    overwrite=1

    >> Now the STATUS field will be evaluated correctly but USERDEF01 will now expose the wrong behavior

    [RESOLUTION]
    - In the LOOKUP.INI all necessary / applicable fields need to be evaluated before the OWNER, means the OWNER needs to be always the LAST field in the definition

    - The original LOOKUP.INI needs to be adjusted in order to work correctly

    [AutoUpdate]
    owner=key4,status
    key4=status,owner

    [key4]
    Lookup1=owner
    1group1=Group1
    2group2=Group2
    Overwrite=1

    [owner]
    lookup1=key4
    Group1=1group1
    Group2=2group2
    Overwrite=1

    [status]
    lookup1=contact
    otherwise=&substr(contact1->status,1,1)+"2"+substr(contact1->status,3,1)
    overwrite=1