My Products
Help

ProjectCD and ProjectTaskCD not responding?

by Eirik Morken - Proplan AS

Greetings 🙂


We are attempting to create a sales order with stock items in combination with the Project Accounting module using the following endpoint: POST /controller/api/v2/salesorder
(POST-json at bottom of post)

 

However there comes no Project on the order. If I use the default "project" instead of "projectCD" with the internal ID project number I am able to get this error message that suggests that project is in but not the task.

 

  "message": "Error: Inserting  'Sales order line' record raised at least one error. Please review the errors.\r\n'Project task' cannot be empty.\r\n"
}

 

I am not able to get the task in at all. Not with projectTaskCD with GUI ID and not projectTask with internal task ID or GUI ID.

 

There is of course also the issue that we can't set the sub-account in the same post because it is always overridden by the item settings, but this can at least in a worst case scenario be solved by an additional PUT afterwards.

 

Any suggestions or ideas?

 

{
  "projectCD": {
    "value": "00002"
  },
  "lines": [
   {
      "subaccount": [
        {
          "segmentId": 1,
          "segmentValue": "13"
        }
      ],
      "operation": "Insert",
      "lineNbr": {
        "value": 1
      },
    
      "inventoryNumber": {
        "value": "0S3565"
      },
      "warehouse": {
        "value": "L"
      },
 
      "projectTaskCD": {
        "value": "100"
      },
      
      "quantity": {
        "value": 1
      },
      
      "unitPrice": {
        "value": 1
      }
    }
  ],
  "orderType": {
    "value": "SO"
  },
  
  "date": {
    "value": "2022-11-07T13:51:01.913Z"
  },
  
  "customer": {
    "value": "30020"
  }
}

 

 

5 REPLIES 5

by Eirik Morken - Proplan AS

Ah, thanks! Seems like there was a combination that was not tried. 
Perhaps remove the ProjectCD field from the SalesOrderDto and ProjectTaskCD field from the SalesOrderLineDto to avoid future confusion?

Yıldırım
VISMA

Hello, ProjectCD and ProjectTaskCD are available in the GET dto and in use by the integrations. 

Ah, ok, so just available in get and not post. 

Yıldırım
VISMA

That's correct 👍

Accepted solution
Yıldırım
VISMA

by Yıldırım (Updated ‎08-11-2022 12:50 by Yıldırım VISMA )

Hello Eirik, 

the field exposed via Sales Order Endpoint (saleOrderUpdateDto) is 

{
  "project": {
    "value": 0
  }

this field requires the value of the Project's "Internal ID" that can be retrieved from GET Project/{ProjectID}

 GET_ProjectID.jpg

GET_Project_internalID.jpg

 

then we should send the following fields in the payload (SalesOrder Header), based on your project defined in the company

"project": 
{"value": 7692}

SalesOrderLine

 "projectTask": 
{"value": "01"}


Example JSON:

View more
{
    "project": {
        "value": 7692
    },
    "lines": [
        {
            "operation": "Insert",
            "lineNbr": {
                "value": "1"
            },
            "inventoryId": {
                "value": "122"
            },
            "warehouse": {
                "value": "1"
            },
            "uom": {
                "value": "STK"
            },
            "quantity": {
                "value": 3
            },
            "note": {
                "value": "Test Project"
            },
            "projectTask": {
                "value": "01"
            }
        }
    ],
    "customerVATZone": {
        "value": "03"
    },
    "orderType": {
        "value": "SO"
    },
    "hold": {
        "value": true
    },
    "date": {
        "value": "2022-11-08T00:00:00"
    },
    "requestOn": {
        "value": "2022-11-08T00:00:00"
    },
    "customer": {
        "value": "10025"
    },
    "location": {
        "value": "MAIN"
    }
}


Financials ERP Output:

Project (ScreenId=PM301000)
Projects.jpg

 

SalesOrder (ScreenId=SO301000)

SO_Project.jpg

SalesOrderLine

SO_projectTask.jpg

 

We'll inform development team to improve the documentation of the field that to specify it requires the "InternalID" of the project.

Regards.