11.5.10 Script to load Attachments as URL

Dear All
I have a third party system that have PDF's and XML AP
invoices images.Therefore I was wondering how I can insert the URL as
an attachments to each invoice in Oracle AP.
I have the following example, however I was wondering if you can share with me any ideas.
Please advise
declare
l_rowid rowid;
l_attached_document_id number;
l_document_id number;
l_media_id number;
l_category_id number := 291; -- Invoice Internal
l_pk1_value fnd_attached_documents.pk1_value%TYPE := '63227';
l_description fnd_documents_tl.description%TYPE   := 'Gareth Document Attach Demo';
l_filename fnd_documents_tl.file_name%TYPE := 'http://www.oracle.com/index.html';
l_seq_num number;
begin
-- Setup applications session
-- User = OPERATIONS
-- Resp = Payables, Vision Operations
-- App  = Payables
fnd_global.apps_initialize(1318,50554,200);
select FND_DOCUMENTS_S.nextval
into   l_document_id
from   dual;
select FND_ATTACHED_DOCUMENTS_S.nextval
into   l_attached_document_id
from   dual;
select nvl(max(seq_num),0) + 10
into   l_seq_num
from   fnd_attached_documents
where  pk1_value = l_pk1_value
and    entity_name = 'AP_INVOICES';
fnd_documents_pkg.insert_row
( X_ROWID                        => l_rowid
, X_DOCUMENT_ID                  => l_document_id
, X_CREATION_DATE                => sysdate
, X_CREATED_BY                   => fnd_profile.value('USER_ID')
, X_LAST_UPDATE_DATE             => sysdate
, X_LAST_UPDATED_BY              => fnd_profile.value('USER_ID')
, X_LAST_UPDATE_LOGIN            => fnd_profile.value('LOGIN_ID')
, X_DATATYPE_ID                  => 5 -- Web Page
, X_CATEGORY_ID                  => l_category_id
, X_SECURITY_TYPE                => 2
, X_PUBLISH_FLAG                 => 'Y'
, X_USAGE_TYPE                   => 'O'
, X_LANGUAGE                     => 'US'
, X_DESCRIPTION                  => l_description
, X_FILE_NAME                    => l_filename
, X_MEDIA_ID                     => l_media_id
fnd_documents_pkg.insert_tl_row
( X_DOCUMENT_ID                  => l_document_id
, X_CREATION_DATE                => sysdate
, X_CREATED_BY                   => fnd_profile.value('USER_ID')
, X_LAST_UPDATE_DATE             => sysdate
, X_LAST_UPDATED_BY              => fnd_profile.value('USER_ID')
, X_LAST_UPDATE_LOGIN            => fnd_profile.value('LOGIN_ID')
, X_LANGUAGE                     => 'US'
, X_DESCRIPTION                  => l_description
, X_FILE_NAME                    => l_filename
, X_MEDIA_ID                     => l_media_id
fnd_attached_documents_pkg.insert_row
( X_ROWID                        => l_rowid
, X_ATTACHED_DOCUMENT_ID         => l_attached_document_id
, X_DOCUMENT_ID                  => l_document_id
, X_CREATION_DATE                => sysdate
, X_CREATED_BY                   => fnd_profile.value('USER_ID')
, X_LAST_UPDATE_DATE             => sysdate
, X_LAST_UPDATED_BY              => fnd_profile.value('USER_ID')
, X_LAST_UPDATE_LOGIN            => fnd_profile.value('LOGIN_ID')
, X_SEQ_NUM                      => l_seq_num
, X_ENTITY_NAME                  => 'AP_INVOICES'
, X_COLUMN1                      => null
, X_PK1_VALUE                    => l_pk1_value
, X_PK2_VALUE                    => null
, X_PK3_VALUE                    => null
, X_PK4_VALUE                    => null
, X_PK5_VALUE                    => null
, X_AUTOMATICALLY_ADDED_FLAG     => 'N'
, X_DATATYPE_ID                  => 5
, X_CATEGORY_ID                  => l_category_id
, X_SECURITY_TYPE                => 2
, X_PUBLISH_FLAG                 => 'Y'
, X_LANGUAGE                     => 'US'
, X_DESCRIPTION                  => l_description
, X_FILE_NAME                    => l_filename
, X_MEDIA_ID                     => l_media_id
end;

Let me know answer for following questions.
1) Did you generate XML fragment for DATA_SOURCE manually?
2) What is the log message for failure?
3) You can set AZ: Debug Mode (1) profile value to Yes and try loading again. Provide me the log.
Thanks
Mugunthan.

Similar Messages

  • My mac mail will not search mail anymore and doesn't load attachments anymore

    Does anyone know why this would be happening?
    My mac mail will not search mail anymore and doesn't load attachments most of the time.  When I enter some text in the search box no results come up and I know there are messages that contain the phrase that I've entered.
    Also about 3 weeks ago attachments only get loaded about 1/4 of the way - if that.  So I have to log onto my web based mail program from the host and retrieve attachements or check the messgae with my iphone.
    Please - does anyone know how to fix this?

    I figureed out that spotlight was turned off via terminal -  I shut it off to unmount a disk (which didn't work anyways)
    sudo mdutil -a -i on
    that's the termianl command to turn spotlight back on.  As far as my attachments not fully loading in mac mail on my iMac that still baffles me.

  • Scripting to load all pdfs in a month into the place command?

    Hello, I was wondering if anyone knows of a script that allows for you to place all pdfs within a set date range from a folder into an InDesign document? I am looking to do my monthly report and each month I have to go out and get each one, would be nice to load the place tool with all the pdfs I have done with a set date range and then just place them accordingly. Is there something out there like this and/or am I missing something obvious?
    Thanks!
    B

    IM Sorry tomaxxi, am I suppose to be inputting something somewhere here in
    regard to the dates? I would need an example like for lets say the month of
    Nov. I try to paste this and save it in the script editor but it keep
    saying that the file cannot be saved. Any ideas? Please bear in mind your
    speaking to a guy who has like zero knowledge when it comes to scripts.
    Best regards,
    Robert
                                                                                    From:       tomaxxi <[email protected]>                                                                               
    To:         Robert Borchardt <[email protected]>                                                                               
    Date:       11/08/2010 03:29 PM                                                                               
    Subject:    Scripting to load all pdfs in a month into the place command?                                                                               
    Sorry for delay...
    I just tested script and it's working fine for me here.
    I created 4 sample PDF-s with just one page, then started script,
    selected exported PDF-s, script sorts them by creation date and loads
    placegun.
    So, all you need to do, is to start script and select documents you want to
    place.
    I changed script little, so make sure you use this one:
    if(app.documents.length != 0){
        var myFiles = File.openDialog("Select Files:", "*.pdf", true);
        if(myFiles != null){
            myFiles.sort(function ( a, b )
                    if ( a.created < b.created )
                        return -1;
                    if ( a.created > b.created )
                        return 1;
                    return 0;
            app.activeDocument.place(myFiles);
        }else{
            alert("No files selected!");
    }else{
        alert("No documents opened!");
    tomaxxi
    http://indisnip.wordpress.com/

  • Script to load documents in KM Repository DB mode

    Is there any good documentation on writing a script to load documents into a KM repository that is set up in DB mode? 
    In the past we had this repository as an FSDB and we could create scripts to upload to the file system.  Now in DB mode we need to do the same.
    Thanks,
    Matt

    Thanks Julian. 
    Can you suggest how to open the webDAV from a batch file?
    Copy C:/MyData/Test1.txt  //webDAV/Folder1/Test1.txt
    Thanks,
    Matt

  • Require script to load fixed  length flat file

    Hi
    Can anyone provide me a script to load a flat file into database ? A sample script would be ok
    thanks in advance
    Siva

    You can use SQL*Loader to do this, or external tables in 9i or higher. These methods are well-documented in the Utilities Guide.
    Cheers, APC

  • SQLLDR script to load .xls file to database.

    Hello Experts,
    Please can anyone tell me the sqlldr script to load .xls file to the database.
    I am using Oracle 10g XE as the database, and want to load a .xls file to a schema using the sqlldr script.
    Waiting for your reply...
    Thanks in advance,
    Manoj Indalkar.

    Hello Manu,
    that's what heterogeneous services are made for. With these you can select from XLS files.
    Re: Read CSV/XLS file to insert into Oracle database.
    or
    http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:4406709207206
    http://jiri.wordpress.com/2010/01/21/load-ms-excel-file-to-oracle-database/
    Regards
    Marcus

  • Can't load attachments on aol using safari

    Can't load attachments on aol using safari

    I don't have aol, but I have discovered that some attachment protocols depend on java, and the iPad doesn't play well with java. For example I've discovered that I cannot do certain things with my work's web mail since it's java based and my iPad simply will not handle it.
    You could see if AOL has a mobile app/site that you can access that might not depend on java. Some sites have 'dumbed down' versions of their sites to cater to mobile devices.

  • Unlike Internet Explorer, Firefox taking forever to load attachments! Why? Fix?

    A few months ago, Firefox started taking FOREVER to load attachments to email. I have uninstalled Firefox and reinstalled it, but that didn't help. I've done all other trouble shooting steps....rebooted computer.....cleared cache, cookies, and history.......run anti-virus checks......defragged.....etc.
    If I use Internet Explorer for outgoing emails with attachments there are no challenges.
    I love Firefox and want to use it.....help, please!

    You are running Windows 7, correct?
    '''Try Firefox Safe Mode''' to see if the problem goes away. Safe Mode is a troubleshooting mode, which disables most add-ons.
    ''(If you're not using it, switch to the Default theme.)''
    * On Windows you can open Firefox 4.0+ in Safe Mode by holding the '''Shift''' key when you open the Firefox desktop or Start menu shortcut.
    * On Mac you can open Firefox 4.0+ in Safe Mode by holding the '''option''' key while starting Firefox.
    * On Linux you can open Firefox 4.0+ in Safe Mode by quitting Firefox and then going to your Terminal and running: firefox -safe-mode (you may need to specify the Firefox installation path e.g. /usr/lib/firefox)
    * Or open the Help menu and click on the '''Restart with Add-ons Disabled...''' menu item while Firefox is running.
    [[Image:FirefoxSafeMode|width=520]]
    ''Once you get the pop-up, just select "'Start in Safe Mode"''
    [[Image:Safe Mode Fx 15 - Win]]
    '''''If the issue is not present in Firefox Safe Mode''''', your problem is probably caused by an extension, and you need to figure out which one. Please follow the [[Troubleshooting extensions and themes]] article for that.
    ''To exit the Firefox Safe Mode, just close Firefox and wait a few seconds before opening Firefox for normal use again.''
    ''When you figure out what's causing your issues, please let us know. It might help other users who have the same problem.''
    Please report back soon.

  • Why won't Firefox automatically show new Hotmail emails or easilly down load attachments when it was working a week ago?

    Why won't Firefox automatically show new Hotmail emails or easily down load attachments when it was working a week ago?

    Hotmail has been having a few hiccups lately I'm afraid.
    If you don't see any emails when you log in, or nothing appears after some time, click in the middle of the grey bar on the left which has the word "'''Inbox'''" in it. This usually causes them to magically appear for some strange reason.
    I've read on on a few blogs that Microsoft is working on the problem, but don't hold your breath.<br><br>
    If this suggestion resolves the problem for you, please click the '''Solved it''' button next to this post after you log in into the forum. This will help others searching for a solution to the same problem.
    Thanks.

  • Failed to load resource: the server responded with a status of 405 (Method Not Allowed) XMLHttpRequest cannot load (WCF service URL). Invalid HTTP status code 405

    Hi,
    while consuming the  WCF service POST method Jquery, getting error in Chrome and firefox, in IE  Its working fine.
    ERROR:Failed to load resource: the server responded with a status of 405 (Method Not Allowed)  XMLHttpRequest cannot load (WCF service URL). Invalid HTTP status code 405.
    Jquery used to call:
    $.support.cors = true
            $.ajax({
                type: "POST",
                url: serviceURL,
                data: JSON.stringify(managedProps),
                useDefaultXhrHeader:false,
                contentType: "application/json; charset=utf-8",
                dataType: "json",
                //processData: true,
                crossDomain: true,
                success: function (data, status, jqXHR) {
                   alert("sucess");
                error: function (xhr) {
                    alert("error");
    WCF sevice Web.config
    <webHttpBinding>
            <!--<binding name="webHttpBindingWithJsonP" transferMode="StreamedRequest" />-->
            <binding name="crossDomain" crossDomainScriptAccessEnabled="true" transferMode="StreamedResponse" />
          </webHttpBinding>
        </bindings>
        <services>
          <service name="DynamicRefinerWCF.DynamicRefiner">
            <endpoint address="" behaviorConfiguration="REST" bindingConfiguration="crossDomain" binding="webHttpBinding" contract="DynamicRefinerWCF.IDynamicRefiner" />
            <endpoint address="mex" binding="mexHttpBinding" contract="DynamicRefinerWCF.IDynamicRefiner" />
            <host>
              <baseAddresses>
                <add baseAddress="http://localhost/example.svc" />
              </baseAddresses>
            </host>
          </service>
        </services>
        <!--<protocolMapping>
            <add binding="basicHttpsBinding" scheme="https" />
        </protocolMapping>-->    
        <!--<serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />-->
      </system.serviceModel>
      <system.webServer>
        <!--<modules runAllManagedModulesForAllRequests="true"/>-->
        <modules>
          <remove name="WebDAVModule" />
        </modules>
        <handlers>
          <remove name="WebDAV" />
        </handlers>
        <directoryBrowse enabled="true" />
        <httpProtocol>
          <customHeaders>
            <add name="Access-Control-Allow-Origin" value="*"/>
            <add name="Access-Control-Allow-Headers" value="Content-Type"/>
            <add name="Access-Control-Allow-Methods" value="GET, POST, PUT, DELETE, OPTIONS"/>
            <add name="Access-Control-Request-Headers:" value="*" />
            <add name="Access-Control-Request-Method:" value="*" />
          </customHeaders>
        </httpProtocol>
        <!--
            To browse web app root directory during debugging, set the value below to true.
            Set to false before deployment to avoid disclosing web app folder information.
          -->
        <!--<directoryBrowse enabled="true"/>-->
      </system.webServer>
    </configuration>
    Thanks,
    Swathi

    Right on - I have done that a number of times.

  • Hi! I need to load a GET url that si very long. On other browsers, I can load the url. In firefox 3.6, no. There is an addons or a plugin so I can extend this limit? If yes, is possible to load automatically this addons when loading a certain page? thanks

    Hi!
    I need to load a GET url that si very long. On other browsers, I can load the url. In firefox 3.6, no.
    There is an addons or a plugin so I can extend this limit? If yes, is possible to load automatically this addons when loading a certain page? thanks
    The url is sometingh like this (this is correctly loaded, but it could be longer)

    Firefox should have problems with long GET data appended to an URL (long would be over 64k).<br />
    If there are problems then it is possible that an extension is the cause of that.
    Start Firefox in [[Safe Mode]] to check if one of your add-ons is causing your problem (switch to the DEFAULT theme: Tools > Add-ons > Themes).
    See [[Troubleshooting extensions and themes]] and [[Troubleshooting plugins]]

  • 301 unable to load plugin"controls" url'flowplayer.controls-32.13.swf What is this and how to reapair this?

    301 unable to load plugin"controls" url'flowplayer.controls-32.13.swf What is this and how to reapair this?
    I have no idea what to do.

    Probably because "latin-9" doesn't exist?
    # nano /usr/share/X11/xkb/symbols/fr
    xkb_symbols "latin9" {
    include "latin"
    include "nbsp(level3)"
    name[Group1]="French (legacy, alternative)";
    key <TLDE> { [ oe, OE, leftdoublequotemark, rightdoublequotemark ] };
    key <AE01> { [ ampersand, 1, dead_acute, periodcentered ] };
    key <AE02> { [ eacute, 2, asciitilde, Eacute ] };
    Try it without the dash (without the "-").
    And don't forget to mark it as solved (by editing the first post).

  • [svn] 3794: Fix loading RSLs with URLs that start with "./" or "../"

    Revision: 3794
    Author: [email protected]
    Date: 2008-10-21 14:21:45 -0700 (Tue, 21 Oct 2008)
    Log Message:
    Fix loading RSLs with URLs that start with "./" or "../"
    QE Notes: Only one "./" is supported at the beginning of the path. Multiple "../" may be in the path, but only at the beginning of the path. No mixing of "./" and "../" is supported.
    Doc Notes: None
    Bugs: SDK-17696
    Reviewer: pfarland
    tests: checkintests, RSL mxunit
    Ticket Links:
    http://bugs.adobe.com/jira/browse/SDK-17696
    Modified Paths:
    flex/sdk/branches/3.2.0/frameworks/projects/framework/src/mx/utils/LoaderUtil.as

    Oh I am using Dreamweaver to put it on the web :-)

  • Load a new URL from command line under Mac OS X 10.5

    Under Mac OS X 1.05: if Firefox is already running and I type (in a Terminal):
    /Applications/Firefox.App/Contents/MacOS/firefox-bin http://google.com
    a pop-up comes out and complains that "Firefox is already running". The behavior under Linux is load the requested URL in a new tab|window.
    I have also tried *documented* options such as "-new-tab" and "-remote", but I get the same error.
    This only happens when Firefox is already running.
    Is there a way to load a new URL from the command line if Firefox is already running, under Mac OS X? I have tried Mac's open(1), but it does not get along well with Tab Mix Plus, so it is useless for me.
    I think that this difference in the behavior between Linux and Mac's version is very very very annoying for developers and users!

    open -a Firefox.app http://www.google.com

  • Firefox does not load last saved urls

    Dear support team,
    I have to open 5 fix urls daily for 12 hours. The new fixfox does not load last opened urls when i came at work next day while previous version was doing same thing for me since months. Please advise.
    Kind regards
    Aziz A. Khan

    Create a new profile as a test to check if your current profile is causing the problems.
    See [[Basic Troubleshooting#Make_a_new_profile|Basic Troubleshooting&#58; Make a new profile]]
    There may be extensions and plugins installed by default in a new profile, so check that in "Tools > Add-ons > Extensions & Plugins"
    If that new profile works then you can transfer some files from the old profile to that new profile (be careful not to copy corrupted files)
    See http://kb.mozillazine.org/Transferring_data_to_a_new_profile_-_Firefox
    Your above posted system details show outdated plugin(s) with known security and stability risks.
    *Shockwave Flash 10.0 r22
    Update the [[Managing the Flash plugin|Flash]] plugin to the latest version.
    *http://www.adobe.com/software/flash/about/

Maybe you are looking for

  • Program no longer boots

    I'm using InDesign 4.0.5 and it no longer boots. It gets to "starting services" then unexpectedly quits. I send a crash report to Adobe, and that's the end of it. No more InDesign. I've taken to using my laptop now, but it's a pain. I want to use the

  • How to: Setup AAE for Remote Disk Access & Serve PS3

    Hi there, I've read so many tutorials, and tried so many combinations, but haven't found anything for my specific purpose. I was wondering if someone might have the insight to do a quick run-through (including specific settings) on how I would setup

  • Is there a plug-in to support the new Canon 7D mark 2 raw files?

    Is there a plug-in to support the new Canon 7D mark 2 raw files?

  • See iPhone in Vista, not in iTunes...

    I've tried everything listed here in the KB article: http://support.apple.com/kb/TS1363?viewlocale=en_US Still no joy, I can see the phone in Vista, access photos and the like, but it doesn't show up in iTunes. Running the diagnostics, everything's g

  • Scrubbing bug?

    There's some kind of scrubbing bug in the iPod app on my iPhone 3G running iOS 4 that I've been noticing for the last couple of weeks (a co-worker just showed me what's probably the same bug on his iPhone 3GS also running iOS 4). When you scrub to so