Jump to content

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

Recommended Posts

Posted

Working on a CD shop with FMP 6 and CDML I want to send the visitor from the welcome page to a list of the 10 newest CDs and open a new order record at the same time. This is not so difficult: I make the new order record while sending the visitor to the page where the CDs are listed using an inline action.

My problem is to get the token of the new order record. I need to pass it along when the visitor clicks on a CD. But when he clicks on the CD it's the RecID of the CD and not the RecID of the order record. Probably I should get the token while creating the page. But how can this be done?

Thanks for any hint

PJ Wassermann

Posted

If you create a new record with "-new" you can get the RecID in the next page with the [FMP-CurrentRecID]. You can assign this to a "Token" with:

<input type="hidden" name="Token" value="[FMP-CurrentRecID]">

You can then reuse it with "-edit" like this:

<input type="hidden" name="-recid" value="[FMP-CurrentToken]">

Good Luck.

Garry

Posted

If you create a new record with "-new" you can get the RecID in the next page with the [FMP-CurrentRecID]. You can assign this to a "Token" with:

<input type="hidden" name="Token" value="[FMP-CurrentRecID]">

Hi Garry, greets to Australia!

Sure this works but my problem is that on this next page I have CDs listed. If someone clicks on a CD (for detail view or buying) then he gets the recID of the CD into the token and not the recID of the new order record.

Can I use inlineAction to get the token filled while creating the page?

kind regards

PJ Wassermann

Posted

If you are using Links to goto a listed CD then you may be able to do it with a little bit of Javascript:

[FMP-InlineAction: ......., -new]

<script>newrecid = "[FMP-CurrentRecID]";</script>

[/FMP-InlineAction]

[FMP-Record]

...List of CDs

<script>print("[FMP-Field:cdname] ....<a href='FMPro?-db=....&-Token=" + newrecid + "&-find'>View Details</a>");</script>

[/FMP-Record]

Hope this helps. All the best.

Garry

  • 2 months later...
Posted

Hi Garry

I was so busy with other stuff that only now I started to come back to this problem. I tried:

[FMP-InlineAction: -db=miOrder.fp5, -lay=all_Order, -new]

CurrentRecID]";

[/FMP-InlineAction]

No new dataset is created. What's wrong with the inline action?

kind regards

PJ Wassermann

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