Skip to main content
Question

Check a box while opening a new record

  • September 12, 2017
  • 0 replies
  • 35 views

Forum|alt.badge.img+6
I would like to mark the parent record assigned at the same time a new child record is created, in one scenario. So what can I add to the existing 'Add Record' formula to do that? 

URLRoot() & "db/" & [_DBID_LOCATIONS] & "?a=API_GenAddRecordForm&_fid_10=" & URLEncode ([Record ID#])& "&z=" 

-and-

In another scenario, I am looking to populate the Date/Time field while opening a new record. 
What can I add to my existing Time Stamp Button formula to do that?

var text URL = URLRoot() & "db/" & Dbid() &   "?act=API_EditRecord&rid=" &([Record ID#])
& "&_fid_29=" & Now();

"javascript:" &
"$.get('" &
$URL &
"',function(){" &
"location.reload(true);" &
"});" & "void(0);
This topic has been closed for replies.

Fr the first one, I suggest that you consider an alternative approach.  If the "definition" of a parent record being assigned is that it has a child record, how about adding a summary field for the [# of children]

Then make the checkbox field for [Parent Record assigned?] can be

[# of children] >0

or if you prefer to be needlessly verbose,

IF([# of children] >0, true, false)

As for the second question, are you saying that whenever the record is manually edited you want to set a date/time field to now()?  If that is the case, why not just use the built in [date modified] field  as it will be auto populated with the date/time of the last edit.

  • Registered
  • September 12, 2017
If you are looking to edit the parent record then create a child record, you will want to use an

API_EditRecord call with a RDR to the AddGenRecordFrom.

Generally speaking it will look like this: 

URLRoot() & "db/" & [_DBID_TASKS] & "?a=API_EditRecord&rid="&[Record ID#]&"&apptoken=xxxxxx&_fid_12="&URLEncode("true")&"&_fid_39="&URLEncode(User())&"&_fid_48="&URLEncode(Now())&"
&rdr="&
URLEncode([URL Add Time Entry])

This one Edits the parent task (marks complete) and redirects to add a time entry.

Forum|alt.badge.img+6
  • Author
  • Registered
  • September 12, 2017
In both situations, I just want to execute an action based on the push of a formula button that already exists. The idea is just to streamline the workflow from 2 steps to 1.

Forum|alt.badge.img+6
  • Author
  • Registered
  • September 13, 2017


I want to consolidate the 2 buttons into one step.