xTuple.com xTupleU Blog & News Customer Support

Vendor address cluster

Using Windows version 5.1

I am having trouble on my revised PO screen to get the lines, city, state and postal code of the vendor address cluster

I try the following

var vendAddr = mywindow.findChild("_vendAddr"); //AddressCluster

vendAddr.line1 returns blank even though the line 1 shows “P.O. BOX 827523”

In the debugger if I try

.eval vendAddr.line1 returns blank

the local variables on the debugger screen are no help , because it is listed as a function line1()

so I try

.eval vendAddr.line1()

TypeError: Result of expression ‘vendAddr.line1’ [] is not a function.

funny thing is, that the ship to address cluster does not give me any problems

shiptoAddr.line1

102 Third St correct

so I double check my variable in the debugger

vendAddr

_vendAddr this is the vendor address cluster

I must be doing something wrong here , so does anyone have any ideas?

Thank you

Bob

I have addition confusing information

I have added two addition address clusters

patAddr which is our patient address

So in the debugger, I do

patAddr.line1
function line1() {
** [native code]**
}

then

.eval patAddr.line1()
2814 West Liberty Ave

why does this address cluster require a function call line1() and the vendor addr cluster does not

.eval vendAddr.line1()

TypeError: Result of expression ‘vendAddr.line1’ [] is not a function.

Bob,

Some dumb questions:

  • What does the Local Variables list say vendAddr is if you set a breakpoint right after the findChild() call?
  • Does your script contain any assignments to vendAddr other than the initial findChild() call?
  • Does your script contain any assignments to vendAddr.line1?

Gil

HI Gil

  1. I initialize the vendAddr at the beginning of the script and no place else

var vendAddr = mywindow.findChild("_vendAddr"); //AddressCluster

  1. no place else
  2. The only place that I set the vendAddr.line1 is when reading from the database to set the fields.

I will remove this line and see how it goes.

OK, when I breakpoint the vendAddr.line1 = q.value(23);

.eval vendAddr.line1() returns P.O. BOX 827523

after the line

.eval vendAddr.line1()
returns

TypeError: Result of expression ‘vendAddr.line1’ [] is not a function.

strange

Ok Gil

It looks like I need to use the function call setLine1

vendAddr.setLine1(q.value(23));

and when I save to the database I have to use

vendAddr.line1() *** function**

everything seems to work fine.

Thank you for your help Gil

:+1: