web
You’re offline. This is a read only version of the page.
close
Skip to main content
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.

I have the same question (0)
  • 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

  • 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,

    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);
    }

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

    You can write JS and pass the phone number

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

    Hi,

    Thaks for the response.

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

    Hi,

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

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…

Pallavi Phade – Community Spotlight

We are honored to recognize Pallavi Phade as our Community Spotlight honoree for…

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
MVP-Daniyal Khaleel Profile Picture

MVP-Daniyal Khaleel 125

#2
Tom_Gioielli Profile Picture

Tom_Gioielli 101 Super User 2025 Season 2

#3
Erin Lubben Profile Picture

Erin Lubben 57

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans