{"action":"closed","issue":{"url":"https://api.github.com/repos/jordimontana82/fake-xrm-easy/issues/366","repository_url":"https://api.github.com/repos/jordimontana82/fake-xrm-easy","labels_url":"https://api.github.com/repos/jordimontana82/fake-xrm-easy/issues/366/labels{/name}","comments_url":"https://api.github.com/repos/jordimontana82/fake-xrm-easy/issues/366/comments","events_url":"https://api.github.com/repos/jordimontana82/fake-xrm-easy/issues/366/events","html_url":"https://github.com/jordimontana82/fake-xrm-easy/issues/366","id":386449041,"node_id":"MDU6SXNzdWUzODY0NDkwNDE=","number":366,"title":"Mock Retrieve in FakeXrmEasy","user":{"login":"chetanshetty1387","id":45463361,"node_id":"MDQ6VXNlcjQ1NDYzMzYx","avatar_url":"https://avatars2.githubusercontent.com/u/45463361?v=4","gravatar_id":"","url":"https://api.github.com/users/chetanshetty1387","html_url":"https://github.com/chetanshetty1387","followers_url":"https://api.github.com/users/chetanshetty1387/followers","following_url":"https://api.github.com/users/chetanshetty1387/following{/other_user}","gists_url":"https://api.github.com/users/chetanshetty1387/gists{/gist_id}","starred_url":"https://api.github.com/users/chetanshetty1387/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chetanshetty1387/subscriptions","organizations_url":"https://api.github.com/users/chetanshetty1387/orgs","repos_url":"https://api.github.com/users/chetanshetty1387/repos","events_url":"https://api.github.com/users/chetanshetty1387/events{/privacy}","received_events_url":"https://api.github.com/users/chetanshetty1387/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":6,"created_at":"2018-12-01T11:16:36Z","updated_at":"2018-12-03T20:45:42Z","closed_at":"2018-12-03T20:45:41Z","author_association":"NONE","body":"Hi,\r\n\r\nI am creating a mock user in UT and setting same user as owner of the account entity.\r\n\r\nAs owner is of type entity reference, I am setting Name property in owner reference as \"System\" that is because in plugin there is a if condition which checks \"account.owner.name='SYSTEM'\". To execute if loop I am setting owner name as \"SYSTEM\"\r\n\r\nBelow is the plugin code\r\n\r\n            **_this.AssignRecordToTeam(this.TargetEntity.ToEntityReference(), this.GetRecordOwner(false));\r\n            Account account = OrganizationService.Retrieve(TargetEntity.LogicalName, TargetEntity.Id, new ColumnSet(new string[] { \"gcct_region\", \"ownerid\" })).ToEntity<Account>();\r\n            this.Trace(\"account\");\r\n            if (account.OwnerId != null && account.OwnerId.Name != null && account.OwnerId.Name.ToUpper() == \"SYSTEM\")_**\r\n\r\nThe problem here is in AssignRecordToTeam function Name, the owner reference become null that is because they are creating new entity reference of owner and while retrieving account with column as owner, Name is null and **if condition** fail to execute.\r\n\r\nIs it possible to mock Retrieve request when retrieve executes in plugin so that I can create my own response.\r\n \r\nThanks,\r\nChetan             "}}
{"actor":{"display_login":"jordimontana82"}}