Skip to main content

Notifications

Customer experience | Sales, Customer Insights,...
Answered

Edit Business Unit C#

Posted on by 60

Hello,

I have a custom field in Business Unit entity and I want to edit it in a C# plugin. Is it possible to do this or is the entity Business Unit not editable? (neither from C # code or workflow).

int lastUsedNumber = (int)(businessUnit["alten_accountnumberofseries"]);
lastUsedNumber = lastUsedNumber  ;

businessUnit["alten_accountnumberofseries"] = lastUsedNumber;

wod_CrmService.Update(businessUnit);

  • Suggested answer
    a33ik Profile Picture
    a33ik 84,323 Most Valuable Professional on at
    RE: Edit Business Unit C#

    Hello Simone,

    If my reply (or replies) answers your question take a minute and verify the answer. You can do it by clicking "Yes" at the top of the reply (or replies) under the label "Does this answer your question?"

  • Simone Colombo Profile Picture
    Simone Colombo 60 on at
    RE: Edit Business Unit C#

    I am a fool. The problem was trivially the lastUsedNumber enhancement.

    Now it works, thankk you very much.

  • Verified answer
    a33ik Profile Picture
    a33ik 84,323 Most Valuable Professional on at
    RE: Edit Business Unit C#

    Hello,

    Can you please provide the code that you use to retrieve/insantiate businessUnit record?

    Other than that you can replace line

    lastUsedNumber = lastUsedNumber++;

    with just

    lastUsedNumber++;

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,253 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,188 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans