How to add a Journal Entry - Error "Code undefined"

Hi, i want to add a simple journal entry by using DI-Api. The problem is, i always get the error message "Code undefined" when I use the Debitor-AccountCode.
My code is like that:
oJ.TaxDate=dTaxDate;
oJ.AutoVat=BoYesNoEnum.tNO;
oJ.Lines.AccountCode="2000";    //Customer
oJ.Lines.ContraAccount="4020";
oJ.Lines.Credit=dCredit;
oJ.Lines.Debit=dDebit;
oJ.Lines.TaxDate=odTaxDate;
oJ.Lines.ShortName="23121089";
oJ.Lines.LineMemo="Ausgangsrechnung";
oJ.Lines.Add();
oJ.Lines.AccountCode="3500";   //VAT
oJ.Lines.ContraAccount="23121089";
oJ.Lines.Credit=dCredit;
oJ.Lines.Debit=dDebit;
oJ.Lines.TaxDate=odTaxDate;
oJ.Lines.ShortName="23121089";
oJ.Lines.LineMemo="Ausgangsrechnung";
oJ.Lines.Add();
oJ.Lines.AccountCode="4020";
oJ.Lines.ContraAccount="23121089";
oJ.Lines.Credit=dCredit;
oJ.Lines.Debit=dDebit;
oJ.Lines.TaxDate=odTaxDate;
oJ.Lines.ShortName="23121089";
oJ.Lines.LineMemo="Ausgangsrechnung";
oJ.Add();

Hi,
Here is the code to find the BP account number:
oRecordset = ((SAPbobsCOM.Recordset)(oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset)));
                    oRecordset.DoQuery("SELECT [LinkAct_3] FROM [dbo].[OACP]");
                    oRecordset.MoveFirst();
                    if (oRecordset.EoF == true) // We have a Error
                        oCompany.GetLastError(out vmp_B1_Error_Code_int, out vmp_B1_Error_Message_string);
                        SBO_Application.MessageBox("Add-On Error (Forgestik Inc.): ERR-789 \n " + "Cash Account does not Exist "+ vmp_B1_Error_Message_string, 1, "Ok", "", ""); // My Error Code
                    else
                        vm_CachAccountNumber_string = Convert.ToString(oRecordset.Fields.Item("LinkAct_3").Value);
...Then you have to use the system account number "_SYS00000000353" not the displayed account number in B1...
Thank you,
Rune

