cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
noahvoe
Frequent Visitor

Issue to save a pdf to notes

Hello
I builded a flow in Sandbox wich should convert a html into a pdf and then save it into Dynamics 365 notes. It worked fine and as it should. After that I recreated it in the dev-system of the customer, the html creation and convert of this file works perfect, but saving into CRM doesn't.

It throws following error while saving changes to the flow (CDS-Connector is used):

 

Request to XRM API failed with error: 'Message: Flow client error returned with status code "BadRequest" and details "{"error":{"code":"InvalidOpenApiFlow","message":"Fehler beim Speichern des Flows. Code: OpenApiOperationParameterValidationFailed, Meldung: \"Input parameter 'item' validation failed in workflow operation 'Create_a_new_record': The parameter with value '\"@outputs('Get_file_content')?['body']\"' in path 'item/documentbody' with type/format 'String/binary' is not convertible to type/format 'String/bytes'.\"."}}". Code: 0x80060467 InnerError: Type: System.ServiceModel.FaultException`1[[Microsoft.Xrm.Sdk.OrganizationServiceFault, Microsoft.Xrm.Sdk, Version=9.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]] Message: Flow client error returned with status code "BadRequest" and details "{"error":{"code":"InvalidOpenApiFlow","message":"Fehler beim Speichern des Flows. Code: OpenApiOperationParameterValidationFailed, Meldung: \"Input parameter 'item' validation failed in workflow operation 'Create_a_new_record': The parameter with value '\"@outputs('Get_file_content')?['body']\"' in path 'item/documentbody' with type/format 'String/binary' is not convertible to type/format 'String/bytes'.\"."}}". StackTrace: at Microsoft.Crm.Extensibility.OrganizationSdkServiceInternal.Update(Entity entity, InvocationContext invocationContext, CallerOriginToken callerOriginToken, WebServiceType serviceType, Boolean checkAdminMode, Boolean checkForOptimisticConcurrency, Dictionary`2 optionalParameters) at Microsoft.Crm.Extensibility.OData.CrmODataExecutionContext.Update(Entity entity, UpdateOption updateOption) at Microsoft.Crm.Extensibility.OData.CrmODataServiceDataProvider.UpdateEdmEntity(CrmODataExecutionContext context, String edmEntityName, String entityKeyValue, EdmEntityObject entityObject) at Microsoft.Crm.Extensibility.OData.EntityController.PatchEntityImplementation(String& entityName, String key, EdmEntityObject entityDelta) at Microsoft.PowerApps.CoreFramework.ActivityLoggerExtensions.Execute[TResult](ILogger logger, EventId eventId, ActivityType activityType, Func`1 func, IEnumerable`1 additionalCustomProperties) at Microsoft.Xrm.Telemetry.XrmTelemetryExtensions.Execute[TResult](ILogger logger, XrmTelemetryActivityType activityType, Func`1 func) at lambda_method(Closure , Object , Object[] ) at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.<>c__DisplayClass10.<GetExecutor>b__9(Object instance, Object[] methodParameters) at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ExecuteAsync(HttpControllerContext controllerContext, IDictionary`2 arguments, CancellationToken cancellationToken) --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Web.Http.Controllers.ApiControllerActionInvoker.<InvokeActionAsyncCore>d__0.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Web.Http.Controllers.ActionFilterResult.<ExecuteAsync>d__2.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Web.Http.Dispatcher.HttpControllerDispatcher.<SendAsync>d__1.MoveNext() InternalException: '.

 

and the following error while saving the PDF to the notest (Dynamics 365 Connector):

Invalid character in field 'documentbody': '
', hexadecimal value 0x0C, is an invalid character.

 
 

 

5 REPLIES 5
yashag2255
Dual Super User II
Dual Super User II

Hi @noahvoe 

 

Can you share a screenshot of the error that you are seeing? Can you check after the convert to PDF action, when you are creating the file in the notes for CDS, can you try wrapping the pdf content in a binary function? 

 

Hope this Helps!

 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

Hi All,

 

I am also getting same error message. 

It works fine till last week and suddenly it is throwing error message .

 

Now , flow is not able to create a note with attachment in D365 CE. In my case, flow is converting word to pdf and creating a note with attachment in D365 CE.  

 

Error : Invalid character in field 'documentbody': '', hexadecimal value 0x14, is an invalid character.

 

SC16.png

 

I tried below scenario to test the issue but getting same error message 

  • Read sample pdf file (Data in pdf : Test flow pdf data) from SharePoint
  • Create Note with Attachment .

 

SC18.png

SC17.png

 

Regards,

Greddy 

 

 

noahvoe
Frequent Visitor

Hi @GReddy 

 

We couldn't solve the problem, but it wasn't a really necessary feature, it would just be nice feature to have.

If we find a solution in the future I'll post it here.

 

Please inform us if you have solution for the problem.

 

Regards 

 

Noah

@Noah,

 

MS support is suggested below option in my scenario and its working fine. 

 

if I use file content directly in flow system throws an error message .

1.png

so they suggested to  use base64 function to convert file content and its working now.

base64(outputs('Get_file_content_using_path_FAQ')?['body'])

2.png

 

Regards,

Greddy

 

 

 

ssanthosh94
New Member

base64() solves the issue of bypassing the error but when you open the pdf from the notes it fails to open

ssanthosh94_0-1629397407542.png

 

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Users online (2,920)