• 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!

TOPIC: Mappings and Scripts

Mappings and Scripts 13 years 11 months ago #13596

  • houfton
  • houfton's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 8
  • Thank you received: 3
I am trying to use a combination of Mappings and a Script which is called on form process. I need the Mappings to happen first and then use the script to retrieve the id of the new row in the database created by Mappings.

Unfortunately it seems that the Script is processed first?

If so, is there any way to achieve what I want without putting everything in to the Script?

Richard
The administrator has disabled public write access.

Re:Mappings and Scripts 13 years 11 months ago #13691

  • andreic
  • andreic's Avatar
  • OFFLINE
  • RSJoomla! Official Staff
  • Posts: 745
  • Thank you received: 66
Hello,

If by mappings you are referring to the Mappings plugin available for RSForm!Pro, then please note that this is triggered before the script you use in the "Scripts called on form process" field, you should be able to retrieve the id of the new row created with the mappings plugin with
$db->insertid();
Please note: my help is not official customer support. To receive your support, submit a ticket by clicking here
Regards,
RSJoomla! Development Team
The administrator has disabled public write access.

Re:Mappings and Scripts 13 years 4 months ago #15873

  • learnthrusong
  • learnthrusong's Avatar
  • OFFLINE
  • Junior Boarder
  • Posts: 26
  • Thank you received: 3
Hi there, I had this exact same issue, well... I was trying to use the mappings plugin to insert a new row, then in the on form process script I was trying to make relational inserts/updates to and from my 'mapped' table.

The problem was (and is), the mappings plugin doesn't get called til after those php scripts. Therefore, if you want to do any processing on the data that gets inserted via mappings, you can't!

Check out this forum post, OPERATING ON FORM DATA AND ADDING A NEW ROW IN DB I put together on how to get around this with variable variables created in a loop through the POST array. It'll save you loads of time if you need to access everything at once in just 3/4 lines of code and it's a lot easier than initialising a variable for every field you want to insert!

Best wishes,

Gez
The administrator has disabled public write access.
  • 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!