クライアント側のUI アクションで

Yudai Yamamoto
Mega Guru

コミュニティの皆さん、こんにちは。

 

Case のRequest Info のUI アクションにクライアントの処理を持たせようと考えています。

そこで、OOBのUI アクションのサーバー側の処理をサブフローとして外だしし、UI アクションから呼び出そうとしていますが、サブフローとUI アクションを作成しましたが動きませんでした。

 

改善方法がわかる方がおられましたら、共有お願いいたします。

 

サブフローは以下の図で作っています。

 

YudaiYamamoto_0-1744186206774.png

 

UI アクションに記載したフローになります。

function Request() {
   
    try {
        var inputs = {};
        inputs['case'] = current; // GlideRecord of table: sn_customerservice_case

        // Start Asynchronously: Uncomment to run in background. Code snippet will not have access to outputs.
        sn_fd.FlowAPI.getRunner().subflow('global.case_request_info_subflow').inBackground().withInputs(inputs).run();
               
        // Execute Synchronously: Run in foreground. Code snippet has access to outputs.
        var result = sn_fd.FlowAPI.getRunner().subflow('global.case_request_info_subflow').inForeground().withInputs(inputs).run();
        var outputs = result.getOutputs();

        // Current subflow has no outputs defined.      
    } catch (ex) {
        var message = ex.getMessage();
        gs.error(message);
    }
   
};

 

なお、UI アクションからサブフローを呼び出すには「client_callable_flow_object」のACLが必要なようなので作成しています。

1 REPLY 1

Ankur Bawiskar
Tera Patron
Tera Patron

@Yudai Yamamoto 

your subflow looks fine?

Did you configure Subflow to Run as System User?

is your subflow working fine when you Test it and pass the Case Record?

The UI action is server side? then only it will run

Any error when you click UI action?

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader