Skip to main content

Notifications

Announcements

No record found.

Customer experience | Sales, Customer Insights,...
Unanswered

Greeting issue while create file on SharePoint

Posted on by 154
Whenever I create a case and click on the task, we have a subdivision called prepared draft mail. When I click on this button for the first time while creating the task, it works as expected, but when I refresh the page and click on that same button, I receive an error stating, /A value for the file name must be provided./
here code:
 case /PrepareDraftEmail/:
                        if (arrSelectedItemIds && arrSelectedItemIds.length > 0) {
                            if (oTask.arrTaskDetails.indexOf(arrSelectedItemIds[0].Id.replace(/{/, //).replace(/}/, //)) !== -1) {
                                oMC = oTask.oChecklistDetails[arrSelectedItemIds[0].Id.replace(/{/, //).replace(/}/, //)];
                                oConstants.sTaskId = oMC.sTaskId.replace(/{/, //).replace(/}/, //);
                                if (oMC.sFileName && oMC.sDocumentId) {
                                    oCommon.BL.prepareDraftEmail(oMC.sRegardingType, oMC.sRegardingId, null, null, function (oResponse, sDocumentUrl) {
                                        /use strict/;
                                        var oValues = { /otl_documenturl/: sDocumentUrl };
                                        if (oResponse && oResponse.filename) {
                                            oValues.otl_filename = oResponse.filename;
                                            oMC.sFileName = oResponse.filename;
                                        }
                                        if (oResponse && oResponse.documentid) {
                                            oValues.otl_documentid = oResponse.documentid;
                                        }
                                        return Xrm.WebApi.updateRecord(/task/, oConstants.sTaskId, oValues);
                                    }, null, oMC.sRecipientConfig
                                        , oMC.sFileName, oMC.sDocumentId);
                                } else {
                                    oTask.businessLogic.generateDocumentByTaskId(true, oMC.sRecipientConfig, oMC.sRegardingId, oMC.sRegardingType, oMC.sTaskId);
                                }
                            }
                        }
                        break;


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!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,198 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans