Discussions

Expand all | Collapse all

Check a box while opening a new record

  • 1.  Check a box while opening a new record

    Bronze
    Contributor
    Posted 09-12-2017 13:49
    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);


  • 2.  RE: Check a box while opening a new record

    Posted 09-12-2017 14:51
    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.


  • 3.  RE: Check a box while opening a new record

    Top
    Contributor
    Posted 09-12-2017 14:55
    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.


  • 4.  RE: Check a box while opening a new record

    Bronze
    Contributor
    Posted 09-12-2017 14:56
    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.


  • 5.  RE: Check a box while opening a new record

    Bronze
    Contributor
    Posted 09-12-2017 22:38


    I want to consolidate the 2 buttons into one step.


  • 6.  RE: Check a box while opening a new record

    Top
    Contributor
    Posted 09-13-2017 04:14

    [Location Assigned]& "&rdr=" & URLEncode([Add Location])

    This might do it.



  • 7.  RE: Check a box while opening a new record

    Bronze
    Contributor
    Posted 09-13-2017 15:17
    This is what I'm getting: A formula may not contain a reference to itself directly or indirectly through another formula.


  • 8.  RE: Check a box while opening a new record

    Top
    Contributor
    Posted 09-13-2017 15:19
    Create a new field for the combined effort.


  • 9.  RE: Check a box while opening a new record

    Bronze
    Contributor
    Posted 09-13-2017 15:24
    The Location Assigned Worked, but a window didn't open to add a new location.