Quantcast
Channel: CRM Development forum
Viewing all articles
Browse latest Browse all 8223

Help need on updating the BusinessUnit value

$
0
0

Hello All,

I have a task to create a Businessunit with the value of name field in custom entity, and need to update the created business unit value in lookup while creating the custom entity record.

I am able to create businessunit record, but update the created businessunit value in lookup is not working.

Below is the code for that. Please let me know where i am wrong.

public static Guid UpdateBusinessUnit(IOrganizationService _service, Guid _businessUnitid, Entity _customEntity)
        {
            Entity _updateEntiy = new Entity(_customEntity.LogicalName);
            _updateEntiy.Id = _customEntity.Id;
            _updateEntiy["new_BusinessUnit"] = new EntityReference("BusinessUnit", _businessUnitid);
            _service.Update(_updateEntiy);
            return _updateEntiy.Id;
        }
Kumar R

Viewing all articles
Browse latest Browse all 8223

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>