How to Pass return value from a Web resource to Success Callback in Xrm.Navigation.navigateTo?
Thanks, I have used local storage.
The only easy way of doing it I found was usage of sesionStorage/localStorage. If you want to see the way I do it - I have a post/video scheduled for this week where I will demonstrate how I do it. So if you don't want to miss it - subscribe to my blog and youtube channel.
Can't you create a bool field called "isfromwebresource" with default false and then updated the multiline field and isfromwebresource to true and handle the logic in the plugin ?
like if (isfromwebresource) return
else // do the classic plugin logic
Yes, I have tried. It returns null.
It's a multi line text field.
Did you try window.parent.Xrm.Page.getAttribute("field name").setValue(value)?
which type of field it is?
We would definitely need the plugin to trigger.
If we find any options to update the field using DOM getAttribute methods, the service call can be avoided.
Is there any option to set the crm field value from modal webresource using DOM?
I have tried many options with getAttribute and it did not work.
Since it appears to be not possible to return any value, you need to think out of the box.
Does the logic of that plugin apply only in this scenario ? If so you can choose to use a Custom Workflow Activity and trigger that instead of your plugin .
Do you need the plugin to trigger or you can avoid it by playing with the depth?
Those are questions that only you can ask and answer.
That's what I'm doing right now. Created a hidden field and passing the value from web resource through a webapi call.
As soon as the data is saved in the hidden field, i'm triggering a plugin.
Since its happening asynchronously in the backend, we are facing some issues when the plugin throws any exception.
So I wanted to try in this way.
Hi,
according to MS official documentation it yet can't be done with web resource (results :
Return Value
Returns a promise. The value passed when the promise resolves is dependent on the target:
inline: Promise resolves right away, and does not return any value.
dialog: Promise resolves when the dialog is closed. An object is passed only if the pageType = entityRecord and you opened the form in create mode. The object has a savedEntityReference array with the following properties to identify the entity record created:
entityType: The logical name of the entity.
id: A string representation of a GUID value for the record.
name: The primary attribute value of the record displayed or created.
Which type of value do you need to return? Can't you make and update on a hidden field on form storing that value from the web resource?
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,240 Super User 2024 Season 2
Martin Dráb 230,149 Most Valuable Professional
nmaenpaa 101,156