Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

Unable to set regardingobjectidtype through form parameters in crm 2011?

Posted on by

Hi,

I am unable to set regardingobjectidtype through parameters.I tried in different ways, created three parameters on my lead form(p_Id,p_name,p_type) then 

function passData(){
var parameters = {};
  parameters[ "parameter_id"] = Xrm.Page.data.entity.getId();
  parameters[ "parameter_name"] = "Lead";
  parameters[ "parameter_type"] = "lead";
Xrm.Utility.openEntityForm( "task" , null , parameters);      }
function getParams() { var param=Xrm.Page.context.getQueryStringParameters(); var regardingId= param["parameter_id"]; var regardingName= param["parameter_name"]; var regardingType= param["parameter_type"]; //Populate the Regarding if there is one if (regardingId != undefined) { Xrm.Page.getAttribute("regardingobjectid").setValue([{id:regardingId, name:regardingName, entityType:regardingType}]); } }


I chosen this because of we cant set values to regarding and partylist.

function passData() will trigger on the 'lead' form and function getParams() will trigger on the 'task' form.

Please help me.

*This post is locked for comments

  • Tim Dutcher Profile Picture
    Tim Dutcher 2,100 on at
    RE: Unable to set regardingobjectidtype through form parameters in crm 2011?

    Here's a page that explains the process.

    mscrmmindfire.wordpress.com/.../crm-2013-passing-custom-parameters-to-openentityform-function

    One thing I noticed is that you're hard-coding "parameter_name" to the word "Lead". You need to set that parameter value to the lead's full name. That's the text that will appear in the regarding field on the task.

  • RE: Unable to set regardingobjectidtype through form parameters in crm 2011?

    i am getting  error after passing values to the another form.All things are working.

    except regardingobjectidtype

  • Tim Dutcher Profile Picture
    Tim Dutcher 2,100 on at
    RE: Unable to set regardingobjectidtype through form parameters in crm 2011?

    When you step through your code, are you seeing that regardingId has a value?

    You are checking regardingId against "undefined" but what about checking it for null?

    stackoverflow.com/.../how-to-check-for-an-undefined-or-null-variable-in-javascript

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,269 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,198 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans