Expand my Community achievements bar.

SOLVED

Yesterday, i posted asking for help to get a Customer code working. Now the statement is not actually showing what what's its creating.

Avatar

Level 2

I pasted the statement into my form and it didn't have anymore syntax errors but now it is not actually creating the code. i type in the name and a phone number but nothing is happening?

If you need anymore info please ask. I'm not sure what else to post to help.

1 Accepted Solution

Avatar

Correct answer by
Level 10

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


Here you see what is the event initialize, and you can change the event on any field in the form

event.png

By looking at the top of the script editor you can see there is Show: with a dropdownlist on the side, you can choose all events from there, so choose calculate and make sure you are in formcalc

View solution in original post

6 Replies

Avatar

Level 10

Hi, could you post the code you are using + Hierarchy of the form...

And could you explain exactly what you are trying to do.

If you have pasted code without giving it any modifications appropriately to the form, there is big chances it will not work because LiveCycle JavaScript need to refer to the right syntax according to the hierarchy.

You can't use code with names that doesn't exist in your form, it needs specifications on the reference_syntax.

Avatar

Level 2

I am trying to Take the first letter from the Company Name/Customer Name and the last 4 digits from the customers phone number. add them together to create our customer code. IE, my name is sam and the last 4 digits of my number are 6770 so my customer code would be S6770.

here is the code that is under the text field i am trying to use.

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

Concat(Left(CustName,1) , Right(TextField9,4))

Heirachy:

form1

     -master page

          -page 1

               -(untitiled content area)

     -(untitled subform) (page 1)

          -rectangle1

          -text6

          -CUst.Type

          -CustName

          -SHip.Via

          -CustCode

          -TextField8[0]

          -Text23[0]

          -Text24[0]

          -Text25[0]

          -TextField8[1]

          -Text23[1]

          -Text24[1]

          -Text25[1]

          -CHeckBox2

          -Text26[0]

          -Text27[0]

          -TextFIeld9[0]

          -Line4[0]

          -Text26[1]

          -CHeckBox3[0]

          -Text27[1]

          -Line4[1]

          -Text27[2]

          -CHeckBox3[1]

          -Text26[2]

          -POReq

          -Text22

          -OfficeUseOnly

               -Text29

               -Text13[0]

               -PrintState

               -Text13[1]

               -interest

               -terms

               -CreditLimit

               -PriceMatrix

               -DropdownList1

               -TextFIeld11[0]

               -CHeckBox1[0]

               -CheckBox1[1]

               -Text15

               -TextField11[1]

          -DropDOwnList5

          -Deafult.Loc

          -Text28

          -Text15

          -CHeckBox1[0]

          -CHeckBox1[1]

          -TextField10[0]

          -TextField10[1]

          -TextField10[2]

          -TextField10[3]

          -TextField10[4]

          -TextField10[5]

          -TextField10[0]

          -TextField9[0]

          -TextField9[1]

          -TextField9[2]

          -TextField9[3]

          -TextField9[4]

          -TextField9[5]

          -TextField9[6]

          -TextField9[7]

          -TextField9[8]

          -TextField9[9]

          -TextField9[10]

          -TextField9[11]

          -TextField9[12]

Here is a picture of the form i am trying to make.

New cust form.jpg

Avatar

Level 10

Hi, well the only thing I can see is the event you are using.. Since you want a field to equals a certain value when both fields are filled, you would need to go in the Calculate_Event of the Field..

Initialize only fires when an object is first created...

Avatar

Level 2

is that a coding statement i must make? cause i can't see that as an option to edit in the text field. I am terribly sorry. but programming/coding is not something i am good at

Avatar

Correct answer by
Level 10

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


Here you see what is the event initialize, and you can change the event on any field in the form

event.png

By looking at the top of the script editor you can see there is Show: with a dropdownlist on the side, you can choose all events from there, so choose calculate and make sure you are in formcalc

Avatar

Level 2

AWESOME!!! Thank you so much! You guys have been so much help over the last few days. and the quick responses are super helpful!