Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Microsoft Dynamics 365 | Integration, Dataverse...
Suggested answer

regardingobject not clickable after setting it via javascript

(0) ShareShare
ReportReport
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
    7 Moderator 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
    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
    7 Moderator 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
    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
    7 Moderator 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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Jonas ”Jones” Melgaard – Community Spotlight

We are honored to recognize Jonas "Jones" Melgaard as our April 2025…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 294,157 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 232,930 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,158 Moderator

Leaderboard

Product updates

Dynamics 365 release plans