You're almost there! Please answer a few more questions for access to the Applications content. Complete registration
Interested in joining? Complete your registration by providing Areas of Interest here. Register

How to update a single sub-object field? C#

Accepted answer
43
Views
1
Comments
edited Jun 8, 2022 12:01PM in General Technical Discussions 1 comment

Content

I want to update Account.Attributes.AccountLocked field.  What is the best way to do this?

The below code complains about changing NotificationPending field.

Code Snippet

             RightNowService_dev.QueryResultData[] queryObjects = _service_dev.QueryObjects(clientInfoHeader_dev, Strings.selectAccounts, null, 10000);

RightNowService_dev.RNObject[] rnObjects = queryObjects[0].RNObjectsResult;

for (int i = 0; i < rnObjects.Length; i ++)
{                                ((RightNowService_dev.Account)rnObjects[i]).Attributes.AccountLocked = false;
}

_service_dev.Update(clientInfoHeader_dev, rnObjects, options); 
        

Howdy, Stranger!

Log In

To view full details, sign in.

Register

Don't have an account? Click here to get started!