I have a Submission Form where truck drivers register each transport made. The transport could be i.e. sand, soil or stone. When they register an order, the article (sand, soil, stone) is determined, but the driver has to choose a vendor (from where he/she makes the transport). Each article has a different UnitPrice from different vendors. Therefore, I need to pull the UnitPrice from a table (VendArtLnk) when the vendor is selected (VendID).
In a calculated field in a report, I have managed to pull this value by SQL. The SQL is like this:
SELECT UnitPrice FROM VendArtLnk WHERE VendArtLnk.VendID = target[@field:IntOrders_ArtID AND VendArtLnk.ArtID = target.[@field:IntOrders_ArtID
In a subission Form, it's not possible to use calculated fields, but I was hoping I could do this through SQL inside a Javascript and then assign the value to a variable.
The next would be to insert the value into a field called UnitPrice.
The function should bi invoked by a cange in VendID.
Has anyone done something similar og know the exact code for this? I also need to know where to put it (in the header, footer or in a HTML Block)
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.
Question
Parma2015
Hi!
I have a Submission Form where truck drivers register each transport made. The transport could be i.e. sand, soil or stone. When they register an order, the article (sand, soil, stone) is determined, but the driver has to choose a vendor (from where he/she makes the transport). Each article has a different UnitPrice from different vendors. Therefore, I need to pull the UnitPrice from a table (VendArtLnk) when the vendor is selected (VendID).
In a calculated field in a report, I have managed to pull this value by SQL. The SQL is like this:
SELECT UnitPrice FROM VendArtLnk WHERE VendArtLnk.VendID = target[@field:IntOrders_ArtID AND VendArtLnk.ArtID = target.[@field:IntOrders_ArtID
In a subission Form, it's not possible to use calculated fields, but I was hoping I could do this through SQL inside a Javascript and then assign the value to a variable.
The next would be to insert the value into a field called UnitPrice.
The function should bi invoked by a cange in VendID.
Has anyone done something similar og know the exact code for this? I also need to know where to put it (in the header, footer or in a HTML Block)
Jan
Link to comment
Share on other sites
14 answers to this question
Recommended Posts
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.