Skip to main content

Notifications

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

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

Posted on by 205

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 205 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

Helpful resources

Quick Links

Dynamics 365 Community Update – Sep 9th

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

Dynamics 365 Community Newsletter - August 2024

Catch up on the latest D365 Community news

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,186 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 227,996 Super User 2024 Season 2

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans