LoginSignup
3
1

More than 3 years have passed since last update.

kintoneのJavaScriptからルックアップ参照を実行する

Posted at

JavaScirptからルックアップフィールドに値を設定することはできても取得ボタンを押すようなことはできないのかなー
って思って調べたら普通に出来ましたw

lookupプロパティにtrueを設定したらルックアップが実行されます。

ドキュメントは隅々までよく読まないとですね。

kintone.events.on('app.record.edit.show', function(event) {
    var record = event.record;
    record['ルックアップ']['value'] = '0001'; // ルックアップフィールドの値
    record['ルックアップ']['lookup'] = true;
    return event;
});

ただし、2019年5月リリースの新モバイル版デザインでこれをやると「取得されました」という表示がアラートで表示されるので、ユーザビリティに影響が出るかも。
トーストにしてもらえないかサイボウズに提案してみます。

3
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
1