Announcement

Collapse
No announcement yet.

phoneNumberData does not reflect PhoneNumber invalid field ?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • phoneNumberData does not reflect PhoneNumber invalid field ?

    I did set('invalid', true) on a PhoneNumber entity, then saved it. in phpMyAdmin the row for the number has 'invalid' set to true but when I open a Lead with that number it is not marked as invalid...

    What is the proper procedure to set a phone number as invalid? Does the Lead entity look somewhere else for the data?

    My code:
    PHP Code:
    $num $PhoneNumberRepository->where(['numeric' => '06123456789'])->findOne(); // search using PhoneNumber repository
    $num->set('invalid'true); $entityManager->saveEntity($num); 

    Update: It seems there is a second row with the same numeric value. Shouldn't `numeric` be unique? Is this a bug?
    Click image for larger version  Name:	XV93WgA.png Views:	1 Size:	30.8 KB ID:	49365

    Last edited by tothewine; 06-20-2019, 06:31 PM.

  • #2
    It works. Have you tried to reload a webpage?

    Comment


    • rabii
      rabii commented
      Editing a comment
      hey @Maximus

      is there anyway to automate this option using BPM or Workflow, i tried to automate this option for accounts that have wrong number, all i want to do is check if the invalid is true then unassign the account but seems there is no way to check this condition on BPM or workflow since i can't find the invalid field on account's phone number. Any help please !

      Thanks

    • Maximus
      Maximus commented
      Editing a comment
      Hi @rabii,
      I believe such sort of things need to be done via Hook https://docs.espocrm.com/development/hooks/.
      It is not clear how you want to check 'if the invalid is true'.

  • #3
    yes. see the update to my initial post. The linked PhoneNumber was the second one. I changed my logic to update all the Phonenumber with same numeric value as a workaround, but I think that there only should exist one entity per number. So I ask is that a bug or a feature?

    MAybe duplicate PhoneNumber merging could be added to cleanup scheduled job.
    Last edited by tothewine; 06-28-2020, 05:10 PM.

    Comment

    Working...
    X