Forum Discussion

RandyGibbons's avatar
RandyGibbons
Qrew Trainee
7 years ago

Button to create child record error Missing ""rid"" parameter due to save

I have a button that creates a child record from the parent record.  It works perfectly only after the parent record has been saved the first time, thus creating the Record ID#.  I have the 'Save parent record automatically when a child record is created.' box checked.  When I hit the button on a newly created parent record, it will save the parent record, but produces this error message when trying to run through the button code to create a child record:

<qdbapi>
<action>API_EditRecord</action>
<errcode>30</errcode>
<errtext>No such record</errtext>
<errdetail>Missing "rid" parameter.</errdetail>
</qdbapi>

So to summarize, the button works correctly only after the parent has been saved and retrieved. I'm looking for the button to save the record, create a child, and return back to the parent in edit mode, updating some fields (status) and to continue working in the record.

3 Replies

  • You can't use the API to edit a record that does not yet exist. By some mechanism you have to hold off calling API_EditRecord until you have a record and the required [Record ID#]. It is as simple as that.

    What are you trying to do and what steps is your user following? 
  • Thanks for the reply.  They are creating a work ticket, for example an email that requires research.  They start the ticket, but get called into another direction and need to put the ticket on hold, stopping the resolve time on the ticket.  They fill out the required fields, and click stop, which should save the record, add a child record to track the stop time, then change the status of the ticket to On Hold.  Then when they start working the ticket again, the click the button, which updates the Child record to start the clock and changes the ticket status on the parent to In Progress.  All of that works correctly only if the parent has been saved first.