Method Community

 

Add IsSMS checkbox field to all Phones

Last post 12-18-2013 2:04 PM by Anonymous. 9 replies.
Page 1 of 1 (10 items)
Sort Posts: Previous Next
  • 11-23-2013 7:09 PM

    Add IsSMS checkbox field to all Phones

    am trying to, as globally as possible, Add an "IsSMS" checkbox field to all Phone Numbers displayed and stored in Method.

    I hope it's perfectly clear...the idea is to be able to flag phone numbers which can receive SMS messages.

    I am not sure what all the entities are, even, but I beileve I was told that there is a programmatic "class", perhaps a phone number class, which can be abstracted, OOP-like? But there are no Google results for searching OOP or abstraction, for example, OOP site:methodintegration.com.

    It would be particularly swell if this additional property/field only had to be added in a single place...I am thinking that if phone numbers are normalized into a single table in Method like it used to be in SugarCRM, that this might be possible.  It would also be nice if the new property displayed automatically on screens with phones, but it shouldn't be a huge deal to place the field.

    Thanks in advance for any guidance.

  • 11-25-2013 9:08 AM In reply to

    Re: Add IsSMS checkbox field to all Phones

    Hey kenlyle,

    The phone numbers are indeed normalized into the "Entity" table -- thus, if you go to the "Entity" table (click on Customize > Tables/Fields > Entity > Edit Fields) and add a new field named "IsSMS" (with the necessary field details), you will be able to reference the IsSMS dropdown in any screen that you're asking for a phone number.

    Unfortunately, there's no way to make it display automatically unless you're working with a fresh screen on a new table -- you will have to manually add the flag into whichever screen you want it in.

    Let me know if that helps!

    Naeem

  • 11-25-2013 7:28 PM In reply to

    Re: Add IsSMS checkbox field to all Phones

    Thanks, Naeem.

    It looks like a near miss.

    Here is why:  In Entity, I see a bunch of fields, which are things/data attached to an "Entity".

    The problem is that both AltPhone and Phone are in there, as well as any other custom phone fields there may be.

    A single IsSMS field is not going to cover it, because the idea is to indicate for EACH phone numbe whether that particular number, is, in fact, SMS capable.

    Is there some other way of accomplishing this?

    Thanks!

  • 11-26-2013 2:16 AM In reply to

    Re: Add IsSMS checkbox field to all Phones

    Ok, I think I have figured out the workaround...I just need to make multiple fields, one per phone type, assuming, I guess, that each Entity has only one Mobile number, etc., like:

    IsSMSMobile, IsSMSPhone, IsSMSAltPhone, etc.?  And put these adjacent to the related field on my screens?

  • 11-27-2013 8:42 AM In reply to

    Re: Add IsSMS checkbox field to all Phones

    Hi kenlyle,

    Sorry for the delayed response, I was under the weather yesterday -- but you are right! Unfortunately, because Phone, AltPhone etc. are all seperate fields, you would have to create a separate field for each of those as you mentioned.

    Naeem

  • 12-17-2013 12:41 PM In reply to

    Re: Add IsSMS checkbox field to all Phones

    EDIT: Per http://method.me/cs/forums/t/5181.aspx I see that modding Entity is an accepted, perhaps even bast practice.  I'll leave the original post for anyone else who may have the same question or concern.

    ---Below, the original post:

    Thanks!

    I was reading http://method.me/cs/forums/t/454.aspx - at some point, Entity may have been unmodifiable(?) - I am a bit nervous about modifying a "special" table.

    But, since I do want this behavior to apply to Contacts, Customers, and probably even Vendors...is this the way to go?  Otherwise, I would have to add these three fields to as many as 3 tables that I mentioned?

    Then these fields would have to be added to the Contacts, etc. based screens and grids as linked fields?

    Just checking that there aren't negative implications...

    Best,

    Ken

  • 12-17-2013 1:29 PM In reply to

    Re: Add IsSMS checkbox field to all Phones

    Ok, Now...in my Grids, I want to put a little Composite Flag to indicate that we do have at least one SMS number for that Customer or Contact.

    I see some SQL Overrides, but they are mostly just simple HTML to concatenate fields.

    How would I write "Show this checkbox as true if any of these 3 chackboxes is true for this entity"?  ...I see some Advanced CASE logic like:

    '<b>' + ISNULL(viewContacts.Phone,'') + '</b>' + '<i>' + (CASE WHEN viewContacts.AltPhone IS NULL OR viewContacts.AltPhone='' THEN '' ELSE '<br />' + viewContacts.AltPhone END)  + '</i>' + (CASE WHEN viewContacts.Mobile IS NULL OR viewContacts.Mobile='' THEN '' ELSE '<br />' + viewContacts.Mobile END) but I don't know the syntax for IS TRUE...or 'OR'.

    Maybe Conditional based on Value from Row?

    Thanks!

  • 12-17-2013 3:21 PM In reply to

    Re: Add IsSMS checkbox field to all Phones

    Hi Ken,

    I've been tinkering with this on my end. The easiest approach I've had is to generate a SQL override for the Composite Flag field that takes the table with the isSMS field and use a SQL command to filter all the results that actually have SMS recorded inside it (maybe use NOT NULL?). The only other approach I can think of is having a field called "HasSMS?" or something in the Entity table, and update that any time you add an SMS number for a particular customer table. That could be a boolean value (true or false), and you stick that into the grid.

    Let me know if that makes sense. I'll see if I can think of any other ideas.

    Naeem

  • 12-17-2013 8:53 PM In reply to

    Re: Add IsSMS checkbox field to all Phones

    Thanks, Naeem!

    So there are 4 custom Yes/No fields on Entity, the IsSMS* fields. IsSMSPhone, IsSMSAltPhone, IsSMSMobile and the composite, IsSMSAny.

    Maybe I should just campaign for a new Action..."Logical OR", which takes a list of fields as input, and adjusts a target field with the result on any update to those fields.

    Is there an Action which lets me set a linked field which may or may not be on screen, say during update of an IsSMS field on a Contact record?

    Also, setting IsSMSAny to True based on any IsSMS seems easier than unsetting it should the last checked field be unchecked.

    I am still not sure how to get this done, and am very interested in detailed ideas.

  • 12-18-2013 2:04 PM In reply to

    Re: Add IsSMS checkbox field to all Phones

    Hi Ken,

    Well -- there's an action called "Update Field in Table" so I'm not sure why you would have to edit a linked field specifically? Assuming you have "IsSMSAny", run an action with "update field in table" to update that field to "Yes" anytime you add an SMS. It will update all the relevant linked fields.

    Can you let me know if that makes sense? I'm a little bit confused as to where your confusion lies on this issue!

    Naeem

Page 1 of 1 (10 items)