Skip to main content
Question

How can I create a record in a table when I click in a button of another table (with conserving some values)

  • October 13, 2017
  • 0 replies
  • 117 views

I have a "Requisition" table, with a button "Make into Purchase Order".
Another table is "Purchase Orders" . I would like a button in the Requisition form when clicked, it would creates a PO with the same values.
 I added a "Req ID" in the PO Table, the Req Table also has a field "PO ID".

I'm trying with copyMasterDetailButtonHandler, but  can only duplicate the record in the same table. I want to copy it from 'Req table' to ' PO table'
This topic has been closed for replies.

  • Registered
  • October 13, 2017
You can do it with a formula url button.  Either using the API_AddRecord or API_GenAddRecordForm.

You will have to define the values that you want to copy, but that is pretty straight forward.  An example is what appears in any of your default "add" buttons.


URLRoot() & "db/" & [_DBID_MESSAGES] & "?a=API_GenAddRecordForm&_fid_53=" & URLEncode ([Record ID#])& "&z=" & Rurl()

Where the line:
&_fid_53=" & URLEncode ([Record ID#])& "
Is the information that is being written to the new form.

Ayoub,
When you say it does not work, what are the symptoms of the problem.  What is the error message?