outra9e
23rd July 2002, 11:24
I am back with yet another question regarding my NCDR module if that is ok.

I have added a new form to the session and some new fields.

I have added some display fields which are from tccom013 which is customer delivery addresses and an input field which is the delivery address code, also from tccom013.

What I want is when the user has entered the rest of the data and then chooses a delivery address code, the right address is populated in the display fields.

Also, when the user zooms on the delivery address code field, the results are fltered for that customer that has already been chosen only.

Can this be done?

I cannot add a reference to the table tccom013 as it gives an error and tells me that tccom013.cuno must be primary field which it cannot because it can occur in the table more than once.

I have added another customer code field which is tdsls901.dcust because I tried to add the reference to tccom013 to this field not realising the problem with the reference.

I can see that there is a Input./Ref Express box on the fields when in the form editor, can I put a SQL expression in there?

Cheers

MariaC
23rd July 2002, 12:38
You will have to look the information up in your script, or if you have a zoom session for delivery address code you could maybe import the other information from the zoom session

outra9e
23rd July 2002, 15:14
Hi Maria

These fields on the formn are from a completely seperate table and are just display fields.

Will it be possible for me to determine what they are going to display in the program script?

Cheers

evesely
23rd July 2002, 16:15
Maria has the right idea. If you zoom to session tccom1502s000 (Display Delivery Addresses), there is some code that is already present that can set the customer for you. Unfortunately, it will require you to alter your program slightly to fit it. If your address field is named "zoom.cdel.f" and you set an extern variable named zoom.cuno.f equal to your customer, this should pick up and start the display with that customer. The subsession has a zoom.from.zoom.cdel.f section that imports the customer variable before executing a find.data. I know that is kind of forcing things a bit, but... :rolleyes:

As far as the delivery address fields displaying in your main session, if you have your form's field order set correctly, you could do a lookup against the tccom013 table (i.e., select tccom013.* ...)in a before.display section for the first address display field, and, if necessary, force a redisplay in a when.field.changes section of your address code field. There are many other ways to get this to work as well.

I hope this helps.

outra9e
24th July 2002, 13:32
Maria has the right idea. If you zoom to session tccom1502s000 (Display Delivery Addresses), there is some code that is already present that can set the customer for you. Unfortunately, it will require you to alter your program slightly to fit it. If your address field is named "zoom.cdel.f" and you set an extern variable named zoom.cuno.f equal to your customer, this should pick up and start the display with that customer. The subsession has a zoom.from.zoom.cdel.f section that imports the customer variable before executing a find.data. I know that is kind of forcing things a bit, but...


I am not sure what you mean by this?

I have done the lookup and that works fine, but I am not sure what I need to do for my prog script to push the filter to the session tccom1502s000, I have a feeling I am using tccom1502m000, would this make a difference?

:confused:

outra9e
24th July 2002, 15:55
Thanks guys

I have solved this problem now.

Thank you for your help.

I used the tccom1502s000 session.