Jump to content

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

Recommended Posts

Posted

I've got a FM 5.5 db with a custom web interface (built from scratch). I've got things working so that there is an inline action for that looks somethign like this:

[FMP-InlineAction: -db=database.fp5, -lay=Layout #1, -recid={FMP-currentrecid}, [email protected],

[email protected], -MailSub=new entry, -MailFormat=mail.txt,

-MailHost=smtp.hohum.com][/FMP-InlineAction]

the mail.txt looks like this:

<html>

<body>

A new record in ejob has been created with the following information:

<form action="FMPro" method=post>

<input type="hidden" name="-db" value="database.fp5">

<input type="hidden" name="-lay" value="Layout #1">

<input type=hidden name="-recID" value=[FMP-currentrecid]>

created by: [FMP-field:created_by]<Br>

date: [FMP-field:date]<br>

title: [FMP-field:title]<br>

</form>

</body>

</html>

My question is this: When I get the email, it just looks like this:

A new job....

Created by

Date:

Title:

Any help about what I'm missing or what needs to be changed would be GREATLY appreciated.

Thanks

Jackson

Posted

Excuse me if I seem dense, but I've never used a mailto. However I like to understand the processes.

I see this code which is the body of the email:

"A new record in ejob has been created with the following information:

<form action="FMPro" method=post>

<input type="hidden" name="-db" value="database.fp5">

<input type="hidden" name="-lay" value="Layout #1">

<input type=hidden name="-recID" value=[FMP-currentrecid]>

created by: [FMP-field:created_by]<Br>

date: [FMP-field:date]<br>

title: [FMP-field:title]<br>

</form>

</body>

</html>

I fail to grasp the value of these lines:

<form action="FMPro" method=post>

<input type="hidden" name="-db" value="database.fp5">

<input type="hidden" name="-lay" value="Layout #1">

<input type=hidden name="-recID" value=[FMP-currentrecid]>

...

</form>

A form is not being submitted from the body of the email; not to mention a lack of type="submit" command. So to better my understanding, what is the purpose of this form (lacking action) in the body of the email? Thanks.

Posted

The only thing that should be in the body of the email is the "hard" text and relacement tags.

eg

----- Start MailFormat text file ------

(You don't need that bit above wink.gif - just to make things clearer)

Dear [FMP-Field:'forname']

Thanks for starting a new record.

Your details are as follows

Name: [FMP-Field:'forname']

etc etc

Your sincerely

WebMaster

----- End mail.format text file ------

The replacement tags are processed by WC based on the action u performed last exactly the same as a standard format file

In your case the action is performed in the Inline action on the response page from when the user added the record - you will need a database action in the inline action - as suggested you could just refind the record with a -find

With Inline actions you don't need the form elements in the response page either - WC checks a format file for inlines and processes these before replacing any replacement tags and returning the format file to the user .... this is how any replacement tags you place inbetwwen the opening and closing tags of the inline action will be processed based on the action performed by the inline.

This functionality allows you to address more than one database in a format file - and sometimes can remove the need for potentially troublesome related fields .... although that may be jumping the gun with what you want to do at the moment - you can begin to see the power of inline actions when used correctly

cool.gifsmile.gif

Posted

Thanks for the advice, folks!

I've added the following to the inline action:

[FMP-InlineAction: -db=database.fp5, -lay=Layout #1, -recid={FMP-currentrecid}, [color:"red"]-find=action, [email protected],

[email protected], -MailSub=new entry, -MailFormat=mail.txt,

-MailHost=smtp.jax.org][/FMP-InlineAction]

as well as got rid of all the non-necessary form tags in mail.txt

But it still doesn't work.

Please don't take offence, but I tend to understand things best if I see a working example. (although your responses were definitely helpful in understanding the big picture) smile.gif

I would be a great help if perhaps, *grovel* out of the kindness of your hearts, one of you could provide that?

Thanks,

Jackson

Posted

Try this:

[FMP-InlineAction:

-db=database.fp5,

-lay=Layout_1,

(I would change the layout name to one not containing spaces this shouldnt effect Inlines but can cause problems with NS when in URL's)

-recid={FMP-currentrecid],

[email protected],

[email protected],

-MailSub=new entry,

-MailFormat=mail.txt,

-MailHost=smtp.jax.org,

-Find]

[/FMP-InlineAction]

the -Find can actually go anywhere but i doesn't need to be paired with a value.

Posted

ahhh.... it works (for the most part)

the email gets sent, but the CDML replacement tags I've included in the mail.txt don't work. (they don't show up in the email, just a blank space where they should be)

any suggestions?

Posted

Sorry I should have paid more attention to what I was posting yeaterday

recordID is not required and should not be used for finds as it is an internal numbering system used by filemaker and can change if the database is closed then reopened or recovered. RecordID is only required when identifying a record for updating (-edit) or deleting.

Try the code below - I have used the field forename u will want to change this to a field tht uniquely identifies the person to which you want to send the email.

Notice also the { surrounding the intratag rather than the [ square bracket.

[FMP-InlineAction:

-db=database.fp5,

-lay=Layout_1,

forename={FMP-Field:forename},

[email protected],

[email protected],

-MailSub=new entry,

-MailFormat=mail.txt,

-MailHost=smtp.jax.org,

-Find]

[FMP-CurrentError]

[/FMP-InlineAction]

Just for testing you may want to put some replacement tags between the opening and closing inline tags .... also include a [FMP-CurrentError] tag (as above) to see if there are any errors when processing the Inline.

Posted

This is good, I think I'm getting somewhere with this.

However, the replacement tags in the email still don't show.

here is the entire contents of the mail.txt:

A new record has been created with the following information:

created by: [FMP-field:created_by]

date: [FMP-field:date]

title: [FMP-field:title]

department: [FMP-field:department]

general description: [FMP-field:general_description]

*This email was automatically generated*

It seems like the inline action is working, too. So I'm completely baffled. Does the submit button at the end of the form need to do a certain function? Right now it does a -view action.

Posted

The InlineAction is searching (-find) on the 'Forename' field. What if you 'hardwire' a value into the 'Forename' field for testing purposes.

This will check if the '-find' is working. My guess is that a record is not being found, hence the empty values in the email.

All the best.

Garry

  • 2 weeks later...
Posted

When I harwire a value, it still doesn't work. And on top of that, the error that I'm getting is "100, file is missing". I can't figure out what is going wrong, and I've checked and re-checked the HTML and CDML numerous times looking for typos. Any thoughts?? I'm about ready to pull my hair out.

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