Jump to content

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

Recommended Posts

Posted

According to FileMaker documentation these are script steps that support multiple script steps in Instant Web Publishing. When I try and use Exit Record followed by Go to Layout in the same script I get the following error on execution of this step via a button while in data entry:

"Data Entry Error: Your attempt to save changes to the new record failed because of the following: Unknown error number 102."

Any thoughts - thanks - Ubo

Posted

Keith

Thanks again, I had already been onto the FM site and pulled one of their tech articles on this error with regards to web companion. What is really confusing me is that if I allocate a separate buttons to the two functions, i.e. one to Exit Record to submit the data and then another to go to the next layout, the error does not arise.

Ubo

Posted

Since error 102 is Field is missing, I would guess that the field does not exist on one of the two layouts which are involved. I would try placing the field on the layout where it does not now exist, but hiding it from view, keeping it out of the tab order, and disallowing entry to the field in that layout.

Posted

Keith

Thanks for the advice, I have just tried a couple of layouts will all database fields in them and this seems to work. There are quite a few auto entry fields on this database, e.g. modification and creation details etc and this might have been causing the issue. Only problem is that if you don't go into edit mode then the Exit Record/Go to Layout button doesn't work but I think of something in terms of the screen layout to get round this.

Thanks again

Ubo

Posted

From my old post:

Use only single layout for web serving.

If you use more layouts, you are asking for trouble.

Have single layout (web, cgi, my -- any name will do) and put all fields from database on that layout. Then you cannot end in wrong layout.

If you will copy fields names to the HTML/CDML, you will never made typo and you will save days in long run and gray hair.

Another similar example:

This I do recommend to all programmers:

Start with single layout with single field.

When this works OK, add more fields by ONLY copy/paste and never try to write manually something.

That way I am working very fast and I never had typo. I've learned this from my mistake. I've inherited database and it didn’t work in CDML. It took me 2 hours, that the author of the database named one field "Name " instead "Name". Because I've just typed that as "Name", FM/WC didn't work at all. When I did the copy I've discovered the space frown.gif

  • 4 months later...
Posted

I am having a similar problem to this, but the solution posted here does not solve the problem that I am experiencing.

I have two files published with Instant Web Publishing (on a LAN for internal use). A button on file1 will open file2 and the startup preference in file2 will run a script that enters New Record mode, so the field is already editable.

Next the user types in the text into the field. So far so good.

A button on that layout in file2 has three script steps:

1) Exit Record (i.e. submit)

2) Open document "file1"

3) perform script (external script in file1 that switches layout)

I don't get any errors. Instead when this button is pressed, the user is correctly taken back into file1 and to the appropriate layout. The only problem is that the text that they entered is never submitted.

To clarify, I have a field in file1 that displays as a popup menu, using a field from file2 as the value list. When the user enters text in that field (i.e. this is my workaround since IWP does not allow the "other" option on popup menus) and goes back to the first file, the new text is not added to the popup menu.

Any ideas? confused.gif

Thanks.

Ken

Posted

There are some limitations on value list under web publishing. Certainly a value list of related items does not work.

More research @ www.filemaker.com on their TechInfo database.

Posted

There are some limitations on value list under web publishing. Certainly a value list of related items does not work.

I don't think this is the problem. The value list is set to use values from a field in file2 and it does work (i.e. it is not based on a relation). The only thing that is not working is the multiple script steps--which are supposed to be supported. For example, if after going to file2 and entering a value in the field, if I first submit, then switch back to the file1 in a separate step, the new value does appear in my value list. If those steps are combined in the same script (triggered by a button on the page), then it switches back to file1 and displays the right layout, but the submit never seems to have happened because the new value is not there.

I'd hate to make my users go through two steps for this, but that's what I'll do if I have to. These steps are supposed to be supported by Instant Web Publishing though (and I only have three steps in the script). Any more ideas?

Thanks.

Ken

Posted

"A button on that layout in file2 has three script steps:

"1) Exit Record (i.e. submit)

...

"The only problem is that the text that they entered is never submitted."

And it never will be using the Exit Record script step.

There is something which is very crucial to a succesful IWP or CWP solution and which you appear to have not grasped. The reason the text never will be submitted is because your client is using the Web, a stateless medium. As such the user is not in direct contact with the db, as she would be in a peer-to-peer solution.

Posted

I appreciate your input, but I don't agree with your reasoning. From the FMP Help subject "Scripts and Instant Web Publishing" there is a list of supported single step scripts where it states:

FileMaker Pro script step: Exit Record

Equivalent action in browser: Submit Form

Further, Exit Record is listed as being supported in multi-step scripts.

Note that if I manually click on IWP's "Submit" link, then use the button to open the other file and go to the desired layout, then it works and the new value is listed in my popup menu with all other values. It does not get listed (or submitted) however when Exit Record is the first of a three step script button though. All three steps are supposed to be supported as multi-step scripts in IWP. This is what I don't understand.

If I am totally missing the point still, please explain why. I don't see that I need CWP to do this, unless someone can confirm that this feature does not work as published. Ohterwise, I'll assume I'm not setting it up correctly somehow.

Thanks!

Ken

Posted

Re: FileMaker Pro script step: Exit Record

Equivalent action in browser: Submit Form

I'm not sure if this means that if you are using a browser you need to press "Submit Form" to have the same effect as "Exit Record".

Some subtle semantics in the FM explanation may be misleading (or just poorly explained)!

You can check this by viewing the source for the page while it is in your browser. Check to see what action is taken when the "Script" button is clicked.

All the best.

Garry

Posted

I'm not sure if this means that if you are using a browser you need to press "Submit Form" to have the same effect as "Exit Record".

Once again, I appreciate the response and I will test this again first thing Monday morning. But to me, this explanation does not make sense either. If FMP tells me that the Exit Record script step is supported in IWP and that the equivalent action in the browser is Submit Form, then if I have to manually click on Submit, what's the point of a script step? It's no longer automated.

To me, this says that if I execute the Exit Record script step then it should behave as if I had clicked Submit Form from the browser. Unfortunately, this is not what's happening for me yet. confused.gif

Ken

Posted

Step one: access web site.

Step two: access db

Step three: access a record

Ok. now a client is viewing an existing record. Or thinks she is.

The image being viewed has been downloaded into cache. The client is not in direct touch with the record or db at this time. The client is in touch with an image of a record. This is smoke and mirrors, get used to it. This is what is meant by "stateless".

The design of the image in the web browser allows the client to type text into that image. Now the client is hits a button in that image which generates a script event which has as its first command, "Exit record". That script is sent across the web to the web site's server where a connection is re-established with the db and command is given to the db vis a vis the cdml tag "-script", which has been generated by IWP. The first step of the event which is performed by the cdml tag "-script" is "Exit record". The record will be exited without any action having been taken to alter its fields for no cdml command was presented to edit or otherwise alter the record. Then the remaining script steps are performed:

2) Open document "file1"

3) perform script (external script in file1 that switches layout)

"Note that if I manually click on IWP's "Submit" link...". Ah ha! If you click the "Submit" link, that sends a message across the www to the site's server where a connection is re-established with the db and a cdml action is taken (IWP generated "-new" or "-edit"). A cdml action is different from a script event. A script event can be a cdml command (see cdml tag "-script"). Please also note that if a script event fails to run cdml will not recognize that event failure and will inform your client of a successful transaction. Whether using IWP or CWP what the client sees is basically an html file, which, when coded with cdml is referred to as a format file. IWP writes the cdml "on the fly", but with restrictions to what can do.

To do what you are trying with IWP is going to take two clicks. One to submit the change and one to perform a script event (a navigation which would be handled in CWP with a format file instead of a db layout change). Note that the navigation event of the script in this instance causes IWP to generate a format file to describe to the client the layout of "file1", which is what the client sees.

Whether using IWP or CWP what the client sees is basically an html file, which, when coded with cdml is referred to as a format file. The client never sees the actual record. All contact with any record can be described as "momentary" at best. Smoke and mirrors. Stateless.

One other thing, the script step to which you refer is supported by IWP. The script works. You've already stated that. The problem you are experiencing is that you cannot attach that script step to the "-edit" tag (or "submit" button) so that the record is edited, and IWP does not support that attachment.

The automation you desire is not possible in IWP because of the restrictions on the application to enable it to create format files on the fly. Rather than get hung up with IWP's very necessary limitations, one can write CWP in order to have control.

I hope this will increase your understanding. Best of luck to you.

Posted

Thanks for the detailed reply. I've read through it a few times now and I understand how this is working except for one point.

The record will be exited without any action having been taken to alter its fields for no cdml command was presented to edit or otherwise alter the record.

Why not? Of course it will take an action. That's why it's a supported script step. What's the point of it if it does nothing? I'll add here that I'm not new to HTML or web sites. I've developed a number of sites with WebStar and Canto Cumulus (an image database--though not relational) and I understand about "stateless", the need to submit the changes made to the static page, etc.

"Note that if I manually click on IWP's "Submit" link...". Ah ha! If you click the "Submit" link, that sends a message across the www to the site's server where a connection is re-established with the db and a cdml action is taken (IWP generated "-new" or "-edit").

Let me clarify. I can put the Exit Record script step in a script by itself (no other script steps) and attach it to a button and it does work just as if I had clicked IWP's "Submit" link. Therefore, it is not as you described because it does submit the record from the script step.

So my question is why does this work when it's on in a script attached to a button by itself, but not when there are script steps following it, even though all three script steps are 'supported' as multi-step script steps? Is it possible that IWP is not behaving as the documentation describes or am I still missing the boat?

Thanks.

Ken

Posted

View the page source when the page is loaded into the browser. What does the html surrounding the "Button" look like?

What html action is taken when the button is clicked?

That is an excellent suggestion. I have in fact tried this already. Unfortunately, I have very limited understanding at this point of JavaScript, so I had trouble figuring out what was what on the page and couldn't actually find my button. I'm posting a text file that contains the page source for my sample. Would someone mind taking a quick look and showing me what the code for the two buttons is? This might help me to understand my problem.

The page is very simple. The IWP navigation is disabled. There is only one text field and two buttons on the page. One button is attached to a script with a single step to "Exit Record". The other button is attached to a script with three steps "Exit Record", "Enter Browse Mode" and "Switch Layout" all within one document.

As always, any help is very much appreciated. Thanks again!

Ken

Submit_Sample.txt

Posted

Thank you.

Unfortunately, it looks as if they have "hidden" most of what is going on in a Javascript include file.

I was looking to see if a "submit()" command was being issued when the Button is clicked. Also, the see which "FM Action" was being used when the form/url is sent to FM.

Have you had any luck speaking with FM Support?

Good Luck.

Garry

Posted

"From the FMP Help subject "Scripts and Instant Web Publishing" there is a list of supported single step scripts where it states:..."

Ok, that is what is stated for a "single step script". And as you have seen, submitting the single-step "Exit Record" allows the record to be edited, which would cause one to conclude that a cdml "-edit" tag is generated by IWP for that single-step script. However, the script you are offering fails to meet that "single-step" criteria.

Consider:

1. If either of the other two steps of your script is submitted as a "single step script', what cdml action tag is generated ("Equivalent action in browser:")? Have you found a reference for that? You did not mention those or the FMP version you are using.

2. Since IWP generates the html/cmdl on the fly, it might be worth knowing in a multi-step script which script step causes generation of the cdml action tag?

3. Given that you are using a "multi-step script", have you tried rearranging the script so that "Exit Record" is the second step, the third step?

I don't use and have never tried IWP, so I can only conjecture about the shortcomings. I am hopeful that you find the answer you are seeking and that these suggestions may be useful in that quest. Good Luck to you.

Posted

First of all, I just want to say "Thank You" again to all of the very helpful people on this forum. I appreciate the time you've taken to help me with my questions. As you have probably guessed by now, I'm throwing in the towel for IWP and once my boss gives me approval, I'm going to start with CWP.

Just to be thorough, I'd like to follow through on this discussion anyhow:

"From the FMP Help subject "Scripts and Instant Web Publishing" there is a list of supported single step scripts where it states:..."

Ok, that is what is stated for a "single step script". And as you have seen, submitting the single-step "Exit Record" allows the record to be edited, which would cause one to conclude that a cdml "-edit" tag is generated by IWP for that single-step script. However, the script you are offering fails to meet that "single-step" criteria.

This is exactly the point I've been trying to make from the first post. It does work as a single script step, but not in a multi-step script. In the same help subject, it also states that Exit Record IS supported as a multi-step script step! However, it does not perform that way. The other two script steps are Open file and Perform external script (choosing a script from the file just opened). (Sorry, I forget the exact terminology which is not in front of me at the moment.) I have not tried to re-order them because it does not seem logical to run these in another order.

In any case, I've decided that I understand it correctly, I am doing it correctly and there must be a bug preventing IWP from performing this combination of script steps correctly. Rather than follow through, I'm quitting (!) and I'll create the DB with CWP.

Thanks again to everyone for your time. (Stay tuned for all of my CWP questions that will inevitably find their way to this forum... smirk.gif )

Ken

This topic is 8058 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
×
×
  • Create New...

Important Information

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