Jump to content

Autoenter calculation and Lookup in same Field


This topic is 6435 days old. Please don't post here. Open a new topic instead.

Recommended Posts

I have a bill to address and a ship to address. Currently I have an autoenter calculation that autoenters the bill to address in the ship to address fields. Now I've added a related file for shipping addresses so when the ship to address is different from the bill to address I want to be able choose from the value list (which has values from the shipping file)and then lookup the values for the ship to information. From my understanding you can't have an autoenter calculation and a lookup in the same field, so I'm looking for any workarounds or suggestions. This seems like a simple thing but I can't seem to find a clean solution.

Any help is greatly appreciated

Link to comment
Share on other sites

If your value list is used on, say, field1, then you can create a calculation such as Case( IsEmpty( field1 ), billTo, Shipping::shipTo ) and then lookup the calculation. 'Shipping' would be the relationship from field1 to the shipping file.

Link to comment
Share on other sites

I can see how using a calculation could put the Bill To information in if field1 was empty (the value list), but I wanted to also use field1 to trigger the lookup. Field1 displays all the ship to addresses in the shipping file, and once one is chosen I want the ship to name address etc. to be filled out. Maybe I don't understand the part where you lookup the calculation. If you could elaborate that would be great.

Thank you!

Link to comment
Share on other sites

Then you can change Shipping::shipTo to field1. I assumed you were using an id for the value list. Is all the information in field1 or are there separate fields for address, city, state, zip? If they are separate, it may be easier to use a script (assuming field1 is formatted as a menu, not a list) to set the individual fields. With a menu, you can format the field as a button attached to a script that goes to the field, pauses, then continues when a selection is made and sets the fields accordingly.

Link to comment
Share on other sites

I guess I still don't understand your suggestion. When the record is created the ship to fields are automatically entered with the bill to information. The ship to fields are Ship To Name, Ship To address, ship to city etc... There is also a ship to code. That is a value list that draws from a field in the shipping file, I want the user to be able to choose the value there (when the ship to information is different than the bill to information) and the fields based on that lookup (ship to name, address, city, st, zip) will be filled in.

Currently the ship to fields have auto enter calculations that are equal to the bill to fields. I was looking for a clean solution where if there is a different shipping address the user can choose a value from the shipping code field and it will lookup the new values for the ship to fields. It would be great if I could have an auto enter calculation and a lookup in the same fields.

I apologize if I didn't explain the issue sufficiently. Any ideas would be appreciated.

Thank you,

Caroline

Link to comment
Share on other sites

Am I correct in assuming that your billing and shipping addresses are in two separate files? If so, this gets more complicated than it need be. It would be much easier to have all both addresses in the same file and simply mark them as shipping or billing. With separate files, you'll need a calculated field, for each field that you want to lookup, equal to Case( IsEmpty(ShiptoCode), Billing::Name, Shipping::Name ), for example. Then you can set the Name field to lookup this calculated field.

I would suggest using a trigger field for the lookup. Create a calculation field equal to Case( ShiptoCode, serial, serial ), and a self-relationship from this field to serial. Then any time ShiptoCode changes, the data should relookup.

Note: you may need to script initial creation of a record and

Exit Record/Request

Set Field [serial, serial]

in order for the initial lookup to occur.

Link to comment
Share on other sites

This topic is 6435 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.