Get DocEntry or ObjType form an open draft document
kurt vanhauwaert
Hi all,I know i can use the next statement to get information form an open draft document :
lcDocNum = TextEdit.GetFromUID(pVal.Form, "8").Value.ToString()
My question is : is there an easy way to get the DocEntry and ObjType from an open draft document ?
Thnx
Anders Olsson
Hi Kurt,The first SystemDatasource on the form contains this info. Since you don't know the object type (and therefore also not the unique id of the datasource), just iterate though the collection of datasources and break after the first one:
[CODE]
string docEntry = string.Empty;
string objType = string.Empty;
foreach (SystemDatasource ds in pVal.Form.SystemDataSources.Values)
{
docEntry = ds.GetValue("DocEntry", 0);
objType = ds.GetValue("ObjType", 0).Trim();
break;
}
[/CODE]
Regards,
Anders
0
Please sign in to leave a comment.
Comments
0 comments