Skip to main content

Notifications

Announcements

No record found.

Customer experience | Sales, Customer Insights,...
Suggested answer

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;


  • Leah Ju Profile Picture
    Leah Ju Microsoft Employee on at
    Greeting issue while create file on SharePoint
    Hi Partner,
    This is a question about power automate, ask for better support in the following forums:
  • Tushar Jadhav Profile Picture
    Tushar Jadhav 154 on at
    Greeting issue while create file on SharePoint
    Hi Leah Ju still stuck with this i didn't get proper solution.
  • Suggested answer
    Leah Ju Profile Picture
    Leah Ju Microsoft Employee on at
    Greeting issue while create file on SharePoint
    Hi Partner,
    Maybe you can refer to the following links:
    https://powerusers.microsoft.com/t5/Building-Flows/Power-Automate-Flow-Use-variable-as-File-Name-in-Get-File/td-p/1409628
    I hope you can mark my answer verified if it is helpful! If you have any questions, please feel free to contact me.
    Regards,
    Leah

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