Skip to main content
November 4, 2021
Solved

how to update multiple columns at same time?

  • November 4, 2021
  • 2 replies
  • 0 views

a!update(data:fv!item,index:{"backupBy","backupOn"},value:{loggedInUser(),now()}),  is not correct, how to do it?

    Best answer by richardm900458

    given a cdt local!example with the following structure: Id,lastName,firstName
    
    your UI componente like textfield, radiobutton,dropdown, buttonwidget.....
    
    
    
    saveinto:{
        a!save(
            target: local!example,
            value a!Update(
                data: local!example,
                index: "firstName",
                value: "Richard"
            )
        ),
        a!save(
            target: local!example,
            value a!Update(
                data: local!example,
                index: "lastName",
                value: "Michaelis"
            )
        )
    }
    
    

    for a!update you need a proper CDT structure. Index is searching in a "readOnly- way" for a specific value. and you can't update readOnly values ;) 

    2 replies

    November 4, 2021

    report Cannot index property of type 'List of Text String' into dictionary. But with

    a!update(data:fv!item,index:"backupOn",value:now()),

    a!update(data:fv!item,index:"backupBy",value:loggedInUser()), either is correct, but i can't write two of them together which make mix non-key word error

    richardm900458
    November 4, 2021

    given a cdt local!example with the following structure: Id,lastName,firstName
    
    your UI componente like textfield, radiobutton,dropdown, buttonwidget.....
    
    
    
    saveinto:{
        a!save(
            target: local!example,
            value a!Update(
                data: local!example,
                index: "firstName",
                value: "Richard"
            )
        ),
        a!save(
            target: local!example,
            value a!Update(
                data: local!example,
                index: "lastName",
                value: "Michaelis"
            )
        )
    }
    
    

    for a!update you need a proper CDT structure. Index is searching in a "readOnly- way" for a specific value. and you can't update readOnly values ;)