Jump to content

Use a checbox value as a basis of a calc


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

Recommended Posts

Hi people, another question...

I want to use a checkbox value as a basis for a relationship between two files (it's actually the same file). The Value List for the checkbox only has one value "Order Placed".

I want to know, how do I set up my field as a calculation so it checks my Order Placed checkbox and I can tell my portal to only show records where the Order Placed checkbox hasn't been placed. I'm looking for the Calculation Value for the relationship

It would probably be along the lines of

Order_Placed_Calc = SOMETHING BY HERE

Any suggestions?

Thanxs

Steve Griff

Link to comment
Share on other sites

The simplest form of this calculated key is something like:

OrderStatus (text)

CalcKey (calculation, number, indexed) =

If(OrderStatus = "Order Placed", 0, 1)

These are fields in the realated order file.

In the master file, the MasterKey would be:

MasterKey (calculation, number, indexed) = 1

As I said, this is the simplest case. You might want to use a more complex key to show orders not yet placed, say to a particular vendor, by including the vendor ID in the key.

-bd

Link to comment
Share on other sites

Urhmm... I don't know what your going on about smile.gif" border="0

I just want a portal on a layout. The portal shows the records of the database it is on. Therefore the relationship would be : -

Order_Database to Order_Database (A relationship to itself)

The thing that will be used to filter the records to be shown would be a checkbox that is not ticked. That's what I'm trying to work out. How to do that. smile.gif" border="0

Hope that makes more sence on what I'm looking to do, and if what you explained in your last post is supposed to be the solution, then you'd have to explain it a little bit better smile.gif" border="0)

Thanxs LiveOak, and sorry for this hassle.

Steve Griff

Link to comment
Share on other sites

I sometimes "go on" about stuff because you are not the only person in the audience. Of the over 4500 members of the forum, only a few post, but many read the topics. wink.gif" border="0.

Yup, your answer is all in the last post. The ideal is to create a relationship that matches a constant 1 (left side) with a checkbox in a record that MAY be set to one (right side). In this way a record can be made to display in the portal or not by checking a checkbox which results in a "1" appearing in the field used for the right side of the relationship.

-bd

Link to comment
Share on other sites

Ok.. I gotcha but one question.

I've got my two fields here, the first is a calculation field that holds the "answer" that my checkbox value must give if it wants to be shown in my portal. Secondly is my text field that will hold the checkboxes (In this case just one that is defined with a value list with "Order Placed"

So then, what is the answer that is needed in my calculation field that my checkbox is meant to have? Is it "Order Placed", 1, "1" or something else? I've tried these and it doesn't seem to work.

In essence, my relationship at the mo is: -

Quote_Database::Order Placed = Quote_Database::Order_Calc

What does the Order_Calc value need to be?

Thanxs

Steve Griff

Link to comment
Share on other sites

To describe my first post a little differently, go through the following steps:

1) I'm callin your entry field: "OrderStatus" displayed as a checkbox with the value list "Order Placed"

----------------------------------------------------

2) From this calculate the field:

CalcKey (calculation, number, indexed) = If(OrderStatus = "Order Placed", 0, 1)

----------------------------------------------------

3) Also create the field:

MasterKey (calculation, number, indexed) = 1

----------------------------------------------------

4) Create the relationship "OrdNotPlaced"

Define "OrdNotPlaced" with:

Quote_Database::MasterKey <---> Quote_Database::CalcKey

----------------------------------------------------

5) Define your portal to use this relationship.

That's it.

-bd

Link to comment
Share on other sites

This topic is 7365 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

  • Who Viewed the Topic

    1 member has viewed this topic:
    anteas 
×
×
  • Create New...

Important Information

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