Forum Discussion

gauravtugnayat's avatar
gauravtugnayat
Qrew Member
5 years ago

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

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
------------------------------

5 Replies

  • KirkTrachy1's avatar
    KirkTrachy1
    Qrew Assistant Captain
    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
    ------------------------------
    • LoydaCampos1's avatar
      LoydaCampos1
      Qrew Member
      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
      ------------------------------
      • MarkShnier__You's avatar
        MarkShnier__You
        Qrew Champion
        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
        ------------------------------
  • 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
    ------------------------------