Similar Messages

  • Requirement for add a journal entry of unbalnce FC  amount

    Hi,expert !
    I want to add a journal entry of unbalnce FC  amount.
    for example: assume the exchage rate is 1.5
    AccountNo  Debit(FC)          Credit(FC)  Debit Credit
    1001                usd 100                           150
    1002                                                                  150
    How can I make it ? Any help  is appreicated . Thank you in advance.

    Hi,
    There is a master setting inorder to allow unbalanced transaction in the journal entry.
    Administration->System Initialization->Document setting->Per document tab->Select Document-Journal Entry
    Uncheck the option 'Block &Unbalanced FC Journal Entry' and update.
    This will allow you to add unbalanced transaction.
    If you need to make a single manual journal entry,Open Journal entry window->Go to form setting->Document tab->General tab-'Allow Unbalanced Transaction in FC',select this option.
    Hope this is helpful!

  • How can i fix a 4280 error code when trying to burn cd's on itunes

    How can I fix a 4280 error code when trying to burn cd's on itunes for windows? Model drive is drive D: TSSTcorpCDRWDVD TS-H492C

    Did you by chance find out a solution with your problem?     I am having the same issue with the same drive.    I even uninstalled iTunes and completely reinstalled it.
    Thank you for any help anyone can offer.    I'm not having any luck finding answers on the net.     Thx.

  • HP LaserJet Pro M1536dnf Multifunction Printer (unable to add print driver hpfax1, error code 87)

    Hi, my printer HP LaserJet Pro M1536dnf Mfp, suddenly didnt work so i remove the printer, and downloaded a new driver  http://support.hp.com/us-en/drivers/selfservice/HP-LaserJet-Pro-M1536-Multifunction-Printer-series/3974271/model/3974278#Z7_3054ICK0KGTE30AQO5O3KA30R1 once dowloaded, i run it and uninstall the printer, restart my pc, and proceed to installing. but in the process of installing a error occurr, saying that "Unable to add printer, error code 87", and that " HP Toolbox FX has encountered an error and can not recover. once i click ok. it tells me to restart my pc and reinstall it again. i did it for 8x, and still with the same error. please help really need a help right now. as my boss is going to kill me

    Hey , Welcome to the HP Support Forums!
    I understand that you're getting the error 'Unable to add print driver hpfax1, error code 87' when installing your HP LaserJet Pro M1536dnf Multifunction Printer on your Windows 7 computer. I would like to assist you today with resolving this install issue. Thank you for including all of the troubleshooting steps that you have completed prior to reaching out for support. At this time I am going to walk you through some additional software and driver troubleshooting steps. Please follow all of the steps below.  If you're using your HP Laserjet through a USB Cable connection, please disconnect that cable now.  Step one: Remove Driver: 1. Click on your Start menu 2. Select Control Panel 3. Select Programs and Features 4. When Programs and Features opens a list of programs installed on your computer will populate. Click on the 'Installed ON' tab at the top to change the date so the recently installed items show at the top. This will make it easier to manually locate the three HP Laserjet items you need to uninstall.  5. Next, look for the HP LJ M1530 MFP Series HP Scan, HPLaserJetHelp_LearnCenter, and HP LaserJet Professional M1530 MFP Series. If you see any 3 of these, or all 3 of these items, please click on them and select Uninstall.   Once you have confirmed that those three items have been uninstalled, please close Programs and Features and proceed to the next step.   Step 2: Clear Temp Files:  Click on your Start menuIn the 'search programs and files' box located right above Start after you click on it, type %temp% and hit enter on your keyboardWhen the Temp folder opens, select Ctrl + A at the same time on your keyboard. Everything in this folder will now highlight.Select the 'delete' button on your keyboard. The Temp folder contains temporary internet files. No actual files or folders on your computer will be affected by deleting the Temp files. Should a Temp file still be used than you will automatically get the pop up to 'skip' that item.Close the Temp folder once it is emptiedRight click the Recycling Bin on your desktop and select Empty Recycling BinPlease proceed to the next step.    Step 3: Download Installer Package:  Please click here to download the Full Feature Installer package. Once the download is complete, click on the download to allow it to 'Run'An extraction should now automatically occur. Once the extraction is complete an installer window will open. Please close the installation window.  You do not want to run the installation at this time.   Step 4: Run Scrubber:  To ensure that no trace of the HP Software and Driver package remain on your computer, I am going to have you run a Scrubber built into the installer package for your printer.  Click on your Start menuIn the 'search programs and files' box located right above Start after you click on it, type %temp% and hit enter on your keyboardWhen the Temp folder opens locate the 7z folder. Click on this folder to open it. This is the HP Laserjet Installer Click on the Utilities folder under the 7z folderDouble left click on Scrubber. It is an application which should launch the HP Uninstaller. Please follow the onscreen prompts to complete the uninstaller.    Once the uninstall has completed please proceed to the next step. Be sure to Restart your computer if the uninstall process prompts you to.    Step 5: Check Print Server Properties:  Click on your Start menuClick on Devices and PrintersIn the Devices and Printers window look for your HP Laserjet. If you see it listed please right click on it and choose 'Delete' or 'Remove Device'. Next, click on any device listed under 'Printers and Faxes' once just to highlight itClick Print Server Properties at the top of the windowClick on the Drivers tabLook for your HP Laserjet driver. If you see it click on it and click Remove at the bottomClick Remove Driver OnlySelect OKSelect Apply and OK on the Print Server Properties windowClose Devices and Printers. Please proceed to the next step.  Step 6: Run Disk Cleanup Utility: Click on your Start menuSelect All ProgramsSelect AccessoriesSelect System ToolsSelect Disk Cleanup Run a Disk Cleanup on the C DriveWhen prompted, check Downloaded Program files, Temporary Internet Files, Recycle Bin, Temporary Files, and Thumbnails Once the Disk Cleanup is complete, please proceed to the next step.    Step 7: Run CCLeaner:  To ensure that there are no malicious files on your computer or Registry conflicts on your computer I am going to have you run a CCLeaner before we install your printer. Please click here to download the CCLeaner Tool. Once the website opens select the link at the top for 'Free Download'. Once the download is complete please complete the Scan. Should multiple malicious files be found you may need to run the Scan multiple times to remove all malicious files. Once your system comes back as clean, please proceed to the last step.    Step 8: Install Device:  Please click here to download the Full Feature Installer package for your HP LaserjetOnce the download is complete please allow the download to RunPlease follow the onscreen prompts to install your HP LaserjetIf using a USB Cable connection please do not plug in the USB Cable until the installer window prompts you to  Once the installation has completed successfully please test your machine to confirm that everything is functioning properly. Please respond to this post with the result of your troubleshooting. I look forward to hearing from you. Good luck!

  • How to fix Adobe App Manager error code -60 Download appears corrupt but only for Photoshop CS6 app

    How to fix Adobe App Manager error code -60 Download appears corrupt but only for Photoshop CS6 Creative Suite Cloud App. Many attempts were made to install Photoshop CS6 with Adobe Application Manager without success. Every other Creative Suite Application was successfully downloaded. I keep getting Installation Failed when attempting the Photoshop install. How does one correct this?

    Thanks Jeff! So, it totally appears as if it was a network issue. The corporate network where I work is quite likely the culprit. Where I was thrown off is that since I have admin rights on my computer, I can install software. But using Adobe Application Manager to install Adobe software wasn't working. And to make matters worse, there didn't appear to be any way to install Acrobat Pro for Mac without using AAM. The workaround that I used previously was to install the trial versions of Adobe software, and then just register them using my username and password. But the workaround for being able to install everything using AAM was to bring my computer home and download from my home network.

  • How to add/modify host entry in iPad

    How to add/modify host entry in the iPad Mini.
    Is there anyway to achieve this in the iPad Mini, like any equivalent DNS configuration.

    Point your DNS configuration to a local one in which you can add all tue IP aliases that you dream of.

  • How do i fix an audio error code 25974?

    how do i fix an audio error code 25974?

    Typically this can be caused by an out of date driver or one that is not fully compatible with the version of OS X that you are using...
    So, which Audio Interface are you using and are you using the latest drivers for that Audio Interface.. and are those drivers compatible with your version of OS X?

  • How do I fix a 1611 error code when trying to restore my ipod?

    How do I fix a 1611 error code when trying to restore my ipod touch?

    Click here and follow the instructions.
    (120576)

  • Help! How to fix "Acrobat quit unexpectedly (error code: 0x00000004)"?

    Help! How to fix "Acrobat quit unexpectedly (error code: 0x00000004)"?
    Customer service ask me uninstall - restart PC - CC cleaner tool - restart PC again - reinstall, but still useless.
    Who also facing this problem?

    I already check the permission, but still can't run.

  • How can I update without getting Error Code: A12E1

    How can I update without getting Error Code: A12E1

    This may indicate a process on your machine is preventing the install from succeeding. Please try rebooting your machine and attempt the update again.
    ARe you using a windows machine or Mac?

  • Question  How should I react to installation Error Code:50 ?

    Question: How should I react to installation Error Code 50 ?  I'm trying to download Photoshop.

    Mlkybek are you currently installing the Creative Cloud Desktop application?  Or have you clicked on the download button as described in Install and update apps - https://helpx.adobe.com/creative-cloud/help/install-apps.html?

  • How to restore iPhone 3gs with error code 1015 ??

    How to restore iPhone 3gs with error code 1015 ??

    The only advice we can give is to try and put it into DFU mode and restore. If that doesn't fix it, buy a new phone.
    There is a reason that Jailbreaking isn't supported. You have just been kicked in the donkey by it.

  • How to How to download from without getting error code 1009?

    How to How to download from without getting error code 1009?

    I get the same error message on my Mac Book Air 13" Mac OS X and iphone 4 accessing internet via 3.5G modem and Edge / GPRS esprectively.  I'm in Sudan now, wasn't getting this message in Ethiopia.  Using Itunes store location for UK.  Could it be an IP blocking issue and if so any ideas of a work around?
    Thanks

  • Copy journal entry error

    Hi experts,
    I detected an error that occurs when I try to copy an existing journal entry. I think that the problem is related to the maximum length of the description of the journal entry, that is 160 characters. When I copy an existing journal entry, BPC adds a prefix at the beginning of the description (for example: "COPY TO #379 :" ). The problem occurs when the length of the description of the original journal entry is close to the maximum lenght and therefore,  the length of the new journal exceeds 160 characters. The only solution that comes to my mind is to try to limit the number of characters in the descriptions. Is there a different solution so that there is no need to reduce the description? Thank you in advance.

    Hi Tao,
    it´s better to use tools like DataTransfer (DTW) or copy Express.... however if you need to "replicate" via SDK... you should use the following object of SAP:
    -Company (for connect to other company)
    -2 JournalEntry (for get journal entries of other database and Add on my current DB)
    -SAPbobsCOM.Recordset : for get data for "other" DB
    The code is something like this:
    Dim rsJournalSource As SAPbobsCOM.Recordset  -- get data from SQL
    Dim oJournalEntries As SAPbobsCOM.JournalEntries
    dim oJEMyCurrentDB as SAPbobsCOM.JournalEntries
    rsJournalSource = vCompanySource.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset) -- NOTE: vcompany is connection to "other" DB
    rsJournalSource.DoQuery("SELECT transID FROM OJDT WHERE your criteria")
    oJournalEntries.Browser.Recordset = rsJournalSource
    oJournalEntries.Browser.MoveFirst()
    While Not oJournalEntries.Browser.EoF
         ... copy field to field and line to line...
         oJEMyCurrentDB .add
                   oJournalEntries.Browser.MoveNext()
    End While
    I hope help!!

  • Unable to use di api to add a journal entry

    Hi All,
    I had trouble with adding a journal entry
    the following are my codes:
            oJournal = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oJournalEntries)
            oJournal.DueDate = Now
            oJournal.ReferenceDate = Now
            oJournal.TaxDate = Now
            ' first line
            oJournal.Lines.AccountCode = "11110101"
            oJournal.Lines.ContraAccount = "C00001"
            oJournal.Lines.Credit = 1000
            oJournal.Lines.Debit = 0
            oJournal.Lines.ShortName = "11110101"
            ' second line
            oJournal.Lines.Add()
            oJournal.Lines.AccountCode = "C00001"
            oJournal.Lines.ContraAccount = "11110101"
            oJournal.Lines.Credit = 0
            oJournal.Lines.Debit = 1000
            oJournal.Lines.ShortName = "C00001"
            ' add journal entry
            lRetCode = oJournal.Add()
    The error message is " [JDT1.Account][line: 2] , 'Tax account has not been defined for the selected tax code'"
    Cheers

    I've tried the following codes but I got the same error
            Dim oJournal As SAPbobsCOM.JournalEntries
            oJournal = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oJournalEntries)
            oJournal.DueDate = Now
            oJournal.ReferenceDate = Now
            oJournal.TaxDate = Now
            oJournal.Series = 1023
            ' first line
            oJournal.Lines.AccountCode = "11110101"
            oJournal.Lines.Credit = 1000
            oJournal.Lines.Debit = 0
            oJournal.Lines.DueDate = Now
            oJournal.Lines.TaxDate = Now
            oJournal.Lines.ReferenceDate1 = Now
            ' second line
            oJournal.Lines.Add()
            oJournal.Lines.AccountCode = "C00001"
            oJournal.Lines.Credit = 0
            oJournal.Lines.Debit = 1000
            oJournal.Lines.DueDate = Now
            oJournal.Lines.TaxDate = Now
            oJournal.Lines.ReferenceDate1 = Now
            ' add journal entry
            lRetCode = oJournal.Add()

Maybe you are looking for

  • Error -12 when building installer

    OS: Win7  LabVIEW: 2012 SP1 I am having issues with the application builder while trying to build an installer. The installler has the following "Aditional Installers" selected: LabVIEW Runtime Engine NU USI 2.0.1 NI DAQmx Core Runtime 9.8 NI DAQmx M

  • My iphone 4 appears to be dead while using

    My phone has gone blank suddenly No button is working Screen is black what should i do

  • OBIEE Server Hangs how to stop the process?

    Hi, I schedule one report in BI publisher and in history its showing status as 'Running' from a long time, I want to terminate that process and want to stop the running report. But as I don't no much about OBIEE I am unable to do that. Could you plea

  • The Update doesn't work

    Hey everyone, it says there is a update for my Mac Os X 10.6.8 called 'Java for Mac OS X 10.6 Update 12' I did run the normal sofware update on my computer and I downloaded it directly from the apple support. But nothing works. It always stops and sa

  • ICalPrinter 'fatal error' msg re 'calendar directories' not in

    I have just downloaded iCalPrinter from pocketmac.net - but when I tried to open the software, up came a 'fatal error' message that says: "The Calendars directory was not found in the Library directory. Make sure iCal is correctly installed." I am ru