Skip to main content

Notifications

Announcements

No record found.

Service | Customer Service, Contact Center, Fie...
Suggested answer

How to create a crm from portal javascript/Webapi?

(0) ShareShare
ReportReport
Posted on by 195

Hi,

I want to create a crm record from portal using javascript/Webapi.

Please help me with this.

Thanks in advance!!

  • Suggested answer
    CRMJetty Profile Picture
    CRMJetty 3,508 on at
    RE: How to create a crm from portal javascript/Webapi?

    Hello,

    pls refer this link,

    https://www.youtube.com/watch?v=fN4kPyjB6OY

    https://community.dynamics.com/crm/f/microsoft-dynamics-crm-forum/306690/create-a-record-from-javascript-using-web-api-query/886449

    I hope it helps,

    Thanks.

    Please mark as verified if the answer is helpful. Welcome to join hot discussions in Dynamics 365

  • Suggested answer
    Haansi Profile Picture
    Haansi 1,431 on at
    RE: How to create a crm from portal javascript/Webapi?

    If anyone needs further help from Leo's reply this link details step by step guidance in detail.

    https://docs.microsoft.com/en-us/powerapps/maker/portals/web-api-perform-operations

  • Suggested answer
    LeoAlt Profile Picture
    LeoAlt 16,329 on at
    RE: How to create a crm from portal javascript/Webapi?

    Hi Partner,

    If you want to use web api in portal, please make sure your portal version is 9.2.6.41 or higher.

    Here is the sample code for creating new contact into D365.

            function addSampleRecord() {
                //Sample data to create a record - change as appropriate
                var recordObj = {
                    firstname: "Willie",
                    lastname: "Huff"   _.random(100, 999),
                    emailaddress1: "Willie.Huff@contoso.com",
                    telephone1: "555-123-4567"
                };
                appAjax('Adding...', {
                    type: "POST",
                    url: "/_api/contacts",
                    contentType: "application/json",
                    data: JSON.stringify(recordObj),
                    success: function (res, status, xhr) {
                        recordObj.id = xhr.getResponseHeader("entityid");
                        recordObj.fullname = recordObj.firstname   " "   recordObj.lastname;
                        table.addRecord(recordObj);
                    }
                });
                return false;
            }

    Make sure that the user login the portal has the permission to Contact.

    https://docs.microsoft.com/en-us/powerapps/maker/portals/web-api-perform-operations#example

    Regards,

    Leo

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 Verified Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,503 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans