cancel
Showing results for 
Search instead for 
Did you mean: 

Get Data from unposted Document

Former Member
0 Kudos

Hi Everybody,

I need to create a validation for an Invoice Document. The validatio must run, before the document is added.

Means, I need to get the document total, compare it to some conditions and then allow/block the adding of the document.

My Problem is now to get the relevant information.

If I try to get the value from UID like this

TextEdit.GetFromUID(pVal.Form, "29").Value.ToString(); 

than the system returns the value to me including the currency sign, like "100.00 EUR". But I don't want to have the currency signs in there. And I can not use substring, because the currency can be different from time to time and it can also be on the right or left side of the value.

My next thought was, to get the information directly from the document object like this:

              

SAPbobsCOM.Documents oInv = (SAPbobsCOM.Documents) oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oInvoices); 
 oInv.GetByKey(xy); // DocEntry needed  
 oInv.DocNum.ToString();

This will work perfectly if I had a DocEntry which that I can use to connect to the object.

For documents already posted to the database this is no problem, because I can get the DocEntry via Database Selcet.

But how I can connect to an UNPOSTED Document where I have no Doc Entry?

Did anybody have a solution for me?

Or did anyone maybe have an other solution for me, how to get the data?

Best Regards,

Sebastian

Accepted Solutions (0)

Answers (4)

Answers (4)

pvsbprasad
Active Contributor
0 Kudos

Hi,

Is the issue is resolved.

If yes,please close the thread.

Regards,

Prasad

pvsbprasad
Active Contributor
0 Kudos

HI,

Try this

Step 1:create a temp table in Sql

step 2 : IN beforeEvent=true and Itempressed event ;capture the value of Doctotal

i.e  dim doctotal as string= objform.items.item("Itemuid").specfic.value

insert into table the doctotal value

remove ur INR value based on substring

step 3:compare ur validations

step 4:if u got error make bubble event =false and exit sub

Regards,

Prasad

edy_simon
Active Contributor
0 Kudos

Hi Sebastian,

If it is only for allow/blocking purpose, Transaction Notification would do a much better job.

Regards

Edy

Former Member
0 Kudos

Hi Sebastian,

SInce the object is not saved, you just cannot get it.

Your only solution is to parse the DataSources and do your math with them.

Regards,

Eric

Former Member
0 Kudos

Hi Eric,

thanks for your fast support.

Can you give me an example about the things you mentioned? Because I did not work with DataSources before and did not know how to use them.... 😞

Thanks and best regards,

Sebastian