My Products
Help
AndreasDevDotNet
CONTRIBUTOR ***

Issue when finishing an orderline

by AndreasDevDotNet

Hi I am building an integration and testing some things.

I am having an issue when I try to set finishNow field on an orderline
This is the mutation:

 

mutation 
{
    useCompany(no: 4816282)
    {
        mutationResult : orderLine_update
        (
            filter: {_and :[{orderNo :{_eq:90}},{lineNo :{_eq:2}}]},            
            value:{finishNow:7}
        )
        {
            affectedRows
            items
            {
                finished
                finishDateAsDate
                finishAtAsTime

            }
        }
    }
}

 

 

I get the following response:

 

{
    "errors": [
        {
            "message": "Error: The field cannot be used here.",
            "extensions": {
                "data": {
                    "status": 0
                }
            }
        }
    ],
    "data": {
        "useCompany": {
            "mutationResult": {
                "affectedRows": 0,
                "items": [
                    {
                        "finished": 4,
                        "finishDateAsDate": "2016-01-25",
                        "finishAtAsTime": "10:10"
                    }
                ]
            }
        }
    },
    "extensions": {
        "vbnxt-trace-id": "0000000000000000ac6ee7cbf140f74f"
    }
}

 

 

Can anyone tell me what I am doing wrong ?

2 REPLIES 2
Accepted solution
AndreasDevDotNet
CONTRIBUTOR ***

by AndreasDevDotNet

I found out what error was, the product was not in stock, I do think that it should have been an error in this scenario

AndreasDevDotNet
CONTRIBUTOR ***

by AndreasDevDotNet

I tried it on another order/orderline using this mutation:

mutation 
{
    useCompany(no: 4816282)
    {
        mutationResult : orderLine_update
        (
            filter: {_and :[{orderNo :{_eq:3974}},{lineNo :{_eq:9}}]},            
            value:{finishNow:7}
        )
        {
            affectedRows
            items
            {
                finished
                finishDateAsDate
                finishAtAsTime

            }
        }
    }
}

I got this result:

{
    "data": {
        "useCompany": {
            "mutationResult": {
                "affectedRows": 1,
                "items": [
                    {
                        "finished": 0,
                        "finishDateAsDate": "0001-01-01",
                        "finishAtAsTime": "00:00"
                    }
                ]
            }
        }
    },
    "extensions": {
        "vbnxt-trace-id": "00000000000000001f8f436bb88546fa"
    }
}

Here I expected the result would be :

{
    "data": {
        "useCompany": {
            "mutationResult": {
                "affectedRows": 1,
                "items": [
                    {
                        "finished": 7,
                        "finishDateAsDate": "2023-00-06",
                        "finishAtAsTime": "10:54"
                    }
                ]
            }
        }
    },
    "extensions": {
        "vbnxt-trace-id": "00000000000000001f8f436bb88546fa"
    }
}

 

Why am I not seeing the finished quantity ?