on 04-23-2006 8:38 PM
Hi everyone,
On pressing the "Add" button for a new sale the "et_Item_Pressed" event fires twice, before and after adding. Although a default sale order number (docnum - form Item "8") is displayed and can be determined during the "before" event, this number is not reliable because a different, higher, number could be used if someone else has started another sale and saved it before yours.
No useable number is available during the "after" of the Item_Pressed event because the form has been cleared to prepare for adding another sale, and item "8" holds the next default number.
In other words, during the "After" of the "Item_Pressed" event for item "1" (Add) how do I determine the key (docenry) of the sale order just created.
Thanks for any help.
Mel Dodd
Hi Mel,
hence you use the UI to add the document, the only reliable way to know the docentry is by adding a hidden UDF to the document which will be populated with a unique number (lets say a random GUID + user ID) before the Add. after the document was added you should search for the document with this unique ID you will be able to get the correct docentry
let me know if you need more info or sample code
Moty Moshin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
This is wat i did. I created a edittext to store a unique GUID. Then i used VB.NET function to create a unique GUID something like this
sGUID = oCompany.UserName & "-" & Guid.NewGuid.ToString
to make it more unique, i would put the username that generated that GUID. After able to identify the last record added, i would update to remove to GUID added cause there might be chance in the future where the GUID will repeat again.
Hope this helps
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
110 | |
12 | |
11 | |
6 | |
5 | |
4 | |
4 | |
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.