on 07-15-2014 3:14 PM
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Sebastian,
If it is only for allow/blocking purpose, Transaction Notification would do a much better job.
Regards
Edy
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
100 | |
12 | |
11 | |
6 | |
6 | |
4 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.