Notifications
Announcements
No record found.
How to Pass return value from a Web resource to Success Callback in Xrm.Navigation.navigateTo?
Hi,
according to MS official documentation it yet can't be done with web resource (results :
https://docs.microsoft.com/en-us/powerapps/developer/model-driven-apps/clientapi/reference/xrm-navigation/navigateto
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?
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.
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.
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.
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.
Did you try window.parent.Xrm.Page.getAttribute("field name").setValue(value)?
which type of field it is?
Yes, I have tried. It returns null.
It's a multi line text field.
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
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.
Thanks, I have used local storage.
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.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Tom_Gioielli 108 Super User 2025 Season 2
Jimmy Passeti 50 Most Valuable Professional
Gerardo RenterÃa Ga... 49 Most Valuable Professional