Jump to content
  • 0

Automatically Update Multiple Records Of Another Table


Marcel
 Share

Question

I have the following scenario:

We have started to build an app to track vehicles in a logistics compound. One specific scenario causes some headache: Multiple vehicles are loaded onto a truck and depart all together at once

What we have built:

1. Check-In of truck – new instance of load is created with loadID and truck data – works fine

(table: load with attributes loadID, entry date, exit date, licence plate etc.)

2. Individual vehicles are assigned to a load = loadID is attribute of VIN – works fine

(table: VIN with attributes VIN_ID, VIN, Model, entry date, exit date, loadID etc.)

3. Check-Out of truck – truck departs and timestamp etc. is captured – works fine for the truck

--> update of exit date in load table

Here is my problem: I need a solution to automatically update the exit date of all VINs associated to this load. I have a report showing all the vehicles of the truck.

How do I now update all the individual VIN instances?

There should be a functionality to loop out all the vehicles assigned to the load and update the respective exit date in the VIN table for all affected VINs.

I have searched the forum for some JS solutions and tried to build up something – but nothing worked. I am relatively new to JS and need some help.

To prepare the loop, how do I get the data? Which VINs have as an attribute the same loadID? What kind of code would be required?

How do I create a loop which updates the timestamp data to the exitdate?

 

Would highly appreciate if someone could lead me to an appropriate solution

 

Kind regards

Marcel

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

Hi Marcel,

 

If I understand correctly, a user opens a Single Update Form that uses the VIN table as a DataSource.

When a user changes some field, the field "Status" is changed and the record gets timestamp.

Now all records should be checked, and if LoadID of any record is the same, the field "Status" should be changed as well.

 

I have an idea, if I understand your task.

Please correct me, if anything is wrong.

Link to comment
Share on other sites

  • 0

Thanks for taking time to look into this issue.

 

Your understanding is close but not yet correct. I try to express it as follows.

 

As a user I want to open an update form of the truck table so that I can enter the departure date of the truck.

 

As caspio I want to automatically update all records of the VIN table which have in the field truckID the same ID as the departing truck with the departure timestamp of the truck in the field exitTimestamp

 

Hope that makes it clearer - looking forward to your idea 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...