web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Fill in Url Field on entity form using odata filtering

(0) ShareShare
ReportReport
Posted on by

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

I have the same question (0)
  • Clem Profile Picture
    2,541 on at

    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

  • Suggested answer
    Community Member Profile Picture
    on at

    try to do like this:

    var query = "$select=csp_Value &$filter=csp_name eq 'puma.link.test'";

    without ? symbol

  • Suggested answer
    amritesh Profile Picture
    362 on at

    Remove the ? symbol and try like this

    var query = "$select=csp_Value&$filter=csp_name eq 'puma.link.test'";

  • Community Member Profile Picture
    on at

    Hi LeeSwagger, Hi Amritesh Singh,

    I tried it didnt help. The same error message popup occurs :/.

    But thank you for the suggestions!

    Julia

  • Community Member Profile Picture
    on at

    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

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.

Helpful resources

Quick Links

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the April Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
ScottDurow Profile Picture

ScottDurow 2

#2
GJones Profile Picture

GJones 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans