Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Suggested answer

Pull the phone number

(0) ShareShare
ReportReport
Posted on by 22

How to add phone number into phone call Quick create form.

  • Ruma1991 Profile Picture
    22 on at
    RE: Pull the phone number

    Hi,

    Thanks for the response. Do you have any sample code?

  • Ruma1991 Profile Picture
    22 on at
    RE: Pull the phone number

    Hi,

    Thaks for the response.

  • Suggested answer
    ankit_singhal Profile Picture
    560 on at
    RE: Pull the phone number

    You can write JS and pass the phone number

  • Suggested answer
    XM-22040801-0 Profile Picture
    11 on at
    RE: Pull the phone number

    Hi,

    From which contact phone number field do you want to populate the phone number field?

    The field can be populated when creating the phone call or when loading it with JS.

    - Creating (from contact)
    With Xrm.Navigation.openForm(), you can open a quick create form and set the phonenumber from the contact.
    Example:

    Xrm.Navigation.openForm(
        {
            entityName: "phonecall",
            useQuickCreateForm: true,
            createFromEntity: {
                entityType: "contact",
                id: "00000000-0000-0000-0000-000000000000"
            }
        },
        {
            phoneNumber: "555 555 5555"
        }
    );

    - Loading

    You can set the phonenumber by doing a request to WebApi with Xrm.WebApi.retrieveRecord(), then set the field value.

    Example:

    async function onFormLoad(execCtx) {
        const formCtx = execCtx.getFormContext();
        const toAttr = formCtx.getAttribute("to");
        const toLookupValue = toAttr.getValue();
        
        if (toLookupValue == null) {
            Xrm.Navigation.openAlert({ text: "To field not set" });
            return;
        }
        
        if (toLookupValue[0].entityType !== "contact") {
            Xrm.Navigation.openAlert({ text: "To is not a contact" });
            return;
        }
    
        const contactId = toLookupValue[0].id;
        const result = await Xrm.WebApi.retrieveRecord("contact", contactId, "?$select=telephone1");
        const telephone = result.telephone1;
    
        formCtx.getAttribute("phonenumber").setValue(telephone);
    }

  • Ruma1991 Profile Picture
    22 on at
    RE: Pull the phone number

    Hi,

    Thank you for the response. Let me explain the scenario. When trying to create a phone call activity to the customer using the Phone Call Quick Create form the Phone Number does not display on the Phone Number field. So I want to display the Phone number on the Contact card in Phone Call Quick Crete Form. 

    phonequick.png

  • Suggested answer
    XM-22040801-0 Profile Picture
    11 on at
    RE: Pull the phone number

    Hi,

    You can follow this article : learn.microsoft.com/.../create-edit-quick-create-forms

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

Jainam Kothari – Community Spotlight

We are honored to recognize Jainam Kothari as our June 2025 Community…

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard >

Product updates

Dynamics 365 release plans