Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics 365 | Integration, Dataverse...
Suggested answer

regardingobject not clickable after setting it via javascript

Posted on by 219

Hello,

we have a subrid on our salesorder formular and it shows all salesorderdetails. when you select one you can klick a custom button in the subgrid ribbon which opens a quickcreate formular for tasks.

everything works fine except the regarding field is after populating it not clickable

    var productdetail_ref = grid.getSelectedRows().get(0).getData().getEntity().getEntityReference();
    formParameters["regardingobjectid"]= productdetail_ref;
    //formParameters["regardingobjectid"] = productdetail_ref.id;
    //formParameters["regardingobjectidname"] = productdetail_ref.name;
    //formParameters["regardingobjectidtype"] = "salesorderdetail";
    //formParameters["regardingobjecttypecode"]=1089;   

in the moment i populate it with the first 2 codelines here. but I also tried the other way which is commented out. however both ways and in the same result.

pastedimage1631173960989v1.png

klicking on regardingtest doesnt link me to the entity.

the weird thing is,on the subgrid of activities it works:

pastedimage1631174123184v2.png

so is something wrong with my code or is it microsoft bug?

  • Suggested answer
    Charan Raju C R Profile Picture
    Charan Raju C R 3,155 Super User 2024 Season 1 on at
    RE: regardingobject not clickable after setting it via javascript

    I can access only the latest Dynamics 365 environment where the activities is disabled for salesorderdetail. But, I can suggest you to try the below code and see if that works for you.

    var regObjId = new Array();

    regObjId[0] = grid.getSelectedRows().get(0).getData().getEntity().getEntityReference();

    formParameters["regardingobjectid"]= regObjId;

  • McDauly Profile Picture
    McDauly 219 on at
    RE: regardingobject not clickable after setting it via javascript

    Yes I even have a timeline on the salesorderdetail form and create activities from there. this works fine. The problem occurs only when I use the way I described above.

  • Charan Raju C R Profile Picture
    Charan Raju C R 3,155 Super User 2024 Season 1 on at
    RE: regardingobject not clickable after setting it via javascript

    Is Activities check box is enabled for Order Line entity in your environment?

  • McDauly Profile Picture
    McDauly 219 on at
    RE: regardingobject not clickable after setting it via javascript

    this is old enviornment, in the new its possible

  • Suggested answer
    Charan Raju C R Profile Picture
    Charan Raju C R 3,155 Super User 2024 Season 1 on at
    RE: regardingobject not clickable after setting it via javascript

    Hi McDauly,

    You're trying to create a task (an activity) for an Order Line (orderdetail) whenever you select one of the Order Lines on an Order and click a button.

    If my understanding is correct, you cannot create a task activity (any activity) for Order Line as Activities feature is not enabled for this system entity. Unfortunately, system not allowing to enable as you can see it in below screenshot.

    pastedimage1631181439493v1.png

    Also, you would have already getting an error when you save the task record.

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans