Get BusinessObjectKeyString from form

martinsalo

Hello Forum,


 


I want to loop through all open forms and get the BusinessObjectKeyString. How can I get the BusinessObjectKeyString from a form object?


 


I can get the BusinessObjectKeyString from pVal.BusinessObjectKeyString(), but only if I have the form object, this is not possible in my case. Idea: Instead I can get the DocNum from the Textbox with the ID "8". Example: If the DocNum is 250866, I can see that the BusinessObjectKeyString is 867. So my guess is that I can extract the BusinessObjectKeyString by removing the first two numers and add one. Does this alsways work? Is there an easier way to get the BusinessObjectKeyString from a form?


 


 


Thanks


 


Martin


Anders Olsson

Hi Martin,


 


DocEntry and DocNum are two separate things and you should not try to figure out one based on the other.


 


If you have the form object, this is how you can get the docentry:



string docEntry = "";

foreach (SystemDatasource ds in form.SystemDataSources.Values)
{
docEntry = ds.GetValue(0, 0).Trim();
break;
}


Regards,


Anders

martinsalo

Thanks. it works great :)


0

Comments

0 comments

Please sign in to leave a comment.

Didn't find what you were looking for?

New post