give me an example of how to create a [Project Tas...
# ask-stanley-ai
m
give me an example of how to create a [Project Task] for an existing project (with project internalid = 123) with SuiteScript
c
AI generated answer (using internal Slack threads):
Based on the conversations provided, here is an example of how to create a Project Task for an existing project (with project internalid = 123) with SuiteScript:
Copy code
javascript
var record = require('N/record');

function createProjectTask() {
    var projectTask = record.create({
        type: record.Type.PROJECT_TASK,
        isDynamic: true
    });

    projectTask.setValue({
        fieldId: 'company',
        value: 123 // replace with your project's internal id
    });

    projectTask.setValue({
        fieldId: 'title',
        value: 'New Project Task'
    });

    // set other fields as needed

    var projectTaskId = projectTask.save();
    return projectTaskId;
}

createProjectTask();
This script creates a new project task and associates it with the project that has the internal id of 123. You can replace 'New Project Task' with the title of your task and add more fields as needed. ****** Disclaimer: This response was generated by an artificial intelligence assistant based on previous conversations from multiple Slack channels, and may contain inaccuracies or mistakes. ******
Slack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.825755775
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.821538925
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.818720222
Please provide your feedback on this answer.