Hi,
I’m trying to disable certain fields when an app is loaded with javascript. It works if the advanced lookup plugin is disabled and fails if the advanced lookup plugin is enabled. Am I missing something? I also tried the “Conditional Display” plugin but it fails for other reasons.
Steps to reproduce:
- Create an app with one text field with field code: “Text”
- Add the test.js code below to the app.
- Create a new record in the app. Confirm that the text field is disabled as expected.
- Add the Kintone plugin: “Advanced Lookup” from here.
- Create a new record in the app. The text field does not get disabled and this error is displayed:
Unexpected token u in JSON at position 0
Cheers,
Jeff
test.js
(function() {
"use strict";
var recordLoadedEvents = ['app.record.edit.show','app.record.create.show']
kintone.events.on(recordLoadedEvents, function(event){
event.record.Text.disabled = true;
return event;
});
})();