3 Replies Latest reply on Aug 27, 2011 5:30 AM by GuyStevens

    Force commit to make lookup in portal work

    GuyStevens

      Title

      Force commit to make lookup in portal work

      Post

      I seem to be having the following problem.

      I'm making an invoice for a rental company.
      Some of the fields on the invoice layout are: "Start Date" and "End Date"
      These get calculated into a "Amount of days" ("End Date" - "Start Date")
      But because there can be weekend days there is also a text field "Actual Amount of Days" where you can manually type in the amount of days the items will need to be paid for.

      Now I have a portal with "line items" and they have a lookup field that looks up the "actual amount of days" from the main layout.

      What I noticed is that these days do not get filled out in the portal untill I hit "enter" in the "Actual Amount of Days" field on the main layout. And only then will I see them appear in my portal.

      It's like I need to force commit this field in my layout for my lookup to work in my portal.
      Just typing a value in there and hitting the tab doesn't seem enough.

      Anyone any ideas?

      I've heard suggestions like creating a script trigger to force the commit. But I haven't looked into scripting for Filemaker yet.

      I will do so and when I figure it out I'll let you all know :)

      Untill then, if anyone has any suggestions, feel free..

      Thanks in advance.

        • 1. Re: Force commit to make lookup in portal work
          philmodjunk

          "but because there can be weekend days there is also a text field..."

          You may get away with that, but it's better to use a number field instead of a text field for this.

          "Now I have a portal with "line items" and they have a lookup field that looks up the "actual amount of days".."

          There are several different mechanisms for achieving that result. Which one did you use and why do you need this value copied to every line item in the portal? Would a calculation that refers to this "number of days" field in the parent record also work for you? (It should avoid the need for forcing the commit here.)

          • 2. Re: Force commit to make lookup in portal work
            GuyStevens

            "You may get away with that, but it's better to use a number field instead of a text field for this."

            You are right. That was a dumb one on my behalf. When I wrote "text field" in my post I didn't even mean that the field type was text but when I double checked in my database that field actually was set to the text type in stead of number.

            I changed it but it doesn't change the behaviour of the lookup.


            "There are several different mechanisms for achieving that result. Which one did you use"

            It's simply a lookup field in my line items table that looks up the value in my invoice table.


            "why do you need this value copied to every line item in the portal?"

            Because most of the time people rent a bunch of items for the entire period (the period it takes to shoot a film)
            And in addition they will often come and rent certain items for shorter periods of time. Like one or two days.

            So by default it's the "actual amount of days" but sometimes it's less.

            So I do need this value to be seperate for every line item.

            Thanks for your suggestions.

            • 3. Re: Force commit to make lookup in portal work
              GuyStevens

              Ok, I am pretty sure I found a suulution :)

              For the field that needed an extra commite in order to work i created a "Commit Record" script trigger on the "OnObjectValidate".
              This way when you type in something the field defenitely gets committed.

              I also have a field with two radio boxe that have an auto value. In order to force a commit on those (because you might not change those)
              I created a script that would go to that field and would commit the record. I placed that script on the script trigger of "OnLayoutEnter"

               

              Seems to be working nicely sofar :)