This topic contains 1 reply, has 0 voices, and was last updated by egrubaugh 7 years, 10 months ago.

  • Author
    Posts
  • #6382 Score: 0

    PaulGregson
    • Contributions: 0
    • Level 1

    It’s been months since I wrote any Suitescript so I’m a little rusty. Trying to create a project task, but it’s not working.

    I know I need to tell it which project the task is for somehow, I’m trying to use company, and taking the companyname property from the project, but that’s not working.

    var projectTask = nlapiCreateRecord(‘projecttask’);

    projectTask.setFieldValue(‘company’,projectName);

    projectTask.setFieldValue(‘title’,taskName);

    nlapiSubmitRecord(projectTask);

    The error I’m getting is “Invalid company reference key “
    This is a cached copy. Click here to see the original post.

  • #6383 Score: 0

    egrubaugh
    • Contributions: 0
    • Level 1

    If projectName and taskName are names and not internal IDs, then you need to use setFieldText instead of setFieldValue

You must be logged in to reply to this topic.