Skip to main content

Notifications

Announcements

No record found.

Dynamics 365 Community / Forums / Sales forum / Greeting issue while c...
Sales forum
Suggested answer

Greeting issue while create file on SharePoint

Posted on by 152
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 152 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

Helpful resources

Quick Links

Dynamics 365 Community Update – Sep 9th

Welcome to the next edition of the Community Platform Update. This is a weekly…

Announcing Our 2024 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,263 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 228,112 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans