Create BP Customer invoice with analytical dimensions using web services

SUGGESTED

We are trying to import BP Customer invoices, publishing BIC object as a web service. When testing, we get an error with the message "Error-> Analytic dimensions: XXXX\Record does not exist, but the record exists. If we don't include this field in the XML or if we use a distribution code, it works fine. Only one dimension per line is used.

This happens after applying the latest service pack in PU9 in a development environment. On the previous service pack in the production environment, the same web service is working well.

We have tested it in the updated SEED folder in the development environment, and it also works well.

This screen has a few customisations, basically adding some addicional fields. In the past, we modified the code to avoid pop up messages and to avoid the taxes calculation when the object was invoked through web services. We have removed the modified code, but the result is the same behaviour. Record does not exist.

Any help will be highly appreciated.

  • 0

    Did you ever resolve this?  I am getting a similar error.

  • 0 in reply to AH3

    No, never. We checked it later with new patches, but it hasn't been fixed.

  • 0
    SUGGESTED

    I don't have a strait answer but we usually use import template for creating (invoices, sales orders etc..) and not web service.

    you can create a script that creates a template and run it using code. 

    that script can be a web service 

    maybe this way it will do what you want

    see example for code for creating BIS (BP supplier  invoice, you need to create your own and use fields you need)

    there should be an existing template for BIC, you just need to modify it a bit.

    then if you need as webservice create a subprogram and publish it

    hope that helps

    Local Char ZNUM    :    ZNUM = "ZBIS_" + format$("D:YYYYMMDD",date$)+num$(time)
    Gosub CRE_FILE  
    SUPPLIER_CODE="ABCD"
    SITE="SITE"
    
    #header - fill in header fields of the template
    Wrseq "T";"";"INV";"";SUPPLIER_CODE;SITE;format$("D:YYYYMMDD",date$);"AP1";"USD";"1";format$("D:YYYYMMDD"  Using [WRI]
    
    #lines - fill in line fields of the template
    Wrseq "L";"1000";"SITE";"NA";"";"";"";num$(12.36);num$(1)    Using [WRI]
    
    Gosub CLOSE_FILE 
    Local Char ZEXT    : ZEXT ="ZBISX"       
    Gosub IMPORT_FILE
         
    ##################################################################################################
    $CRE_FILE
        adxifs = ';' : adxirs = chr$(13) + chr$(10)
        ZPATH = filpath("","","","","")+"\TMP"
        Openo filpath(ZPATH,ZNUM,'CSV') Using [WRI] 
    Return
    ##################################################################################################
    
    $CLOSE_FILE    
        Openo Using [WRI]
    Return
    ##################################################################################################
    
    $IMPORT_FILE
        Local Char ZFILENAME(250)    :     ZFILENAME = ZPATH+"\"+ZNUM+".csv"
        Call ECR_TRACE("Importing"-ZNUM,0) From GESECRAN
        GWEBSERV = 1
        Call IMPORTSIL(ZEXT,ZFILENAME) From GIMPOBJ
        GWEBSERV = 0
    Return

  • 0 in reply to XavierSala
    SUGGESTED

    Another option would be using the web service AOWSIMPORT (available from PU10), that uses the import template structure. Some info & examples here:
    https://developer.sage.com/api/x3/import-export-guide/developing-with-web-services/#perform-an-import
    Hope it helps!