> ## Documentation Index
> Fetch the complete documentation index at: https://docs.codenullapp.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Custom Functions

> The next helpers are available in any custom function

### Helpers

The next helpers are available in any custom function

```javascript theme={null}

const helpers = {
    displayMessage //displayMessage("msg", "title", duration)
    displayError //displayError("msg", "title", duration)
    getCurrentUser,
    moment,
    get,
    set,
    form,
    options,
    jsPDF,
    dayjs,
    sendLog,
    getCurrentLocationAsync,
    generateIdv4 //generates a new Guid value
    sendEmailAsync,
    setUserLogo,
    clearUserLogo,
    setUserMenu,
    clearUserMenu,
    closeModal, //close feature modal container
  };
```

#### Set Field Value

Allows to set a value into the context

```javascript theme={null}
helpers.form.setFieldValue("fieldNamePath", value)
```

#### Get current user

Allows to get the current logged user

#### Get current location

```javascript theme={null}
//async call
helpers.getCurrentLocationAsync()
    .then(result => helpers.options.setFieldValue("fieldName", result));
    
//result object structure
// {
//    latitude: 9.161733, 
//    longitude: -74.6406, 
//    mapUrl: "https://www.openstreetmap.org/#map=18/6.161733080440801/-75.64064618359605"
// }
```

<Info>
  The user should provide permissions to allow this function to work, otherwise, this will return null
</Info>

<Warning>
  Available in version 2.2.19 and above
</Warning>

#### Dayjs

Date utils library: [https://day.js.org/](https://day.js.org/)

#### jsPDF

Pdf Library [https://github.com/parallax/jsPDF](https://github.com/parallax/jsPDF)

#### Send Log

Allows to send custom logs remotely.

More details here: [Debugging](/dev/configurations/debugging.md#how-to-send-custom-logs)
