Hi all,
I am currently experiencing a problem with Odata query.
I have two custom entities:
1. Custom Configuration entity where are stored Names and Values which another entities can use. Currently in Name I store the name of URL link and in the Value URL itself.
2. A Custom entity with custom string filed of type URL.
What I am trying to is to write a function on a custom entity which will via Odata get a configuration entity, filters the name I need and insert's it's Value into this URL field.
But I am getting an error invalid formatType:
Body of the function:
var query = "?$select=csp_Value&$filter=csp_name eq 'puma.link.test'";
XrmServiceToolkit.Rest.RetrieveMultiple("csp_configurationSet", query,
function (results) {
var firstResult = results[0];
if (firstResult !== null) {
xrm.Page.getAttribute('csp_puma').setValue(firstResult);
}
},
function (error) {
Xrm.Utility.alertDialog(error.message);
},
function () {
},
false
);
};
If someone has any hint or suggestions what I am doing wrong please help :)
Thank you,
Julia
*This post is locked for comments
Hi Clement,
I am trying to return a string (csp_value) from the custom Configuration entity.
All fileds are strings ("single line of text").
no I dont think that xrm.Page is a problem, I paste it here, but we are using ViewModel. in Visual Studio - so setValue shouldnt be a problem at all.
But thanks anyway :)
Regards
Julia
Hi LeeSwagger, Hi Amritesh Singh,
I tried it didnt help. The same error message popup occurs :/.
But thank you for the suggestions!
Julia
Remove the ? symbol and try like this
var query = "$select=csp_Value&$filter=csp_name eq 'puma.link.test'";
try to do like this:
var query = "$select=csp_Value &$filter=csp_name eq 'puma.link.test'";
without ? symbol
Hello Julia,
What does the odata query returns ?
What kind of data type is your field ?
Maybe it's a typo but you wrote "xrm.Page.getAttribute" instead of "Xrm.Page..."
Clément
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