Implem / Implem.Pleasanter

Pleasanter is a no-code/low-code development platform that runs on .NET. You can quickly create business applications with simple operations.
https://pleasanter.org
GNU Affero General Public License v3.0
511 stars 81 forks source link

スクリプト $p.apiCreate から発火したとき、サーバスクリプトの context.Log() が動作しない #505

Closed tomohisajp closed 4 months ago

tomohisajp commented 6 months ago

事象

新規作成画面にボタンを追加し、スクリプト $p.apiCreate で新規レコードを作成するとします。サーバスクリプトはレコードの「作成後」に動作するように設定してありその途中に context.Log があります。 $p.apiCreate から発火した場合、context.Log はブラウザのコンソールにメッセージを表示しません。元々の作成ボタン<button id="CreateButton" ... > から発火した場合、context.Log はメッセージを表示します。当然ですが、$p.apiCreate の場合も新規レコードは作成できており、サーバスクリプトは動作しています。

問題が起きるスクリプト

<button id="stateA" onclick="stamp();">A</button>

function stamp() {
    $p.apiCreate({
        id: $p.id(),
        data: {
            ClassHash: {
                ClassA: 'A'
            }
        }
    });
}

問題が起きないスクリプト

<button class="button" type="button" onclick="stamp()">A</button>

function stamp() {
    $p.set($p.getControl('ClassA'), 'A');
    CreateCommand.click();
}

サーバスクリプト

context.Log("test");

検証したPlesanterのバージョンは1.3.47.0です。 過去のバージョンアップ情報にある事象の関連でしょうか。

12/29 リリース情報(ver.1.3.27.1) ・Ajaxのレスポンスにおいてサーバスクリプトのcontext.Logが出力されない問題を解消。 7/14 リリース情報(ver.1.1.37.0) ・一覧編集画面でデータ作成時にcontext.Error及びcontext.Logが機能しない問題を解消。

nagamune-implem commented 6 months ago

Issueありがとうございます。

本件に関しまして現状は仕様となります。

補足説明

「CreateCommand.click();」はレコード作成以外に様々な機能を盛り込んでおり、その中にブラウザのデバッグコンソール画面にサーバスクリプトのログを表示する等も含まれます。 「$p.apiCreate」関数に関しましては、レコード作成のみに特化した機能を実装した関数となります。 上記の違いから現状では「$p.apiCreate」関数の場合にブラウザのデバッグコンソール画面にサーバスクリプトのログを表示する機能は有しておりません。

github-actions[bot] commented 4 months ago

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days.

github-actions[bot] commented 4 months ago

This issue was closed because it has been stalled for 7 days with no activity.