RussellJuma / PySuiteCRM

MIT License
10 stars 4 forks source link

Get method on phone_mobile field, not working #4

Closed nima0102 closed 2 years ago

nima0102 commented 2 years ago

Hello Russell,

First of all, really appreciate your awesome python module. In our use case, we need to search based on "phone_mobile" field which is a built-in field ( not custom field ). We store the phone_mobile in "+[country code][phone number] format.

after doing lots of trial and error, it turned out that if we store phone_mobile without "+", get method can find otherwise it would not find any matched record.

example:

Can you please advise?

thanks.

RussellJuma commented 2 years ago

It is case sensitive. How is the number stored for that record? ie... 626-555-555 (record actual data in the contact)

suitecrm.Contacts.get(phone_mobile=626555555) # No record found
suitecrm.Contacts.get(phone_mobile=(+1626555555) # No record found
suitecrm.Contacts.get(phone_mobile=(626-555-555) # Record found

You can always run suitecrm.Contacts.fields() to get the list of fields that are searchable.

nima0102 commented 2 years ago

@RussellJuma Thank you so much for your quick reply. I just updated the comment.

we store the number with this format : +[country code][actual phone number] example: +999333333

but after changed the store format to [country code][actual phone number] ( example 999333333 ) without "+" character, now it is working as we expect.

RussellJuma commented 2 years ago

No worries, glad I could help. You can always run suitecrm.Contacts.fields() to get the list of fields that are searchable.

nima0102 commented 2 years ago

still there is a bug

in order to replicate:

above scenario would not work.

RussellJuma commented 2 years ago

I have found the problem.

RussellJuma commented 2 years ago

phone number special character was causing problems with the url encoding.

nima0102 commented 2 years ago

@RussellJuma Perfect. thanks. I am glad to report this bug and thank you for your support!

RussellJuma commented 2 years ago

Already ready.

On Sat, Aug 13, 2022, 7:55 AM nima0102 @.***> wrote:

@RussellJuma https://github.com/RussellJuma Perfect. thanks. I am glad to report this bug and thank you for your support! When do you think the patched version would be available on pip ?

— Reply to this email directly, view it on GitHub https://github.com/RussellJuma/PySuiteCRM/issues/4#issuecomment-1214172307, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHYGJYN6RL55GS7Y7NTICXLVY6ZMPANCNFSM56OBCRVQ . You are receiving this because you were mentioned.Message ID: @.***>