FieldWriteOptions 構造体: Android
FieldWriteOptions クラスは、ServiceNowインスタンスのレコードのフィールドを更新または作成するためのオプションを設定する関数を提供します。
| 名前 | タイプ | 説明 |
|---|---|---|
| queryItem | Map<String, String> | 書き込みオプションを表す要求クエリアイテムのコレクション。 |
FieldWriteOptions:FieldWriteOptions(変数オプション:FieldWriteOptions.Options)
ServiceNowインスタンスのレコードにフィールドを書き込むまたは作成するためのオプションを設定します。
| 名前 | タイプ | 説明 |
|---|---|---|
| vararg オプション | FieldWriteOptions.Options | フィールドの作成時またはフィールドへの書き込み時に設定するオプション。 有効な値:
|
次のコード例は、この関数を呼び出す方法を示しています。
// Update assigned_to field using actual value (syd_id of user)
val response = runCatching {
getNowTableService()?.updateRecord("sys_id_of_record", "sn_customerservice_case", mapOf("assigned_to" to "<sys_id_of_user>"))?.execute()
}
// Update assigned_to field using display value
val fieldWriteOptions = FieldWriteOptions(FieldWriteOptions.Options.TREAT_INPUT_VALUES_AS_DISPLAY_VALUES)
val response = runCatching {
getNowTableService()?.updateRecord("sys_id_of_user", "sn_customerservice_case", mapOf("assigned_to" to "John Doe"))?.execute()
}