Highlighted

Create a customer code using the First letter of a customer name and the last 4 digits of a phone number

Avatar

Avatar

PatrickHJS

Avatar

PatrickHJS

PatrickHJS

25-09-2014

I am trying to create a form where one the customer has input their name and phone number it should grab the first letter of the customer's name and then the last 4 digits of the phone number.

I am not very good at coding, and have VERY VERY limited background in coding. I understand a little (the basics pretty much).

I am thinking i am not using the right expression to get what i want. Below is the statement I have write. This is just to find the first letter of the name, have an idea on how to get the phone number but i was trying the use the "left" and "right" functions but they wouldn't work. More specifically the left.

form1.#subform[0].CustCode::initialize - (JavaScript, client)

str = CustName;

var a = str.substr(0, 1);

any help would be greatly appreciated.

If more information is needed, please don't hesitate to ask.

Replies

Highlighted

Avatar

Avatar

jnicholas330

Avatar

jnicholas330

jnicholas330

25-09-2014

If you switch your language to FormCalc you can use the Left and Right functions, e.g.

Concat(Left(Name,1) , Right(Phone,4))

Highlighted

Avatar

Avatar

PatrickHJS

Avatar

PatrickHJS

PatrickHJS

25-09-2014

Awesome! thank you so much