# kintone.app.record.get(); not working

**URL:** <https://forum.kintone.dev/t/kintone-app-record-get-not-working/61>\
**Category:** General\
**Created:** [March 21, 2017, 3:31pm UTC](https://forum.kintone.dev/t/kintone-app-record-get-not-working/61 "2017-03-21T15:31:48Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![legacy\_user](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.kintone.dev/legacy_user/32/25_2.png) [@legacy\_user](https://forum.kintone.dev/u/legacy_user)\
**Post date:** [March 21, 2017, 3:31pm UTC](https://forum.kintone.dev/t/kintone-app-record-get-not-working/61/1 "2017-03-21T15:31:48Z")

</div>

The below code seems to be quite obvious, but it’s not working on my kintone app…not really understanding why:

_(function() {_  
_&nbsp;&nbsp;&nbsp; “use strict”;_  
_&nbsp;&nbsp;&nbsp; kintone.events.on(‘app.record.edit.show’, function(event) {_  
_&nbsp;&nbsp;&nbsp; var details= kintone.app.record.get();_  
_&nbsp;&nbsp;&nbsp; console.log(details);_  
_&nbsp;&nbsp;&nbsp; return event;_  
_&nbsp;&nbsp;&nbsp; });_  
_})();_

The error in the console keeps showing “_Uncaught Error: You cannot call kintone.app.record.get() in handler or during processing a handler_.” - a bit confused why this error is being shown.

---

<div class="post-metadata">

**Author:** ![legacy\_user](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.kintone.dev/legacy_user/32/25_2.png) [@legacy\_user](https://forum.kintone.dev/u/legacy_user)\
**Post date:** [March 21, 2017, 5:17pm UTC](https://forum.kintone.dev/t/kintone-app-record-get-not-working/61/2 "2017-03-21T17:17:19Z")

</div>

Hello Akira!

Like the error says, this is because of kintone.app.record.get (also kintone.mobile.app.record.get) cannot be called in the kintone.events.on the handler. This is also explained in the help page (the link is below). If you would like to obtain a record data in the event handler, you must use the event object.

&nbsp;kintone developer network - Get Record  
&nbsp;[https://developer.kintone.io/hc/en-us/articles/213148957-Get-Record](https://developer.kintone.io/hc/en-us/articles/213148957-Get-Record)

---

<div class="post-metadata">

**Author:** ![legacy\_user](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.kintone.dev/legacy_user/32/25_2.png) [@legacy\_user](https://forum.kintone.dev/u/legacy_user)\
**Post date:** [March 23, 2017, 10:18am UTC](https://forum.kintone.dev/t/kintone-app-record-get-not-working/61/3 "2017-03-23T10:18:56Z")

</div>

Oh, sorry, my bad…yes, of course…got too stuck in my scripts and I didn’t realize this simple mistake. Thanks for pointing that out.

It works perfectly with the below code 🙂

(function() {  
&nbsp;&nbsp;&nbsp; “use strict”;  
&nbsp;&nbsp;&nbsp; kintone.events.on(‘app.record.edit.show’, function(event) {  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var details= event.appId;  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; console.log(details);  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return event;  
&nbsp;&nbsp;&nbsp; });  
})();

---

<div class="post-metadata">

**Author:** ![legacy\_user](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.kintone.dev/legacy_user/32/25_2.png) [@legacy\_user](https://forum.kintone.dev/u/legacy_user)\
**Post date:** [March 23, 2017, 10:19am UTC](https://forum.kintone.dev/t/kintone-app-record-get-not-working/61/4 "2017-03-23T10:19:44Z")

</div>

Actually I don’t really need to return the event either for this code
