Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Can not update data in custom workflow

(0) ShareShare
ReportReport
Posted on by

Hi,

I have developed custom workflow.

When I run the workflow, everything working well , only I can not update a field.

Part of code:

//update a24_potential_hint_commercials_opt in account entity
Entity accountEntity = new Entity("account");
ColumnSet colSet = new ColumnSet("accountid", "a24_potential_hint_commercials_opt");
accountEntity = service.Retrieve("account", account.Id, colSet); 
if (accountEntity.Attributes.Contains("a24_potential_hint_commercials_opt"))
{
accountEntity["a24_potential_hint_commercials_opt"] = new OptionSetValue(a24_potential_hint_commercials_opt);
cont = true;
}
else
{
var new_value = new OptionSetValue(a24_potential_hint_commercials_opt);
accountEntity.Attributes.Add("a24_potential_hint_commercials_opt", new_value);
}
service.Update(account);
//end update a24_potential_hint_commercials_opt in account entity


I don not have any errors while executing, just  no update.

I have checked, I have appropriate Id of account and attribute exits in entity.

Please help me ...

Thanks in advance..

Kind regards

Martin

*This post is locked for comments

  • RE: Can not update data in custom workflow

    Hi,

    Yes, I have.

    I have checked when return data from CRM, it returned "name" correct.

  • Verified answer
    Gopalan Bhuvanesh Profile Picture
    Gopalan Bhuvanesh 11,401 on at
    RE: Can not update data in custom workflow

    Hi

    Hope you have the guid value set for accountid_ before these statements.

  • RE: Can not update data in custom workflow

    Hi,

    I have similar issue like yesterday,

     Entity accountEntity = new Entity("account");
     ColumnSet colSet = new ColumnSet("accountid", "a24_potential_hint_network_bit", "a24_potential_hint_network_description_str", "name");                        
     accountEntity = service_.Retrieve("account", accountid_, colSet); 
     accountEntity["a24_potential_hint_network_bit"] = true;            
     service_.Update(accountEntity);

    I can't update the filed.
    No errors in workflow , just no update...


    I have checked all parameters, everything is Ok.

    Please help me ...

    Thanks in advance

    Kind regards
    Martin


  • RE: Can not update data in custom workflow

    Hi,

    Thanks you very much...

    Kind regards

    Martin

  • Verified answer
    Gopalan Bhuvanesh Profile Picture
    Gopalan Bhuvanesh 11,401 on at
    RE: Can not update data in custom workflow

    Hi

    Modify the code and try:

    service.Update(accountEntity);

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Tip: Become a User Group leader!

Join the ranks of valued community UG leaders

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,516 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,403 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans