259
Views
2
Comments
How to update one column of a local entity record
Service Studio Version
11.54.11 (Build 62474)

Hello, 


I have an icon a user clicks to "Mark the task as complete". I want to change the TaskStatus (a column in my local entity) of the record that the user clicked the icon on. I have an Onclick event for the icon, when clicked I gather the record that the user clicked (no issues here). My issue is how do I update only that one column? 


Right now, I have a server action that grabs the taskstatus from the record I mentioned above. But what do I do in the server action? In the server action I created an input variable for the status. But I can't assign the status to anything other than the input variable I just created. Then I'm not sure how I would only update that one record. Any help is greatly appreciated.




Onclick.png
taskStatusAssignment.png
MarkTaskCompleteServerAction.png
2021-06-02 20-50-04
Márcio Carvalho

You need to use the record and assign the new status to the record the new status, you pass that structure/record through the createOrUpdate server action to update that record.

If this doesn't help you, can you please share your OML?

Kind Regards,

Márcio

2024-09-12 02-43-38
Deepsagar Dubey

Hi Troy,

Yes, you can update only one column in your entity, 

Suppose your entity name is Tasks and there is a column IsCompleted and if you click on a button then it should be set as True.

So, in your onClick action call the GetTasks entity action and pass TaskId/Primary key of Tasks entity then assign 

                      GetTasks.List.Current.IsCompleted  = True

Then after call UpdateTasks entity action and set source as  GetTasks.List.Current, It'll update only IsCompleted column value.

I just gave an overview here might be your entity and column names are different.

I hope it'll help you.

Thanks
Deep


Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.