Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

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

Recommended Posts

Posted

Hi,

I've created a productiondatabase for our tv department. I also created a webinterface to view/list/edit/create records. All of that works just fine. But, I want the user to be able to fire a script, to print the record the user is editing/viewing at that moment. Here's how it goes :

After a find, the user gets the resultpage, showing a list of relevant records. From there, he/she can access all details from that record by clicking a hyperlink, which uses the tag :

<A HREF=[FMP-LinkRecID: format=tv_edit.htm, layout=klooilayout] target=_self>

So far, so good. It shows the edit/view page, where the user can update the record and save it. And now for the tricky part : I also included a hyperlink which will fire a printing script. Link is like this :

<a href="FMPro?-db=studionl.fp5&-Script=printsheet&-format=tv_default2.htm&-findall">

And there it is... Sometimes it prints the right record, sometimes it just prints something different. As far as my ideas at this moment goes, it might have something to do with another user doing a search from the web in the database, which makes another record 'active', if you get my point. So, I tried to create another link, which jumps to a extra html page called print. I used the link :

<A HREF=[FMP-LinkRecID: format=print.htm, layout=klooilayout] target=_self>

in order to force some kind of 're-lookup' of that particular record. The page print.html will use a refresh metatag, which after 1 second will fire the 'printing'-script. Sounds ok, but....it's not working.

So far for the big introduction, how can I make sure that a record I'm editing is the one being printed, even if someone else searched into the datebase (which will happen quite often, I guess) ?

Oh, before I forgot : the printing script is just as plain as you can maken it, it switches to a layout, calls for a subscript to print, and switches back to the mainlayout of the database.

If someone can help me, it would be very appreciated !

Kind regards,

Andr

Posted

You may wish to find the RecID for the record you intend to print and assign that to a Global field. You can then have your printing script read the Global field and find that record and print it.

Be aware that if this is a 'high-hit' site the Global field with the RecID may be changed before the script can print the correct record.

Good Luck.

Garry

Posted

Hi Garry,

I've tried to look for a solution like that, but can't find a way to fill a field with RecID, from a html-page. How does one do such a thing ? And, I'd really like to do that just as the user clicks the print-link (or a little before that)......

Posted

Hmmmm...... having problems with scripts in a browser solution. No big surprise here. First off, ScriptMaker is single-threaded. It handles just one event at a time and does not queue additional requests. Therefore, is a second request is made on a ScriptMaker script, any ScriptMaker script, the subsequent requested events will fail to perform. Additionally, cdml in and of itself is unable to identifiy the event failure and will return to your client a bit of misinformation.

Running ScriptMaker scripts through a browser solution is a matter of design. You can have your client print the browser page or in some other way avoid using a ScriptMaker script, you can re-invent the wheel, or you can buy the wheel and re-design it for your solution. You have choices.

Visit my site.

Posted

ok, I know all about the script-running problems with FM, read your other posts. But, since in this solution the script will be runned only maybe ten times/day, and it is not such a disaster if one of the requests fails, I prefer to use a Layout print over a browserwindowprint. So, I'll just continue looking....

Posted

what I mend was that it's no problem if the user has to hit 'print' again due to the 'script from the web' problem. They're more/less next to the printer, and as I already mentioned, they only print about four/five sheets a day. All other stuff is done in the database, only at the end they need to have a hardcopy to give to the presenter.

Posted

You can use the '-edit' action tag to edit a global field. E.G.

<a href="FMPro?-db=mydb.fp5&-lay=mylayout&-script=printscript&-format=myformat.html&-recid=[FMP-CurrentRecID]&g_print_recid=[FMP-CurrentRecID]&-edit">Print Record</a>

This may not be the best way however it is a start.

All the best.

Garry

This topic is 8156 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.