Quantcast
Channel: Microsoft Dynamics CRM Forum - Recent Threads
Viewing all articles
Browse latest Browse all 55831

CRM Dynamics Unified Interface (Mobile support) - Passing custom entity reference as parameters on Xrm.Navigation.openForm

$
0
0

I'm trying to pass custom entity reference as parameter on Xrm.Navigation.openForm.

var entityFormOptions = {};
var formParameters = {};

entityFormOptions["entityName"] = "appointment";
formParameters["formid"] = appointmentFormGuid;
entityFormOptions["openInNewWindow"] = true;
entityFormOptions["navbar"] = "on";
entityFormOptions["cmdbar"] = true;

formParameters["new_branch_location"] = branch.id;
formParameters["new_branch_locationname"] = branch.name;
formParameters["new_branch_locationtype"] = "10170";

Xrm.Navigation.openForm(entityFormOptions, formParameters);

I added these parameters to the form's properties.

1) when I'm trying to save form that opened with Xrm.Navigation.openForm with the unified Interface, I get this error :

"Unable to find many-to-one relationship, entity: appointment, referenced entity: undefined, field: new_branch_location".

2)When I'm opening  the form (not from JS code) with the unified Interface, I get this error:

"Could not find a property named 'new_branch_locationname' on type 'Microsoft.Dynamics.CRM.appointment'.
at Microsoft.OData.UriParser.SelectPathSegmentTokenBinder.ConvertNonTypeTokenToSegment(PathSegmentToken tokenIn, IEdmModel model, IEdmStructuredType edmType, ODataUriResolver resolver) at Microsoft.OData.UriParser.SelectPropertyVisitor.ProcessTokenAsPath(NonSystemToken tokenIn) at Microsoft.OData.UriParser.SelectPropertyVisitor.Visit(NonSystemToken tokenIn) at Microsoft.OData.UriParser.SelectBinder.Bind(SelectToken tokenIn) at Microsoft.OData.UriParser.SelectExpandBinder.Bind(ExpandToken tokenIn) at Microsoft.OData.UriParser.SelectExpandSemanticBinder.Bind(ODataPathInfo odataPathInfo, ExpandToken expandToken, SelectToken selectToken, ODataUriParserConfiguration configuration) at Microsoft.OData.UriParser.ODataQueryOptionParser.ParseSelectAndExpandImplementation(String select, String expand, ODataUriParserConfiguration configuration, ODataPathInfo odataPathInfo) at Microsoft.OData.UriParser.ODataQueryOptionParser.ParseSelectAndExpand() at Microsoft.Crm.Extensibility.OData.CrmODataServiceDataProvider.ThrowIfExpandWithRefForNonLookupNavProp(ODataQueryOptions queryOptions, String edmEntityName) at Microsoft.Crm.Extensibility.OData.CrmODataServiceDataProvider.RetrieveEdmEntity(CrmODataExecutionContext context, String edmEntityName, String entityKeyValue, ODataQueryOptions queryOptions) at Microsoft.Crm.Extensibility.OData.EntityController.GetEntityImplementation(String& entityName, String key) 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()"

On the desktop UI everything is working fine.

Thank you very much!


Viewing all articles
Browse latest Browse all 55831

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>