I have a button that opens the upload dialog from a page using the below approach:
function openUploadNewDocumentDialog(passingID)
{
var dialogOptions = SP.UI.$create_DialogOptions();
dialogOptions.url = "/mySite/sales/tracking/_layouts/Upload.aspx?List={GUID}&IsDlg=1";
dialogOptions.width = 700;
dialogOptions.height = 310;
dialogOptions.title = "Submit Document";
dialogOptions.dialogReturnValueCallback = Function.createDelegate(null, CloseThisDocCallBack);
SP.UI.ModalDialog.showModalDialog(dialogOptions);
}
function CloseThisDocCallBack(result, returnValue)
{
if (result == SP.UI.DialogResult.OK)
{
// here is where i have current logic for last id
}
}
So what i have above is basically calling the dialog to upload the document that I mean to associate with a parent ID, or I have data in lists that represent a package and the ID of that list item is the master ID I want to associate multiple things with (documents amount them). So on a submission form there is a button that allows users to upload via above, and after edit form opens, they enter metadata, there is the callback which i catch and then do the following: call another function which uses SPServices SPGetLastItemId then update the record with the master ID WHERE I use that last item ID......so this is the only way I have found to make this half way work in this manner.
My question is, I would much rather pass the ID through the upload dialog and save right then and there. I have that master ID when they call the dialog upload, so is there a way i could include this in the query string or something to get the value through the upload form to the edit form or library? There is a field in the library called parentID?
Additionally, just for reference, the extent of dev for me is SharePoint Designer SBS Env. Any help with this would be greatly appreciated!
EDIT: I know how to use the above in order to call the upload to dialog, and that will automatically get the edit form dialog after user has uploaded doc. I would like to pass a var somehow into the edit form so that it can be saved with the documents metadata by the user right then and there. if i put it in a query string, it doesn't seem that it gets to the edit form (if i like write something to try and grab it then), and if I add function to the callback, that is after the edit form dialog is closed?? thanks for helping a beginner as I am sure I am not understanding this completely.