File Link -> URL with Path
"https://core.federatedservice.com/apps/downloads/dynamic_workorder.php?"
& "clientid=Q1752"
& "&appid=bhv9szun5"
& "&tpdbid=" & [_DBID_DOCUMENT_TEMPLATES]
& "&tpid=1"
& "&fn=WorkOrder_" & [Work Order #]
& "&msid=" & URLEncode ([Record ID#])
& "&msdb=" & Dbid()
& "&faid=592"
& "&efpdte=593"
& "&addfiles="
& "&docfmt=pdf"
& "&stream=y"
& "&apptoken=d3dzsz2cndv7n7bbg5y8q87xbw4"
& "&doc_name=" & "WorkOrder_" & [Work Order #] & "_" & [Record ID#]
& "&file_name=" & "WorkOrder_" & [Work Order #] & "_" & [Record ID#]
& "&file_link=" & "https://fss.quickbase.com/up/bhv9szup6/g/rb3tz/eus/va/WorkOrder_" & [Work Order #] & "_" & [Record ID#] & ".pdf"
& "&customer_rid=" & [Related Customer]
& "&project_no=" & [Project #]
& "&project_rid=" & [Related Project]
& "&workorder_no=" & [Work Order #]
& "&workorder_rid=" & [Related Work Order]
& "&visit_rid=" & [Record ID#]
& "&partner_rid=" & [Related Deployment Partner]
& "&technician_rid=" & [Related Technician]
& "&is_internal_download=true"
& "&user_name=" & URLEncode(Trim(UserToName(User())))
& "&user_email=" & URLEncode(Trim(UserToEmail(User())))
This formula calls our javascript code, which in turn invokes your aspx code thusly:
var wko_link = 'https://www.quickbaseutilities1.com/FederatedServices_1752/DocumentMerge/doc_merge_UA.aspx?'
+ 'clientid=' + $.url.param('clientid')
+ '&appid=' + $.url.param('appid')
+ '&tpdbid=' + $.url.param('tpdbid')
+ '&tpid=' + $.url.param('tpid') // Record Id of the specific document template
+ '&fn=' + $.url.param('fn')
+ '&msid=' + $.url.param('msid')
+ '&msdb=' + $.url.param('msdb')
+ '&faid=' + $.url.param('faid') // faid=file attachment field & efpdte=date document was created
+ '&efpdte=' + $.url.param('efpdte')
+ '&addfiles=' + $.url.param('addfiles')
+ '&docfmt=' + $.url.param('docfmt')
+ '&stream=' + $.url.param('stream')
+ '&apptoken=' + $.url.param('apptoken');
This all works as we intend, and dynamically creates the desired work order file, calling the Exact Forms Plus
code indirectly instead of directly. But it appears that the line in our code ("&file_link=" & "https://fss.quickbase.com/up/bhv9szup6/g/rb3tz/eus/va/WorkOrder_" & [Work Order #] & "_" & [Record ID#] & ".pdf") fails to save the correct path to the dynamically created work order. Our guess is that the value "rb3tz" in that line should be a variable, as it seems to change in the different dynamically created work orders. But we do not have any idea how that value "rb3tz" is created. Is there any way we can calculate that value ourselves? Or is that even a 'good' solution to our problem of saving the url?
We tried using the "Work Order Document" field that Exact Forms Plus fill in the Site Visits table (which we read via the QuickBase Do_Query API), but the API seems to only return the file name, not the entire path to the file. We assume this is because it is not a URL field, but a File Attachment field. This is strange, since when we hover a mouse over the value in the Site Visits table, it does show the entire url at the bottom of the screen (see screenshot below).
To reiterate, when we look at our QuickBase Site Visits table, we see that the Exact Forms Plus aspx code IS in fact storing the file, and saves what appears to be a link to it in the "Work Order Document" field which I have circled in the screenshot below. Hovering a mouse over the "Work Order Document" field reveals the url link to the file at the bottom of the page, which I have also circled. But we have been unable to retrieve this entire url through the Do_Query API, getting instead only the file name. We notice that the path in the url seems to have a different value for each different document created where we see "rb33r" in the screenshot below (which I have underlined in red). Other than this value, we believe the path is always the same for other dynamically created work orders.
Can you offer us any advice on how to save the path to the work order dynamically created by the call to Exact Forms Plus? Whether by dynamically creating our own path to the file or by somehow reading the path underlying the "Work Order Document" field?
Thank you.
------------------------------
Earl Adkins
------------------------------