Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1980
  • Last Modified:

Insert_Record Built-In


I'm trying to attach a trigger to a button, so that every time the button is pressed, insert_record built in should be executed and it should have the same function as that of the default menu option.
  The form builder error says that insert_record built-in can only be used with the On_Insert trigger but in case of the button there is no On_insert trigger option. Is there any other way I can accomplish this.

Thanks

regards

Hassan
0
hayub
Asked:
hayub
  • 6
  • 3
  • 2
  • +1
1 Solution
 
vanmeerendonkCommented:
code in your when-button-pressed :
EXECUTE_TRIGGER('ON-INSERT');

and code a ON-INSERT trigger on module-level.
Here you kan use the insert_record;

0
 
schwertnerCommented:
Forms Builder automatically creates INSERT, UPDATE, DELETE statements when you insert, update or mark for delete records in the blocks of your form.

So the only you need is to activate the implicit DML statements using the EXIT_FORM, CLOSE_FORM built-ins in the WHEN-BUTTON-PRESSED trigger.
0
 
schwertnerCommented:
If you need to make additional inserts (excluding the automatcal) you can use the POST_INSERT, POST_UPDATE, POST_DELETE and even POST_QUERY trigger on block or above level.
0
Get your Conversational Ransomware Defense e‑book

This e-book gives you an insight into the ransomware threat and reviews the fundamentals of top-notch ransomware preparedness and recovery. To help you protect yourself and your organization. The initial infection may be inevitable, so the best protection is to be fully prepared.

 
kretzschmarCommented:
use
create_record
instead of
insert_record
in your when-button-pressed trigger

meikl ;-)
0
 
hayubAuthor Commented:
Thanks a lot guys... I tried kretzdchmar option and it works perfectly fine....



thanks again


Hassan
0
 
hayubAuthor Commented:
Thanks a lot guys... I tried kretzdchmar option and it works perfectly fine....



thanks again


Hassan
0
 
hayubAuthor Commented:
Thanks a lot guys... I tried kretzdchmar option and it works perfectly fine....



thanks again


Hassan
0
 
hayubAuthor Commented:
Thanks a lot guys... I tried kretzdchmar option and it works perfectly fine....



thanks again


Hassan
0
 
hayubAuthor Commented:
Thanks a lot guys... I tried kretzdchmar option and it works perfectly fine....



thanks again


Hassan
0
 
kretzschmarCommented:
well,

then you should reject vanmeerendonk's answer
and grade me

glad to helped you

meikl ;-)
0
 
hayubAuthor Commented:
I accept kretzschmar answer and give him the rating A.



thanks again



Hassan
0
 
kretzschmarCommented:
well, hassan,

then you should do it :-)
(maybe its easier when i post this as answer)

meikl ;-)

0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 6
  • 3
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now