# Best way to check FileMaker “Context”?

**URL:** <https://the.fmsoup.org/t/best-way-to-check-filemaker-context/1500>\
**Category:** Lounge (Discussions)\
**Created:** [November 27, 2020, 2:57pm UTC](https://the.fmsoup.org/t/best-way-to-check-filemaker-context/1500 "2020-11-27T14:57:23Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![Malcolm](https://yyz2.discourse-cdn.com/flex030/user_avatar/the.fmsoup.org/malcolm/32/196_2.png) [@Malcolm](https://the.fmsoup.org/u/Malcolm)\
**Post date:** [November 27, 2020, 8:26pm UTC](https://the.fmsoup.org/t/best-way-to-check-filemaker-context/1500/3 "2020-11-27T20:26:54Z")

</div>

I use a custom function named "cf CorrectContext." It has one parameter, getFieldNameX.

Internally it contains this code:

```
/*
Given a fully qualified field name, return true if the field matches the current layout table name 
*/

Let (
	parts = Substitute ( getFieldNamex ; "::" ; ¶ ) ; 
	GetValue ( parts ; 1 ) = Get(LayoutTableName)
)

```

This allows me to use the function in script steps and other calculations:

```
If [cf correctContext ( GetFieldName ( field-ref ) )] 
 // code here
End if
```

---

_[View the full topic](https://the.fmsoup.org/t/best-way-to-check-filemaker-context/1500)._
