Skip to main content
Solved

inserting project tasks under existing project using REST API

  • June 27, 2023
  • 4 replies
  • 269 views

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"
  },

4 replies

jinin
Pro I
Forum|alt.badge.img+11
  • Pro I
  • June 28, 2023

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"
}
}
}

 


Driss
Jr Varsity III
Forum|alt.badge.img
  • Author
  • Jr Varsity III
  • June 28, 2023

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


jinin
Pro I
Forum|alt.badge.img+11
  • Pro I
  • Answer
  • June 28, 2023

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"
  },


Driss
Jr Varsity III
Forum|alt.badge.img
  • Author
  • Jr Varsity III
  • June 28, 2023

@jinin I found the issue instead of 

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

i delete “-” from the value 

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