Skip to main content
Solved

inserting project tasks under existing project using REST API

  • Jun 27, 2023 11:22 PM UTC
  • 4 replies
  • 315 views
  • Translate All

Driss
Jr Varsity III
Forum|alt.badge.img

Hey Team 

 

Hope everyone here is doing well

 

i’m trying to create project tasks under existing project using Rest API

 

 

Endpoint : {{baseUrl}}/ProjectTask
Method : PUT

Headers : Content-Type:application/json


Body : 

 

{
  "ProjectID": {
    "value": "100349"
  },
  "ProjectTaskID": {
    "value": "L-726483"
  },
  "Description": {
    "value": "TEST"
  },
  "VisibilitySettings": {
    "GL": {
      "value": "true"
    },
    "AP": {
      "value": "true"
    },
    "CRM": {
      "value": "true"
    },
    "Expenses": {
      "value": "true"
    },
    "IN": {
      "value": "true"
    },
    "PO": {
      "value": "true"
    },
    "SO": {
      "value": "true"
    },
    "TimeEntries": {
      "value": "true"
    },
    "AR": {
      "value": "true"
    },
    "CA": {
      "value": "true"
    }
  }
}

 

 

Error : 

"Inserting  'Project Task' record raised at least one error. Please review the errors.\nProjectID: 'Project ID' cannot be empty.\nTaskCD: 'Task ID' cannot be empty.",

 

 

The project Exist in Acumatica 

 

 

 

Thanks

Best answer by jinin

Hi @Driss 

The issue lies with the project task value. Do not use a hyphen (-) in the value. When I tried using the same value with a hyphen, I encountered an issue. However, when I removed the hyphen and tried again, it worked fine.

Try like this,

 "ProjectTaskID": {
    "value": "L726483"
  },

View original

4 replies

jinin
Pro I
Forum|alt.badge.img+12
  • Pro I
  • Jun 28, 2023 5:42 AM UTC

Hi @Driss ,

I have checked with the same JSON, and it is working fine for me.

First, please verify if you are able to create project tasks directly on the screen with the same data or not.

{
"ProjectID": {
"value": "PR00000019"
},
"ProjectTaskID": {
"value": "04"
},
"Description": {
"value": "TESTING"
},
"VisibilitySettings": {
"GL": {
"value": "true"
},
"AP": {
"value": "true"
},
"CRM": {
"value": "true"
},
"Expenses": {
"value": "true"
},
"IN": {
"value": "true"
},
"PO": {
"value": "true"
},
"SO": {
"value": "true"
},
"TimeEntries": {
"value": "true"
},
"AR": {
"value": "true"
},
"CA": {
"value": "true"
}
}
}

 

Translate

Driss
Jr Varsity III
Forum|alt.badge.img
  • Author
  • Jr Varsity III
  • Jun 28, 2023 8:24 AM UTC

@jinin Yes when i try to create manually it working with no issues

Translate

jinin
Pro I
Forum|alt.badge.img+12
  • Pro I
  • Answer
  • Jun 28, 2023 8:41 AM UTC

Hi @Driss 

The issue lies with the project task value. Do not use a hyphen (-) in the value. When I tried using the same value with a hyphen, I encountered an issue. However, when I removed the hyphen and tried again, it worked fine.

Try like this,

 "ProjectTaskID": {
    "value": "L726483"
  },

Translate

Driss
Jr Varsity III
Forum|alt.badge.img
  • Author
  • Jr Varsity III
  • Jun 28, 2023 8:42 AM UTC

@jinin I found the issue instead of 

"ProjectTaskID": {
    "value": "L-726483"
  },

i delete “-” from the value 

"ProjectTaskID": {
    "value": "L726483"
  },

Translate