# \_setDuration

Sets the duration of a Job Type.

### Parameters

#### id

The id of the Job Type.

#### val

The duration of the Job Type, works as a multiple of 0.25\
e.g 1.25 => 1 hour 15 minutes

### Example

```
FM_api(
    'JobType_setDuration',[
        'id' => '122039',
        'val' => '25.5'
    ]
);
```

With "val" as 25.5, you should get 2 days, 8 hours and 30 minutes.\
(If each day were equal to 8.5 hours)

### Results

#### On Success

```
{"ok":1}
```

#### On Failure

If there is no id given or it is less than 1

```
{"error":"missing or invalid parameter: id"}
```

If there is no value given or it is less than 0

```
{"error":"missing or invalid parameter: val"}
```

If a valid id is given however there isn't a Job Type assigned with the given id.

```
{"error":"job type does not exist"}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.fieldmotion.com/fieldmotion-api-docs/jobtype/_setduration.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
