How to resolve Error Loading Control on Sales Literature Attachment after removing the file programmatically

Sending
User Review
0 (0 votes)

Introduction

We had a requirement from our client that they needed to remove all sales literature attachments from CRM. While doing this we got an error – “Error loading control” on file control of sales literature item. In this blog will find out how to resolve this.

Error on file control –

Error Loading Control

In previous version of Dynamics 365 CRM, below code worked fine.

Error Loading Control

But after October 2019 Wave 2 release, attachment is removing properly but getting error on file control as shown in above screenshot.

So, we figured out that for this we need to add one more parameter i.e. “Mode”= string.Empty (If file is uploaded then it contains “0”) while updating a record of sales literature item for removing all reference of sales attachment document from CRM.

Error Loading Control

Now you can update this record by uploading documents.

Error Loading Control

Conclusion

After moving all your sales literature attachments from Dynamics 365 CRM now error on file control will not come and you can update same sales literature attachment record with new attachment if you want.