Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Dynamics 365 general forum

Xrm.WebApi create record query by an id of other entity

(0) ShareShare
ReportReport
Posted on by
Hi everyone, I'm new to the community. here is my problem. 
I create a block based on a view. the block will take the id of the view as parameter.

when I debug it returns me to the function part (error).
it seems to me that something is wrong but I do not know what

here is my createRecord request that does not work.

Sdk.CreateBlocByViewId = function(viewid){  
        var entity = {};
    entity.pfe_mag_name = "test";
    entity["idvuebloc@odata.bind"] = "/mavue(viewid)";

    Xrm.WebApi.online.createRecord("bloc", entity).then(
        function success(result) {
            var newEntityId = result.id;
        },
        function(error) {
            Xrm.Utility.alertDialog(error.message);
        }
    );

}


  • Community Member Profile Picture
    on at
    RE: Xrm.WebApi create record query by an id of other entity

    The message error is reference parameter is null or undefined.

  • Suggested answer
    Adrian Begovich Profile Picture
    1,025 Super User 2025 Season 1 on at
    RE: Xrm.WebApi create record query by an id of other entity

    Hi Maguy,

    What is the error message you receive when running this code?

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

November Spotlight Star - Khushbu Rajvi

Congratulations to a top community star!

Forum Structure Changes Coming on 11/8!

In our never-ending quest to help the Dynamics 365 Community members get answers faster …

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard > Dynamics 365 general forum

Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans