This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

A little VB Script help please?

Former Member
Former Member
I have property definitions for FirstName, Surname, and FullName.
I need the user to be able to enter the FullName in a single field, and to automatically calculate the FirstName and Surname.
I can use the automatic value 'Simple concatenating of properties' to achieve the reverse result, but presume I need to use Calculated Value(VBScript) to separate the FirstName and Surname.
I could do it easily in EXCEL but I'm not a programmer and don't know how to do it with VBScript. ???
I wonder if somebody would be kind enough to give me the code for this?
Parents
  • Former Member
    Former Member
    You could probably do the same setup with 3 properties:

    • FirstName
    • LastName
    • FullName

    Then, FullName would be set to be an Automatic Value that concatenates the FirstName and LastName. Then, you can set the FullName to be the name of the object (in Class properties, select the property you want to set as name and press Set As Name button). This would eliminate the need for vbscript code, since you could use the simple concatenation option to populate the FullName property.

    Thanks for your guidance on this. I tried the VBScript code but it didn't work and I didn't have the knowledge to debug it myself.
    I had explored the simple concatenation approach but hadn't realised how accommodating it was and wrongly assumed some limitations that don't exist. It is simple and works well.

    The only minor downside is that, if FullName is automatically calculated, and I use it as the class name for 'Client', and the user needs to create a new Client from within Phone Call it doesn't carry over the name they type in and they have to re-type FirstName and LastName. It's no big deal, but that is why I was experimenting with making FisrstName and LastName the calculated fields. Obviously wouldn't be an issue for clients who are already in the system.

    Thanks again!
Reply
  • Former Member
    Former Member
    You could probably do the same setup with 3 properties:

    • FirstName
    • LastName
    • FullName

    Then, FullName would be set to be an Automatic Value that concatenates the FirstName and LastName. Then, you can set the FullName to be the name of the object (in Class properties, select the property you want to set as name and press Set As Name button). This would eliminate the need for vbscript code, since you could use the simple concatenation option to populate the FullName property.

    Thanks for your guidance on this. I tried the VBScript code but it didn't work and I didn't have the knowledge to debug it myself.
    I had explored the simple concatenation approach but hadn't realised how accommodating it was and wrongly assumed some limitations that don't exist. It is simple and works well.

    The only minor downside is that, if FullName is automatically calculated, and I use it as the class name for 'Client', and the user needs to create a new Client from within Phone Call it doesn't carry over the name they type in and they have to re-type FirstName and LastName. It's no big deal, but that is why I was experimenting with making FisrstName and LastName the calculated fields. Obviously wouldn't be an issue for clients who are already in the system.

    Thanks again!
Children
No Data