This topic contains 2 replies, has 0 voices, and was last updated by JohnCCole 6 years, 5 months ago.

  • Author
    Posts
  • #17885

    Vesku1980

    Hi,

    I have a customer with almost 800 projects.

    We have a need to set up primary contact via script.

    I imagine to do this with mass update script.

    Adding the contact is working fine, but i can’t set role as primary contact.

    Has anyone done this ?

    var id = record.attach({

    record: {

    type: ‘contact’,

    id: obj[params.id]

    },

    to: {

    type: params.type,

    id: params.id,

    attributes: {

    role: -10,

    }

    }

    });

    Vesku
    This is a cached copy. Click here to see the original post.

  • #17886

    MChammaTX

    It’s a bit of a long shot but for the record id and attributes role try changing the data type between string and number. I’ve noticed some weird behavior in 2.0 regarding data types. Other than that it looks correct to me.

  • #17887

    JohnCCole

    The code looks wrong to me attributes options is not part of the to block according to the documentation shouldn’t it be

    Code:
    var id = record.attach({
    record: {
    type: ‘contact’,
    id: obj[params.id]
    },
    to: {
    type: params.type,
    id: params.id
    },
    attributes: {
    role: -10
    }
    });

You must be logged in to reply to this topic.