Discussions

Expand all | Collapse all

How to relate Date filed from child table to Date field from parent table

  • 1.  How to relate Date filed from child table to Date field from parent table

    Posted 11-15-2019 09:51
    Hi All,
    I need help in one of my QB application. Their are two tables in which I build relationship and I want a field from Child table should update automatically a field in parent table when child record is updated.  

    I used   URLRoot() & "db/" &[_DBID_MONTHLY_TOTAL] & "?act=API_EDITRecord"URLRoot() & "db/" &[_DBID_MONTHLY_TOTAL] & "?act=API_EDITRecord"& "&apptoken= ban3pyfbjzu76bbzmpgrcb99rbb6"& "&_fid_14=" & URLEncode([Date])& "&disprec=1") formula but it didn't worked.  Can someone please help me with it.

    ------------------------------
    gaurav tugnayat
    ------------------------------


  • 2.  RE: How to relate Date filed from child table to Date field from parent table

    Posted 11-18-2019 11:21
    Hi Gaurav - 

    Have you considered utilizing Automations for this update, instead? Might be easier to set up.

    For your formula above, is it a Formula URL button? If so, there are a few things you need:
    1. You have this line in there twice: URLRoot() & "db/" &[_DBID_MONTHLY_TOTAL] & "?act=API_EDITRecord"&
    2. You need to indicate the Record ID# of the parent you're editing (see line 4 below): "rid=" & URLEncode([Related Parent Field Name])
    3. Include a redirect for where you want the user to land after the API call is made (see line 8 through 12 which will take them back to the child record)  with &rdr=

    Your final formula would then end up like the below (where Related Parent Field Name is the numeric relationship field that holds the Record ID# of the parent record):

    URLRoot()
    & "db/"
    & [_DBID_MONTHLY_TOTAL]
    & "?act=API_EditRecord&rid="
    & URLEncode([Related Parent Field Name])
    & "&_fid_14="
    & URLEncode([Date])
    & "&rdr="
    & URLEncode(URLRoot()
    & "db/" & Dbid()
    &"?a=dr&rid="
    & [Record ID#])

    ------------------------------
    Bree Mackey
    ------------------------------



  • 3.  RE: How to relate Date filed from child table to Date field from parent table

    Posted 11-18-2019 11:27
    Hi Gaurav: 

    If you want the date field of the child table to go up and change a field on the parent table, you could do it with an automation.

    See Video:
    https://www.youtube.com/watch?v=fgwAiRuWnCI

    You could also create a summary field that looks at the child date field of all the child records and gives you the MAX Child Date.

    ------------------------------
    Kirk Trachy
    ------------------------------



  • 4.  RE: How to relate Date filed from child table to Date field from parent table

    Posted 05-11-2020 17:18
    Hi Kirk:

    Can you please explain the summary field option? I'd rather do it that way, but I'm not sure how, because I think a summary field only allows you to select numeric fields, apart from counting related records.

    Thanks,

    ------------------------------
    Loyda Campos
    ------------------------------



  • 5.  RE: How to relate Date filed from child table to Date field from parent table

    Posted 05-11-2020 17:54
    Loyda
    re: because I think a summary field only allows you to select numeric fields

    Actually you can do a Minimum or Maximum Summary on a Date field type or a Date / Time field type.

    ------------------------------
    Mark Shnier (YQC)
    Quick Base Solution Provider
    Your Quick Base Coach
    http://QuickBaseCoach.com
    mark.shnier@gmail.com
    ------------------------------



  • 6.  RE: How to relate Date filed from child table to Date field from parent table

    Posted 05-11-2020 18:48
    Hi, Mark.

    I see my error. I was trying to change the parameters of an existing summary field (Numeric, obviously), but the option of chose a date field is only available when you create a new summary field.


    ------------------------------
    Loyda Campos
    ------------------------------