# プリントクリエイター出力制御の実装について

**URL:** <https://community.cybozu.dev/t/topic/3998>\
**Category:** kintone 開発相談\
**Created:** [2019 年 5 月 13 日午前 4:49 UTC](https://community.cybozu.dev/t/topic/3998 "2019-05-13T04:49:28Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Legacy\_Account1074](https://avatars.discourse-cdn.com/v4/letter/l/a88e4f/32.png) [@Legacy\_Account1074](https://community.cybozu.dev/u/Legacy_Account1074)\
**Post date:** [2019 年 5 月 13 日午前 4:49 UTC](https://community.cybozu.dev/t/topic/3998/1 "2019-05-13T04:49:28Z")

</div>

ここの投稿を参考にしてプロセス管理のステータスが承認の場合のみプリントクリエイターの出力ボタンが表示されるように実装してみたのですが、出力ボタンが常に表示されてしまいます。

何か考えられる原因はありますでしょうか。

アプリコードの入手方法はプリントクリエイター側でプラグイン設定に切り替えて、設定時に表示されるアプリコードを使用しましたが間違えないでしょうか。

&nbsp;

var \_pcreatorConfig;

\_pcreatorConfig = \_pcreatorConfig || {};

\_pcreatorConfig = {  
appCode: “プリントクリエイター側で表示されたもの”,  
baseUrl: “[//print.kintoneapp.com](https://print.kintoneapp.com)”  
};

(function() {  
“use strict”

kintone.events.on(‘app.record.detail.show’, function (event) {  
if(event.record[‘ステータス’].value == ‘承認’){  
var l, s, scr, styl;  
\_pcreatorConfig.event = event;  
styl = document.createElement(“link”);  
styl.rel = “stylesheet”;  
styl.type = “text/css”;  
styl.href = “[//print.kintoneapp.com/build/kintone-lib.css](https://print.kintoneapp.com/build/kintone-lib.css)”;  
l = document.getElementsByTagName(“link”)[0];  
l.parentNode.insertBefore(styl, l);  
scr = document.createElement(“script”);  
scr.type = “text/javascript”;  
scr.async = true;  
scr.src = “[//print.kintoneapp.com/build/kintone-lib.js](https://print.kintoneapp.com/build/kintone-lib.js)”;  
s = document.getElementsByTagName(“script”)[0];  
s.parentNode.insertBefore(scr, s);  
}

return event;  
});

// 一覧画面  
kintone.events.on(‘app.record.index.show’, function (event) {  
var l, s, scr, styl;  
\_pcreatorConfig.event = event;  
styl = document.createElement(“link”);  
styl.rel = “stylesheet”;  
styl.type = “text/css”;  
styl.href = “[//print.kintoneapp.com/build/kintone-lib.css](https://print.kintoneapp.com/build/kintone-lib.css)”;  
l = document.getElementsByTagName(“link”)[0];  
l.parentNode.insertBefore(styl, l);  
scr = document.createElement(“script”);  
scr.type = “text/javascript”;  
scr.async = true;  
scr.src = “[//print.kintoneapp.com/build/kintone-lib.js](https://print.kintoneapp.com/build/kintone-lib.js)”;  
s = document.getElementsByTagName(“script”)[0];  
s.parentNode.insertBefore(scr, s);

return event;  
});  
})();
