Skip to main content

Notifications

Announcements

No record found.

Dynamics 365 Community / Forums / Sales forum / Workflow to detect whe...
Sales forum

Workflow to detect when Phone Call record has a Phone Number less than 5 characters long

Posted on by 211

We have the basic 3CX integration and it creates call records for internal calls as well as external calls.

How would I go about setting up a workflow to check if the Phone Call has a Phone Number that is less than 5 characters long? I tried 'is less than' '9999' but it didn't seem to like that...

Thanks!

Categories:
  • Suggested answer
    Radu Chiribelea Profile Picture
    Radu Chiribelea 6,667 on at
    RE: Workflow to detect when Phone Call record has a Phone Number less than 5 characters long

    Hi Michelle,

    One option you can explore is to create the phone number field as a Text Field.

    Once the record is created you can check the string length of the phone number field - see msdn.microsoft.com/.../system.string.length(v=vs.110).aspx

    for example

    string phoneNumber = entity["your_phone_field"].ToString();
    
    if(phoneNumber.Length < 5)
    {
        throw new InvalidPluginExecutionException("Phone number is lass than 5 characters long. Please enter a correct one");
    }


    Hope this helps,

    Radu

  • MichelleM Profile Picture
    MichelleM 211 on at
    RE: Workflow to detect when Phone Call record has a Phone Number less than 5 characters long

    Thanks Radu, I think it's the logic I am having trouble with. How can I check the number of chars in the field in the workflow builder rather than whether the number is less than some value?

  • Suggested answer
    Radu Chiribelea Profile Picture
    Radu Chiribelea 6,667 on at
    RE: Workflow to detect when Phone Call record has a Phone Number less than 5 characters long

    Hi MichelleM,

    You can do this via a Plug-in triggered / custom workflow activity triggered on the create & update of the phone call field.

    Within the plug-in you add the logic to check the formatting of the phone number and then follow you business processes (throw an exception, format the record properly, etc.)

    Hope this helps,

    Radu

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

November Spotlight Star - Khushbu Rajvi

Congratulations to a top community star!

Forum Structure Changes Coming on 11/8!

In our never-ending quest to help the Dynamics 365 Community members get answers faster …

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans