on 01-22-2021 11:38 AM
Hi,
How to get DocEntry from UI? I have used below code to get DocEntry -
oCompany.GetNewObjectType();
oCompany.GetNewObjectKey();
Application.SBO_Application.MessageBox(oCompany.GetNewObjectKey());
But it is giving error as "Object reference not set to an instance of an object.". Is there any other way to get DocEntry? Please help me.
Regards,
Neha
Hi,
Yes, Resolved.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
It was glad to know that the issue has been resolved for you.
Kind regards,
ANKIT CHAUHAN
SAP Business One Support
Hi,
Yes, My company connection is successful and I'm getting doc Entry by using below code:
int offset = oForm.DataSources.DBDataSources.Item(0).Offset; string DocEntry = oForm.DataSources.DBDataSources.Item(0).GetValue("DocEntry", offset);
Thanks for the help.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Ankit,
This is my code:
oCompany = (SAPbobsCOM.Company)oApp.Company.GetDICompany();
SAPbobsCOM.Documents oSalesOrder = (SAPbobsCOM.Documents)oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oOrders); oSalesOrder.CardCode = "C20000";
oSalesOrder.DocDueDate = DateTime.Now;
oSalesOrder.Lines.ItemCode = "A00001";
int A = oSalesOrder.Add();
if (A == 0) {
var dockey = oCompany.GetNewObjectKey();
var docType = oCompany.GetNewObjectType();
Application.SBO_Application.MessageBox(dockey); }
Is there anything wrong? Cz I getting same error..And I want to know that , How can we get DocEntry of current open record?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
102 | |
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.