---
title: "My Script Reads the Old Value of a Custom Field"
canonical: "https://support.appfire.com/space/SUPPORT/80877901/My%20Script%20Reads%20the%20Old%20Value%20of%20a%20Custom%20Field"
format: markdown
---
## Problem

> ℹ️ When running a SIL script, the value of a Custom Field is accessed incorrectly and reads the old value instead of the current one.

## Solution

Whenever changes are made to a custom field, the issue must be reindexed before the updates are accessible. This is the same whether the custom field is updated via script or by manual input.

- Make sure that any SIL Post Functions are the absolute last in the Post Function stack. For more information, see this [documentation](https://appfire.atlassian.net/wiki/spaces/JJUPIN/pages/13240802/Customizing+workflows#Customizingworkflows-Forpostfunctions) on customizing workflows.
- Reindex the issue before accessing the custom field using admReindexIssue(). For example:

> ℹ️ Note that reindexing the issue before accessing custom field values is usually unnecessary as reindexing should run each time a SIL script is run. Using [admReindexIssue() ](https://appfire.atlassian.net/wiki/spaces/SIL/pages/16522894)is a great way to troubleshoot code, but may be a sign that something is not configured correctly. If the issue persists, please create a support ticket [here](https://anovaapps.atlassian.net/servicedesk/customer/portal/2).

## Additional Help

Need help implementing this script? Talk to me directly to me by clicking on the bot on bottom of our [anovaapps.com](http://anovaapps.com) page.

## Related articles



> Macro (contentbylabel)

> Macro (details)
> 
> | Related issues |  |
> | --- | --- |