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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Dynamics 365 CRM Web API using JavaScript - Issue while creating/updating any Activity Type entity's record with any custom lookup attribute.

(0) ShareShare
ReportReport
Posted on by

Hi, Issue related Dynamics 365 CRM Web API using JavaScript. I am facing an issue while creating Or updating any Activity Type entity's record with any custom lookup attribute. E.g. (Phone Call Or any custom activity type entity). It looks like a problem within the activities only. Is it known issue ?

Here is the code:

var entity = {}; entity["new_account@odata.bind"] = "/accounts(XXA19CDD-XXXX-XXXX-XXXX-6C3BE5A8B2XX)"; entity.subject = "API Phone Call";

entity.description = "Test";

entity["regardingobjectid_account@odata.bind"] = "/accounts(XXA19CDD-XXXX-XXXX-XXXX-6C3BE5A8B2XX)";

After removing the below line the code is working absolutely perfect. entity["usb_account@odata.bind"] = "/accounts(XXA19CDD-XXXX-XXXX-XXXX-6C3BE5A8B2XX)";

Error Details: "An undeclared property 'usb_account' which only has property annotations in the payload but no property value was found in the payload. In OData, only declared navigation properties and declared named streams can be represented as properties without values."

Highly appreciated for any potential input. Thanks...

*This post is locked for comments

I have the same question (0)
  • Community Member Profile Picture
    on at

    Seems to be a similar problem here that can maybe help you.

     https://community.dynamics.com/crm/f/117/t/203648 

  • Suggested answer
    gdas Profile Picture
    50,091 Moderator on at

    Hi Satish,

    I am not sure your lookup schema name is correct or not. Seems "usb_account" shuoud be the lookup schema name.

    Here I am giving one sample applicable for account entity.

    I am giving you sample example by which you can validate . I am assigning primary contact I'd field of account entity.

    var account= new Object();  

    account["primarycontactid@odata.bind"] = "/contacts(XXXXXXX-45FC-XXXX-XXXX-XXXXXXXX)"; //Primary Contact

    You need to check whether your code is allign with this.

    Hope this helps.

  • Community Member Profile Picture
    on at

    Hi

    I am using Web API V8.2 and schema and all does not matters however i have checked all permutation and combinations. The issue is specific to custom lookup fields on any Activity Type entity.

    Thanks

  • Suggested answer
    JohnAnonymous Profile Picture
    5,241 on at

    I just had to figure this out myself recently and wrote blog post for my own personal archive:

    [View:http://www.oak3.org/crm/creating-activity-crm-webapi/:750:50]

    The trick is in the activity parties.

    {
        "description" : "Lorem ipsem",
        "directioncode" : true,
        "leftvoicemail": false,
        "regardingobjectid_account@odata.bind" : "/accounts(EA82D93B-CFD9-E711-812D-E0071B6C2F31)",
        "subject" : "lorem ipsem", 
        "phonecall_activity_parties" : [
            {
                "partyid_systemuser@odata.bind" : "/systemusers(5549B1A7-A7CD-4047-84CC-64BA1FF4756F)",
                "participationtypemask" : 1
            },
            {
                "partyid_contact@odata.bind" : "/contacts(4F2D083E-D3D8-E711-812C-E0071B6C2F31)",
                "participationtypemask" : 2
            }]
    }


  • Suggested answer
    gdas Profile Picture
    50,091 Moderator on at

    Hi Satish,

    I am not sure your lookup schema name is correct or not. Seems "usb_account" shuoud be the lookup schema name.

    Here I am giving one sample applicable for account entity.

    I am giving you sample example by which you can validate . I am assigning primary contact I'd field of account entity.

    var account= new Object();  

    account["primarycontactid@odata.bind"] = "/contacts(XXXXXXX-45FC-XXXX-XXXX-XXXXXXXX)"; //Primary Contact

    You need to check whether your code is allign with this.

    Hope this helps.

  • Community Member Profile Picture
    on at

    Thank you so much for your valuable input Martijn. But issue is only related to "custom lookup attributes" on any Activity Type Entity.  

  • Community Member Profile Picture
    on at

    Hi Goutam,

    Thanks for your input. Yes I have checked and schema name which is absolutely correct. Please see the correct scenario once: Only custom lookup attribute on any activity type entity.

  • Suggested answer
    Seren S Profile Picture
    402 on at

    Hi to all,

    For clarifying this issue; you have to put the relation name especially on the ACTIVITY ENTITIES even if your custom lookup is connected to only one entity type. (opposite to Regarding fields)

    e.g.

    entity["usb_account@odata.bind"] = "/accounts(XXA19CDD-XXXX-XXXX-XXXX-6C3BE5A8B2XX)";

    should be

    entity["usb_account_PhoneCall@odata.bind"] = "/accounts(XXA19CDD-XXXX-XXXX-XXXX-6C3BE5A8B2XX)"; (or you can replace with your entityname like _Task or _Appointment etc.) (Thanks to Rawish Kumar)

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans