cancel
Showing results for 
Search instead for 
Did you mean: 

Referenced document through DI API

former_member203128
Participant
0 Kudos

Hello Experts

In a Mexico localization company with electronic document CFDI 3.3 configuration, In an A/R Invoice I need to save in Reference information table (INV21) information about referenced documents (transaction type, document number, reference type...) but I cant find the service or object in DI API, is it already exposed?

Thank you

Alvaro

ANKIT_CHAUHAN
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Rafael Hernandes Ogeda,

While we check this, we would appreciate if you can create a new thread and discuss it there.

Kind regards,

ANKIT CHAUHAN

SAP Business One Support

Accepted Solutions (1)

Accepted Solutions (1)

ANKIT_CHAUHAN
Product and Topic Expert
Product and Topic Expert

Hi Alvaro,

As far as I have checked this, it seems it is not exposed to DI API.

Kind regards,

ANKIT CHAUHAN

SAP SME Support

Former Member
0 Kudos

It this still not exposed in the DI API?

Answers (3)

Answers (3)

ManasGhoshal
Explorer
0 Kudos

Hi,

This is how you can manage the documents to add in Reference.

Here I have done this, after adding an adjustment journal entry I have tagged that to respective A/R Invoice's Reference Document i.e. in INV21.
This below workout code is in C# :-

int result = journalEntry.Add();

// Check if the journal entry was successfully added

if (result == 0)

{

// Get the generated JournalEntry number

string generatedJournalEntryNumber = company.GetNewObjectKey().ToString();

Console.WriteLine("Journal entry added successfully. Journal Entry Number: " + generatedJournalEntryNumber);

// Create a new line in INV21 table to establish the relation

Documents invLine = company.GetBusinessObject(BoObjectTypes.oInvoices);

invLine.GetByKey(invoiceEntry);

invLine.DocumentReferences.ReferencedObjectType = ReferencedObjectTypeEnum.rot_JournalEntry;

invLine.DocumentReferences.ReferencedDocEntry = Convert.ToInt32(generatedJournalEntryNumber);

invLine.DocumentReferences.IssueDate = DateTime.Today.AddDays(2);

invLine.DocumentReferences.Add();

int UpdateResult = invLine.Update();

if (UpdateResult == 0)

{

Console.WriteLine("Invoice line updated successfully with Journal Entry.");

}

else

{

int errorCode;

string errorMessage;

company.GetLastError(out errorCode, out errorMessage);

Console.WriteLine("Failed to update invoice line. Error Code: " + errorCode + ", Error Message: " + errorMessage);

}

}

else

{

int errorCode;

string errorMessage;

company.GetLastError(out errorCode, out errorMessage);

Console.WriteLine("Failed to add journal entry. Error Code: " + errorCode + ", Error Message: " + errorMessage);

company.Disconnect();

}

former_member186605
Active Contributor
0 Kudos

Hi, the designated channel for SAP Business One requirements is Customer Influence. Make sure that your requirements are in there and voted for! This is the only way we can prioritize in line with the market and realize your relevant requirements.

See this blog: Are you wondering how you can improve SAP Business One? You are SAP Business One!

Marshall-Jones
Participant
0 Kudos

I'm having customers ask for this feature as well.