Udostępnij przez


Record.RenameFields

Składnia

Record.RenameFields(
    record as record,
    renames as list,
    optional missingField as nullable number
) as record  

Informacje

Zwraca rekord po zmianie nazwy pól w polach wejściowych record na nowe nazwy pól określone na liście renames. W przypadku wielu zmian nazw można użyć zagnieżdżonej listy ({ {old1, new1}, {old2, new2} }).

Przykład 1

Zmień nazwę pola "UnitPrice" na "Price" z rekordu.

Użycie

Record.RenameFields(
    [OrderID = 1, CustomerID = 1, Item = "Fishing rod", UnitPrice = 100.0],
    {"UnitPrice", "Price"}
)

Wyjście

[OrderID = 1, CustomerID = 1, Item = "Fishing rod", Price = 100.0]

Przykład 2

Zmień nazwy pól "UnitPrice" na "Price" i "OrderNum" na "OrderID" z rekordu.

Użycie

Record.RenameFields(
    [OrderNum = 1, CustomerID = 1, Item = "Fishing rod", UnitPrice = 100.0],
    {
        {"UnitPrice", "Price"},
        {"OrderNum", "OrderID"}
    }
)

Wyjście

[OrderID = 1, CustomerID = 1, Item = "Fishing rod", Price = 100.0]