Subject - Datatime function

How to separate date and time when we select or insert in the SQL in the java method

Hi
Use  java.sql.Date from the Database
and use the follwing code is very important
say ToDt=getdate
int Tyear=ToDt.getYear()+1900;
int Tmon=ToDt.getMonth()+1;
int Tdat=ToDt.getDate();
String monstring1= String.valueOf(Tmon);
if(monstring1.length()<=1)
monstring1="0"+Tmon;
String datetring1= String.valueOf(Tdat);
if(datetring1.length()<=1)
datetring1="0"+Tdat;
FparseTodate = monstring1"-"datetring1"-"Tyear;
the following code to take the time
say StrDate=getdate or somedate
StrDate=StrDate.substring(StrDate.indexOf(' '),StrDate.length());
String ToHrs=StrDate.substring(0,StrDate.indexOf(':'));
String ToMin=StrDate.substring(StrDate.indexOf(':')+1,StrDate.lastIndexOf(':'));
String ToSec=StrDate.substring(StrDate.lastIndexOf(':')+1,StrDate.lastIndexOf('.'));
FtoPrintTime=ToHrs + ":" + ToMin + ":" + ToSec;
and finally you should give below line i.e
sqlquery + "and convert(char(10),<getdate>,110) >='"+FparseTodate i.e <convertdate> +"'";
Hope it will be very helpful for you
Regards
Dhinakar J

Similar Messages

  • How to disable the add/remove subject area function?

    In OBIEE 11G, when creating analysis we can select multiple subject areas that share a common business model. But now I want to close this function.
    Anyone has suggestions?
    Thanks.

    I don't think so we can do this.
    Thanks,

  • RE: RE: Function keys and droplists

    I had to implement the same problem in a window. I wanted Ctrl-F to be the
    same as the "Fetch" button. I forgot the SetAsFunctionKey existed, so I
    created a Menu choice with a shortcut of "Find." I have had no problems,
    when
    Ctrl-F is pressed the "menuWidget.activate" event is posted and no keystroke
    events are sent at all.
    Greg.Nyberg wrote>>>From: [email protected]
    Date: Tue, 26 Jan 1999 10:20:40 -0600
    Subject: RE: Function keys and droplists
    Also note that if you set a cntrl-<letter> as a function key, any time the
    user types that letter (without the cntrl) in any entry field on the window,
    the field gets an "aftervaluechange" event fired. Normally aftervaluechange
    doesn't fire until after you leave the field... This caused us significant
    problems in the use of cntrl-<letter> key combinations, since we were
    validating the contents of fields as the user left them in some cases. We
    went back to only using the upper-row function keys, avoiding F1 (help) and
    F10 which have undesirable side effects as you describe. F4 is also a
    problem as it tends to open droplists before getting processed as a function
    key, but we could live with that.
    - -Greg
    -----Original Message-----
    From: Thomas Kunst [SMTP:[email protected]]
    Sent: Tuesday, January 26, 1999 3:18 AM
    To: [email protected]
    Cc: Ostlund, Scott CWT-MSP
    Subject: Re: Function keys and droplists
    It is a general problem with the SetAsFunctionKey method that the
    default behaviour of the key - which is present if you do not call
    SetAsFunctionKey - is not disabled after the key is used as function
    key. We have this problem under Windows: the F10 key has a default
    behaviour of activating the window's menu. Now if you set F10 as
    function key, the corresponding Forte event is posted to the window
    but
    the menu is still activated. Forte refuses to acknowledge this as a
    bug,
    but maybe requests from several people can convince them ...
    Ostlund, Scott CWT-MSP wrote:
    >
    > Picture a grid with a bunch of widgets within it. Inside this
    grid there is
    > a 'Find' button accelerated with the letter 'F'. Also inside
    there is a
    > droplist. When the user places focus on the droplist and hits
    Ctrl+F to
    > shortcut the find button the method to handle the button click is
    called but
    > the droplist changes to the first element beginning with the
    letter 'F' as
    > well. Does anyone know of a way to not change the droplist when I
    am
    > handling the letter 'F' as a function key?
    Dr. Thomas Kunst mailto:[email protected]
    sd&m GmbH & Co. KG http://www.sdm.de
    software design & management
    Thomas-Dehler-Str. 27, 81737 Muenchen, Germany
    Tel +49 89 63812-221 Fax -444
    To unsubscribe, email '[email protected]' with
    'unsubscribe forte-users' as the body of the message.
    Searchable thread archive
    <URL:http://pinehurst.sageit.com/listarchive/>
    To unsubscribe, email '[email protected]' with
    'unsubscribe forte-users' as the body of the message.
    Searchable thread archive <URL:http://pinehurst.sageit.com/listarchive/>

    I had to implement the same problem in a window. I wanted Ctrl-F to be the
    same as the "Fetch" button. I forgot the SetAsFunctionKey existed, so I
    created a Menu choice with a shortcut of "Find." I have had no problems,
    when
    Ctrl-F is pressed the "menuWidget.activate" event is posted and no keystroke
    events are sent at all.
    Greg.Nyberg wrote>>>From: [email protected]
    Date: Tue, 26 Jan 1999 10:20:40 -0600
    Subject: RE: Function keys and droplists
    Also note that if you set a cntrl-<letter> as a function key, any time the
    user types that letter (without the cntrl) in any entry field on the window,
    the field gets an "aftervaluechange" event fired. Normally aftervaluechange
    doesn't fire until after you leave the field... This caused us significant
    problems in the use of cntrl-<letter> key combinations, since we were
    validating the contents of fields as the user left them in some cases. We
    went back to only using the upper-row function keys, avoiding F1 (help) and
    F10 which have undesirable side effects as you describe. F4 is also a
    problem as it tends to open droplists before getting processed as a function
    key, but we could live with that.
    - -Greg
    -----Original Message-----
    From: Thomas Kunst [SMTP:[email protected]]
    Sent: Tuesday, January 26, 1999 3:18 AM
    To: [email protected]
    Cc: Ostlund, Scott CWT-MSP
    Subject: Re: Function keys and droplists
    It is a general problem with the SetAsFunctionKey method that the
    default behaviour of the key - which is present if you do not call
    SetAsFunctionKey - is not disabled after the key is used as function
    key. We have this problem under Windows: the F10 key has a default
    behaviour of activating the window's menu. Now if you set F10 as
    function key, the corresponding Forte event is posted to the window
    but
    the menu is still activated. Forte refuses to acknowledge this as a
    bug,
    but maybe requests from several people can convince them ...
    Ostlund, Scott CWT-MSP wrote:
    >
    > Picture a grid with a bunch of widgets within it. Inside this
    grid there is
    > a 'Find' button accelerated with the letter 'F'. Also inside
    there is a
    > droplist. When the user places focus on the droplist and hits
    Ctrl+F to
    > shortcut the find button the method to handle the button click is
    called but
    > the droplist changes to the first element beginning with the
    letter 'F' as
    > well. Does anyone know of a way to not change the droplist when I
    am
    > handling the letter 'F' as a function key?
    Dr. Thomas Kunst mailto:[email protected]
    sd&m GmbH & Co. KG http://www.sdm.de
    software design & management
    Thomas-Dehler-Str. 27, 81737 Muenchen, Germany
    Tel +49 89 63812-221 Fax -444
    To unsubscribe, email '[email protected]' with
    'unsubscribe forte-users' as the body of the message.
    Searchable thread archive
    <URL:http://pinehurst.sageit.com/listarchive/>
    To unsubscribe, email '[email protected]' with
    'unsubscribe forte-users' as the body of the message.
    Searchable thread archive <URL:http://pinehurst.sageit.com/listarchive/>

  • Re: Function keys and droplists

    It is a general problem with the SetAsFunctionKey method that the
    default behaviour of the key - which is present if you do not call
    SetAsFunctionKey - is not disabled after the key is used as function
    key. We have this problem under Windows: the F10 key has a default
    behaviour of activating the window's menu. Now if you set F10 as
    function key, the corresponding Forte event is posted to the window but
    the menu is still activated. Forte refuses to acknowledge this as a bug,
    but maybe requests from several people can convince them ...
    Ostlund, Scott CWT-MSP wrote:
    >
    Picture a grid with a bunch of widgets within it. Inside this grid there is
    a 'Find' button accelerated with the letter 'F'. Also inside there is a
    droplist. When the user places focus on the droplist and hits Ctrl+F to
    shortcut the find button the method to handle the button click is called but
    the droplist changes to the first element beginning with the letter 'F' as
    well. Does anyone know of a way to not change the droplist when I am
    handling the letter 'F' as a function key?--
    Dr. Thomas Kunst mailto:[email protected]
    sd&m GmbH & Co. KG http://www.sdm.de
    software design & management
    Thomas-Dehler-Str. 27, 81737 Muenchen, Germany
    Tel +49 89 63812-221 Fax -444
    To unsubscribe, email '[email protected]' with
    'unsubscribe forte-users' as the body of the message.
    Searchable thread archive <URL:http://pinehurst.sageit.com/listarchive/>

    Also note that if you set a cntrl-<letter> as a function key, any time the
    user types that letter (without the cntrl) in any entry field on the window,
    the field gets an "aftervaluechange" event fired. Normally aftervaluechange
    doesn't fire until after you leave the field... This caused us significant
    problems in the use of cntrl-<letter> key combinations, since we were
    validating the contents of fields as the user left them in some cases. We
    went back to only using the upper-row function keys, avoiding F1 (help) and
    F10 which have undesirable side effects as you describe. F4 is also a
    problem as it tends to open droplists before getting processed as a function
    key, but we could live with that.
    -Greg
    -----Original Message-----
    From: Thomas Kunst [SMTP:[email protected]]
    Sent: Tuesday, January 26, 1999 3:18 AM
    To: [email protected]
    Cc: Ostlund, Scott CWT-MSP
    Subject: Re: Function keys and droplists
    It is a general problem with the SetAsFunctionKey method that the
    default behaviour of the key - which is present if you do not call
    SetAsFunctionKey - is not disabled after the key is used as function
    key. We have this problem under Windows: the F10 key has a default
    behaviour of activating the window's menu. Now if you set F10 as
    function key, the corresponding Forte event is posted to the window
    but
    the menu is still activated. Forte refuses to acknowledge this as a
    bug,
    but maybe requests from several people can convince them ...
    Ostlund, Scott CWT-MSP wrote:
    >
    > Picture a grid with a bunch of widgets within it. Inside this
    grid there is
    > a 'Find' button accelerated with the letter 'F'. Also inside
    there is a
    > droplist. When the user places focus on the droplist and hits
    Ctrl+F to
    > shortcut the find button the method to handle the button click is
    called but
    > the droplist changes to the first element beginning with the
    letter 'F' as
    > well. Does anyone know of a way to not change the droplist when I
    am
    > handling the letter 'F' as a function key?
    Dr. Thomas Kunst mailto:[email protected]
    sd&m GmbH & Co. KG http://www.sdm.de
    software design & management
    Thomas-Dehler-Str. 27, 81737 Muenchen, Germany
    Tel +49 89 63812-221 Fax -444
    To unsubscribe, email '[email protected]' with
    'unsubscribe forte-users' as the body of the message.
    Searchable thread archive
    <URL:http://pinehurst.sageit.com/listarchive/>
    To unsubscribe, email '[email protected]' with
    'unsubscribe forte-users' as the body of the message.
    Searchable thread archive <URL:http://pinehurst.sageit.com/listarchive/>

  • SQL functions in TOOL code

     

    In my original email I should have made the point clear that an indexed
    column was required, that led to some confusion, apologies.
    Under Oracle 7 even if the column is indexed the query engine still does a
    full scan of the index to find the maximum or minimum value. As strange as
    this seems it is possible to view it using the Oracle trace functions such
    as tkprof. This method is quicker than not having an index but the cursor
    method is far more efficient.
    When using a cursor based approach Oracle will go straight to the first
    record of the index (depending on MAX or MIN) and retrieve the data. By
    exiting at that point the function has been performed and the I/O operations
    are extremely low compared to a full index scan.
    Of course there is a trade off depending on the amount of rows but for large
    indexed tables the cursor approach will be far faster than the normal
    functions. I'm not sure how other RDBMS's handle MAX/MIN but this has been
    my experience with Oracle. This process may be faster still by using PL/SQL
    but then you are incorporating specific database languages which is
    obviously a problem if you port to a different RDBMS. Here is some code you
    can try for Oracle PL/SQL functions:
    declare
    cursor myCur1 is
    select number_field
    from number_table
    order by number_field desc;
    begin
    open myCur1;
    fetch myCur1 into :max_val;
    close myCur1;
    end;
    I hope this clarifies things a bit more. If in doubt of the execution plan
    of a performance critical query use the database trace functions as they
    show up all sorts of surprises. MAX and MIN are easy to understand when
    viewing code but perform poorly under Oracle, whether v8 behaves differently
    I have yet to discover.
    Cheers,
    Dylan.
    -----Original Message-----
    From: [email protected] [mailto:[email protected]]
    Sent: Thursday, 7 January 1999 3:37
    To: [email protected]
    Subject: RE: SQL functions in TOOL code
    I guess my point is that MAX can always be implemented more
    efficiently than the SORT/ORDER-BY approach (but may not be the
    case, depending on the RDBMS). If an ORDER-BY
    can use an index (which means that the indexing mechanism involves
    a sorted collection rather than an unordered hashtable) so can
    MAX - in which case finding a MAX value could be implemented
    in either O(1) or O(logn) time, depending on the implementation.
    The last sentence being the major point of this whole discussion,
    which is that your mileage may vary depending on the RDBMS - so
    try using both approaches if performance is a problem.
    In terms of maintenance, MAX is the much more intuitive approach
    (In My Opinion, of course), since a programmer can tell right away
    what the code is attempting to do.
    Chad Stansbury
    BORN Information Services, Inc.
    -----Original Message-----
    From: [email protected]
    To: [email protected]; [email protected]; [email protected]
    Sent: 1/6/99 10:45 AM
    Subject: RE: SQL functions in TOOL code
    Well, yes, but in that specific case (looking for max() value) would not
    be
    true that, if you have an index (and only then) on that specific column
    some
    databases (like Oracle) will be smart enough to use index and find max
    value
    without full table scan and without using order by clause?
    Dariusz Rakowicz
    Consultant
    BORN Information Services (http://www.born.com)
    8101 E. Prentice Ave, Suite 310
    Englewood, CO 80111
    303-846-8273
    [email protected]
    -----Original Message-----
    From: Sycamore [SMTP:[email protected]]
    Sent: Wednesday, January 06, 1999 10:29 AM
    To: [email protected]; [email protected]
    Subject: Re: SQL functions in TOOL code
    If (and only if) an index exists on the exact columns in the ORDER BY
    clause, some databases are smart enough to traverse the index (inforward
    or
    reverse order) instead of doing a table scan followed by a sort.
    If there is no appropriate index, you always end up with some kind ofsort
    step.
    Of course this is all highly schema- and database-dependent, so youmust
    weigh those factors when deciding to exploit this behavior.
    Kevin Klein
    Sycamore Group, LLC
    Milwaukee
    -----Original Message-----
    From: [email protected] <[email protected]>
    To: [email protected] <[email protected]>
    Date: Wednesday, January 06, 1999 9:40 AM
    Subject: RE: SQL functions in TOOL code
    This seems a bit counter-intuitive to me... primarily due to
    the fact that both MAX and ORDER-BY functionality would require
    a full table scan on the given column... no? However, I would
    think that a MAX can be implemented more efficiently since it
    just requires the max value in a given set (which can be performed
    in O(n) time on an unordered set) versus an ORDER-BY (sort)
    performance on an unordered set of at best O(nlogn) time.
    Am I missing something? Please set me straight on this 'un.
    Chad Stansbury
    BORN Information Services, Inc.
    -----Original Message-----
    From: Jones, Dylan
    To: 'Vuong, Van'
    Cc: [email protected]
    Sent: 1/5/99 4:42 PM
    Subject: RE: SQL functions in TOOL code
    Hi Van,
    Operating a function such as MAX or MIN is possible as given in your
    example
    but it is worth pointing out the performance overhead with such a
    method.
    When you use MAX, Oracle will do a full table scan of the column so
    if
    you
    have a great many rows it is very inefficient.
    In this case use a cursor based approach and depending on your
    requirments
    (MAX/MIN) use a descending or ascending ORDER BY clause.
    eg.
    begin transaction
    for ( aDate : SomeDateDomain ) in
    sql select DATE_FIELD
    from DATE_TABLE
    order by
    DATE_FIELD DESC
    on session MySessionSO
    do
    found = TRUE;
    aLatestDate.SetValue(aDate);
    // Only bother about the first record
    exit;
    end for;
    end transaction;
    On very large tables the performance increases with the above method
    will be
    considerable so it is worth considering which method to use whensizing
    your
    database and writing your code.
    Cheers,
    Dylan.
    -----Original Message-----
    From: Vuong, Van [mailto:[email protected]]
    Sent: Tuesday, 5 January 1999 6:50
    To: [email protected]
    Subject: SQL functions in TOOL code
    Is it possible to execute a SQL function from TOOL code?
    For example:
    SQL SELECT Max(Version) INTO :MyVersion
    FROM Template_Design
    WHERE Template_Name = :TemplateName
    ON SESSION MySession;
    The function in this example is MAX().
    I am connected to an Oracle database.
    Thanks,
    Van Vuong
    To unsubscribe, email '[email protected]' with
    'unsubscribe forte-users' as the body of the message.
    Searchable thread archive<URL:http://pinehurst.sageit.com/listarchive/>
    To unsubscribe, email '[email protected]' with
    'unsubscribe forte-users' as the body of the message.
    Searchable thread archive<URL:http://pinehurst.sageit.com/listarchive/>
    >
    To unsubscribe, email '[email protected]' with
    'unsubscribe forte-users' as the body of the message.
    Searchable thread archive<URL:http://pinehurst.sageit.com/listarchive/>
    To unsubscribe, email '[email protected]' with
    'unsubscribe forte-users' as the body of the message.
    Searchable thread archive <URL:http://pinehurst.sageit.com/listarchive/>
    To unsubscribe, email '[email protected]' with
    'unsubscribe forte-users' as the body of the message.
    Searchable thread archive <URL:http://pinehurst.sageit.com/listarchive/>
    To unsubscribe, email '[email protected]' with
    'unsubscribe forte-users' as the body of the message.
    Searchable thread archive <URL:http://pinehurst.sageit.com/listarchive/>

  • How to get type any table in function module... or something

    Moderator message: Please use a more informative subject in future, and NOT IN ALL CAPITALS.
    Hi experts,
    how to get type any table option.
    in source code.
    *"  CHANGING
    *"     REFERENCE(S_EKORG) TYPE  ANY TABLE OPTIONAL
    Thank you.
    Edited by: Matt on Feb 17, 2009 2:27 PM - subject edited

    In Function module...... Under changing tab, give the parameter name and type enter associated type any.... You would get that same in the source code and also choose Optional check box.....
    You will see exact code in the FM source code

  • HOW TO SEND A HEBREW EMAIL WITH ATTACHMENT USING DEMO_MAIL

    Hello All,
    This is Not a question , just attaching something I've implemented and might be interesting for few of us,
    This package I'm attaching allows to send Hebrew Language email + attaching files to it.
    This package is based on demo_mail package (combined here but you can search at google for more example information if needed).
    My Package is supplied as is , for any specific information regarding it , please contact me directly at : [email protected] or POST here.
    * Please also note , that this package allow file to be attach via URL (meaning you will have to define a link to this file, if you would like to implement a link to a local file , e.g : c:\temp\myfile , you will have to customize the package your self with database directories option etc ...)
    First I will attach an example of how to use it :
    ==================================
    begin
    demo_mail_heb.send_html_mail_attach(p_sender => '[email protected]',
    p_recipients => '[email protected]',
    p_subject => 'שלום וברכה עולם',
    p_data => '<hr><b>בוקר טוב</b><hr>',
    p_file_name => 'but_choose_file.gif',
    p_file_mime_type => 'application/pdf',
    p_file_URL => 'http://10.172.246.160:7777/i/but_choose_file.gif');
    end;
    Second Here is the Package (please note you will have to modify few settings in order to enable it , such as mail server address ..etc)
    ======================================================================================
    CREATE OR REPLACE PACKAGE demo_mail_heb IS
    ----------------------- Customizable Section -----------------------
    -- Customize the SMTP host, port and your domain name below.
    smtp_host VARCHAR2(256) := 'mail.oracle.com';
    smtp_port PLS_INTEGER := 25;
    smtp_domain VARCHAR2(256) := 'oracle.com';
    -- Customize the signature that will appear in the email's MIME header.
    -- Useful for versioning.
    MAILER_ID CONSTANT VARCHAR2(256) := 'Mailer by Oracle UTL_SMTP';
    --------------------- End Customizable Section ---------------------
    -- A unique string that demarcates boundaries of parts in a multi-part email
    -- The string should not appear inside the body of any part of the email.
    -- Customize this if needed or generate this randomly dynamically.
    BOUNDARY CONSTANT VARCHAR2(256) := '-----7D81B75CCC90D2974F7A1CBD';
    FIRST_BOUNDARY CONSTANT VARCHAR2(256) := '--' || BOUNDARY || utl_tcp.CRLF;
    LAST_BOUNDARY CONSTANT VARCHAR2(256) := '--' || BOUNDARY || '--' ||
    utl_tcp.CRLF;
    -- A MIME type that denotes multi-part email (MIME) messages.
    MULTIPART_MIME_TYPE CONSTANT VARCHAR2(256) := 'multipart/mixed; boundary="'||
    BOUNDARY || '"';
    MAX_BASE64_LINE_WIDTH CONSTANT PLS_INTEGER := 76 / 4 * 3;
    -- Sent clear Html Email
    procedure send_html_mail (p_sender in varchar2 default null,
    p_recipients in varchar2 default null,
    p_subject in varchar2 default null,
    p_data in varchar2 default null,
    p_mime_type in varchar2 default 'text/html; charset=windows-1255');
    -- Sent Html Email with Attachment
    procedure send_html_mail_attach (p_sender in varchar2 default null,
    p_recipients in varchar2 default null,
    p_subject in varchar2 default null,
    p_data in varchar2 default '<b>áå÷ø èåá òåìí - áãé÷ä</b',
    p_mime_type in varchar2 default demo_mail_heb.MULTIPART_MIME_TYPE,
    p_file_name in varchar2 default 'but_choose_file.gif',
    p_file_mime_type in varchar2 default 'application/pdf',
    p_file_URL in varchar2 default 'http://10.172.246.160:7777/i/but_choose_file.gif');
    -- A simple email API for sending email in plain text in a single call.
    -- The format of an email address is one of these:
    -- someone@some-domain
    -- "Someone at some domain" <someone@some-domain>
    -- Someone at some domain <someone@some-domain>
    -- The recipients is a list of email addresses separated by
    -- either a "," or a ";"
    PROCEDURE mail(sender IN VARCHAR2,
              recipients IN VARCHAR2,
              subject IN VARCHAR2,
              message IN VARCHAR2);
    -- Extended email API to send email in HTML or plain text with no size limit.
    -- First, begin the email by begin_mail(). Then, call write_text() repeatedly
    -- to send email in ASCII piece-by-piece. Or, call write_mb_text() to send
    -- email in non-ASCII or multi-byte character set. End the email with
    -- end_mail().
    FUNCTION begin_mail(sender IN VARCHAR2,
              recipients IN VARCHAR2,
              subject IN VARCHAR2,
              mime_type IN VARCHAR2 DEFAULT 'text/plain',
              priority IN PLS_INTEGER DEFAULT NULL)
              RETURN utl_smtp.connection;
    -- Write email body in ASCII
    PROCEDURE write_text(conn IN OUT NOCOPY utl_smtp.connection,
              message IN VARCHAR2);
    -- Write email body in non-ASCII (including multi-byte). The email body
    -- will be sent in the database character set.
    PROCEDURE write_mb_text(conn IN OUT NOCOPY utl_smtp.connection,
                   message IN VARCHAR2);
    -- Write email body in binary
    PROCEDURE write_raw(conn IN OUT NOCOPY utl_smtp.connection,
              message IN RAW);
    -- APIs to send email with attachments. Attachments are sent by sending
    -- emails in "multipart/mixed" MIME format. Specify that MIME format when
    -- beginning an email with begin_mail().
    -- Send a single text attachment.
    PROCEDURE attach_text(conn IN OUT NOCOPY utl_smtp.connection,
                   data IN VARCHAR2,
                   mime_type IN VARCHAR2 DEFAULT 'text/plain',
                   inline IN BOOLEAN DEFAULT TRUE,
                   filename IN VARCHAR2 DEFAULT NULL,
              last IN BOOLEAN DEFAULT FALSE);
    -- Send a binary attachment. The attachment will be encoded in Base-64
    -- encoding format.
    PROCEDURE attach_base64(conn IN OUT NOCOPY utl_smtp.connection,
                   data IN RAW,
                   mime_type IN VARCHAR2 DEFAULT 'application/octet',
                   inline IN BOOLEAN DEFAULT TRUE,
                   filename IN VARCHAR2 DEFAULT NULL,
                   last IN BOOLEAN DEFAULT FALSE);
    -- Send an attachment with no size limit. First, begin the attachment
    -- with begin_attachment(). Then, call write_text repeatedly to send
    -- the attachment piece-by-piece. If the attachment is text-based but
    -- in non-ASCII or multi-byte character set, use write_mb_text() instead.
    -- To send binary attachment, the binary content should first be
    -- encoded in Base-64 encoding format using the demo package for 8i,
    -- or the native one in 9i. End the attachment with end_attachment.
    PROCEDURE begin_attachment(conn IN OUT NOCOPY utl_smtp.connection,
                   mime_type IN VARCHAR2 DEFAULT 'text/plain',
                   inline IN BOOLEAN DEFAULT TRUE,
                   filename IN VARCHAR2 DEFAULT NULL,
                   transfer_enc IN VARCHAR2 DEFAULT NULL);
    -- End the attachment.
    PROCEDURE end_attachment(conn IN OUT NOCOPY utl_smtp.connection,
                   last IN BOOLEAN DEFAULT FALSE);
    -- End the email.
    PROCEDURE end_mail(conn IN OUT NOCOPY utl_smtp.connection);
    -- Extended email API to send multiple emails in a session for better
    -- performance. First, begin an email session with begin_session.
    -- Then, begin each email with a session by calling begin_mail_in_session
    -- instead of begin_mail. End the email with end_mail_in_session instead
    -- of end_mail. End the email session by end_session.
    FUNCTION begin_session RETURN utl_smtp.connection;
    -- Begin an email in a session.
    PROCEDURE begin_mail_in_session(conn IN OUT NOCOPY utl_smtp.connection,
                        sender IN VARCHAR2,
                        recipients IN VARCHAR2,
                        subject IN VARCHAR2,
    --                     mime_type IN VARCHAR2 DEFAULT 'text/plain; charset=windows-1255',
              mime_type IN VARCHAR2 DEFAULT 'text/plain',
                        priority IN PLS_INTEGER DEFAULT NULL);
    -- End an email in a session.
    PROCEDURE end_mail_in_session(conn IN OUT NOCOPY utl_smtp.connection);
    -- End an email session.
    PROCEDURE end_session(conn IN OUT NOCOPY utl_smtp.connection);
    END;
    CREATE OR REPLACE PACKAGE BODY demo_mail_heb IS
    -- Sent clear Html Email
    procedure send_html_mail (p_sender in varchar2 default null,
    p_recipients in varchar2 default null,
    p_subject in varchar2 default null,
    p_data in varchar2 default null,
    p_mime_type in varchar2 default 'text/html; charset=windows-1255')
    Is
    conn utl_smtp.connection;
    BEGIN
    conn := demo_mail_heb.begin_mail(
    sender => p_sender,
    recipients => p_recipients,
    subject => p_subject,
    mime_type => p_mime_type);
    demo_mail_heb.write_text(
    conn => conn,
    message => p_data);
    demo_mail_heb.end_mail( conn => conn );
    END;
    -- Sent Html Email with Attachment
    procedure send_html_mail_attach (p_sender in varchar2 default null,
    p_recipients in varchar2 default null,
    p_subject in varchar2 default null,
    p_data in varchar2 default '<b>áå÷ø èåá òåìí - áãé÷ä</b',
    p_mime_type in varchar2 default demo_mail_heb.MULTIPART_MIME_TYPE,
    p_file_name in varchar2 default 'but_choose_file.gif',
    p_file_mime_type in varchar2 default 'application/pdf',
    p_file_URL in varchar2 default 'http://10.172.246.160:7777/i/but_choose_file.gif')
    is
    conn utl_smtp.connection;
    req utl_http.req;
    resp utl_http.resp;
    data RAW(200);
    begin
    conn := demo_mail_heb.begin_mail(
    sender => p_sender,
    recipients => p_recipients,
    subject => p_subject,
    mime_type => p_mime_type);
    demo_mail_heb.attach_text(
    conn => conn,
    data => p_data,
    mime_type => 'text/html');
    demo_mail_heb.begin_attachment(
    conn => conn,
    mime_type => p_file_mime_type,
    inline => TRUE,
    filename => p_file_name,
    transfer_enc => 'base64');
    -- In writing Base-64 encoded text following the MIME format below,
    -- the MIME format requires that a long piece of data must be splitted
    -- into multiple lines and each line of encoded data cannot exceed
    -- 80 characters, including the new-line characters. Also, when
    -- splitting the original data into pieces, the length of each chunk
    -- of data before encoding must be a multiple of 3, except for the
    -- last chunk. The constant demo_mail_heb.MAX_BASE64_LINE_WIDTH
    -- (76 / 4 * 3 = 57) is the maximum length (in bytes) of each chunk
    -- of data before encoding.
    Utl_Http.set_proxy('www-proxy.us.oracle.com', 'oracle.com');
    req := utl_http.begin_request(p_file_URL);
    resp := utl_http.get_response(req);
    BEGIN
    LOOP
    utl_http.read_raw(resp, data, demo_mail_heb.MAX_BASE64_LINE_WIDTH);
    demo_mail_heb.write_raw(
    conn => conn,
    message => utl_encode.base64_encode(data));
    END LOOP;
    EXCEPTION
    WHEN utl_http.end_of_body THEN
    utl_http.end_response(resp);
    END;
    demo_mail_heb.end_attachment( conn => conn );
    demo_mail_heb.end_mail( conn => conn );
    end;
    -- Return the next email address in the list of email addresses, separated
    -- by either a "," or a ";". The format of mailbox may be in one of these:
    -- someone@some-domain
    -- "Someone at some domain" <someone@some-domain>
    -- Someone at some domain <someone@some-domain>
    FUNCTION get_address(addr_list IN OUT VARCHAR2) RETURN VARCHAR2 IS
    addr VARCHAR2(256);
    i pls_integer;
    FUNCTION lookup_unquoted_char(str IN VARCHAR2,
                        chrs IN VARCHAR2) RETURN pls_integer AS
    c VARCHAR2(5);
    i pls_integer;
    len pls_integer;
    inside_quote BOOLEAN;
    BEGIN
    inside_quote := false;
    i := 1;
    len := length(str);
    WHILE (i <= len) LOOP
         c := substr(str, i, 1);
         IF (inside_quote) THEN
         IF (c = '"') THEN
         inside_quote := false;
         ELSIF (c = '\') THEN
         i := i + 1; -- Skip the quote character
         END IF;
         GOTO next_char;
         END IF;
         IF (c = '"') THEN
         inside_quote := true;
         GOTO next_char;
         END IF;
         IF (instr(chrs, c) >= 1) THEN
         RETURN i;
         END IF;
         <<next_char>>
         i := i + 1;
    END LOOP;
    RETURN 0;
    END;
    BEGIN
    addr_list := ltrim(addr_list);
    i := lookup_unquoted_char(addr_list, ',;');
    IF (i >= 1) THEN
    addr := substr(addr_list, 1, i - 1);
    addr_list := substr(addr_list, i + 1);
    ELSE
    addr := addr_list;
    addr_list := '';
    END IF;
    i := lookup_unquoted_char(addr, '<');
    IF (i >= 1) THEN
    addr := substr(addr, i + 1);
    i := instr(addr, '>');
    IF (i >= 1) THEN
         addr := substr(addr, 1, i - 1);
    END IF;
    END IF;
    RETURN addr;
    END;
    -- Write a MIME header
    PROCEDURE write_mime_header(conn IN OUT NOCOPY utl_smtp.connection,
                   name IN VARCHAR2,
                   value IN VARCHAR2) IS
    BEGIN
    -- utl_smtp.write_data(conn, name || ': ' || value || utl_tcp.CRLF);
    utl_smtp.write_raw_data(conn, UTL_RAW.CAST_TO_RAW(name || ': ' ||value || utl_tcp.CRLF));
    END;
    -- Mark a message-part boundary. Set <last> to TRUE for the last boundary.
    PROCEDURE write_boundary(conn IN OUT NOCOPY utl_smtp.connection,
                   last IN BOOLEAN DEFAULT FALSE) AS
    BEGIN
    IF (last) THEN
    utl_smtp.write_data(conn, LAST_BOUNDARY);
    ELSE
    utl_smtp.write_data(conn, FIRST_BOUNDARY);
    END IF;
    END;
    PROCEDURE mail(sender IN VARCHAR2,
              recipients IN VARCHAR2,
              subject IN VARCHAR2,
              message IN VARCHAR2) IS
    conn utl_smtp.connection;
    BEGIN
    conn := begin_mail(sender, recipients, subject);
    write_text(conn, message);
    end_mail(conn);
    END;
    FUNCTION begin_mail(sender IN VARCHAR2,
              recipients IN VARCHAR2,
              subject IN VARCHAR2,
              mime_type IN VARCHAR2 DEFAULT 'text/plain',
              priority IN PLS_INTEGER DEFAULT NULL)
              RETURN utl_smtp.connection IS
    conn utl_smtp.connection;
    BEGIN
    conn := begin_session;
    begin_mail_in_session(conn, sender, recipients, subject, mime_type,
    priority);
    RETURN conn;
    END;
    PROCEDURE write_text(conn IN OUT NOCOPY utl_smtp.connection,
              message IN VARCHAR2) IS
    BEGIN
    utl_smtp.write_raw_data(conn, utl_raw.cast_to_raw(CONVERT(message,'IW8ISO8859P8')));
    END;
    PROCEDURE write_mb_text(conn IN OUT NOCOPY utl_smtp.connection,
                   message IN VARCHAR2) IS
    BEGIN
    utl_smtp.write_raw_data(conn, utl_raw.cast_to_raw(message));
    END;
    PROCEDURE write_raw(conn IN OUT NOCOPY utl_smtp.connection,
              message IN RAW) IS
    BEGIN
    utl_smtp.write_raw_data(conn, message);
    END;
    PROCEDURE attach_text(conn IN OUT NOCOPY utl_smtp.connection,
                   data IN VARCHAR2,
                   mime_type IN VARCHAR2 DEFAULT 'text/plain',
                   inline IN BOOLEAN DEFAULT TRUE,
                   filename IN VARCHAR2 DEFAULT NULL,
              last IN BOOLEAN DEFAULT FALSE) IS
    BEGIN
    begin_attachment(conn, mime_type, inline, filename);
    write_text(conn, data);
    end_attachment(conn, last);
    END;
    PROCEDURE attach_base64(conn IN OUT NOCOPY utl_smtp.connection,
                   data IN RAW,
                   mime_type IN VARCHAR2 DEFAULT 'application/octet',
                   inline IN BOOLEAN DEFAULT TRUE,
                   filename IN VARCHAR2 DEFAULT NULL,
                   last IN BOOLEAN DEFAULT FALSE) IS
    i PLS_INTEGER;
    len PLS_INTEGER;
    BEGIN
    begin_attachment(conn, mime_type, inline, filename, 'base64');
    -- Split the Base64-encoded attachment into multiple lines
    i := 1;
    len := utl_raw.length(data);
    WHILE (i < len) LOOP
    IF (i + MAX_BASE64_LINE_WIDTH < len) THEN
         utl_smtp.write_raw_data(conn,
         utl_encode.base64_encode(utl_raw.substr(data, i,
         MAX_BASE64_LINE_WIDTH)));
    ELSE
         utl_smtp.write_raw_data(conn,
         utl_encode.base64_encode(utl_raw.substr(data, i)));
    END IF;
    utl_smtp.write_data(conn, utl_tcp.CRLF);
    i := i + MAX_BASE64_LINE_WIDTH;
    END LOOP;
    end_attachment(conn, last);
    END;
    PROCEDURE begin_attachment(conn IN OUT NOCOPY utl_smtp.connection,
                   mime_type IN VARCHAR2 DEFAULT 'text/plain',
                   inline IN BOOLEAN DEFAULT TRUE,
                   filename IN VARCHAR2 DEFAULT NULL,
                   transfer_enc IN VARCHAR2 DEFAULT NULL) IS
    BEGIN
    write_boundary(conn);
    write_mime_header(conn, 'Content-Type', mime_type);
    IF (filename IS NOT NULL) THEN
    IF (inline) THEN
         write_mime_header(conn, 'Content-Disposition',
         'inline; filename="'||filename||'"');
    ELSE
         write_mime_header(conn, 'Content-Disposition',
         'attachment; filename="'||filename||'"');
    END IF;
    END IF;
    IF (transfer_enc IS NOT NULL) THEN
    write_mime_header(conn, 'Content-Transfer-Encoding', transfer_enc);
    END IF;
    utl_smtp.write_data(conn, utl_tcp.CRLF);
    END;
    PROCEDURE end_attachment(conn IN OUT NOCOPY utl_smtp.connection,
                   last IN BOOLEAN DEFAULT FALSE) IS
    BEGIN
    utl_smtp.write_data(conn, utl_tcp.CRLF);
    IF (last) THEN
    write_boundary(conn, last);
    END IF;
    END;
    PROCEDURE end_mail(conn IN OUT NOCOPY utl_smtp.connection) IS
    BEGIN
    end_mail_in_session(conn);
    end_session(conn);
    END;
    FUNCTION begin_session RETURN utl_smtp.connection IS
    conn utl_smtp.connection;
    BEGIN
    -- open SMTP connection
    conn := utl_smtp.open_connection(smtp_host, smtp_port);
    utl_smtp.helo(conn, smtp_domain);
    RETURN conn;
    END;
    PROCEDURE begin_mail_in_session(conn IN OUT NOCOPY utl_smtp.connection,
                        sender IN VARCHAR2,
                        recipients IN VARCHAR2,
                        subject IN VARCHAR2,
                        mime_type IN VARCHAR2 DEFAULT 'text/plain',
                   --     mime_type IN VARCHAR2 DEFAULT 'text/plain; charset=windows-1255',
                        priority IN PLS_INTEGER DEFAULT NULL) IS
    my_recipients VARCHAR2(32767) := recipients;
    my_sender VARCHAR2(32767) := sender;
    BEGIN
    -- Specify sender's address (our server allows bogus address
    -- as long as it is a full email address ([email protected]).
    utl_smtp.mail(conn, get_address(my_sender));
    -- Specify recipient(s) of the email.
    WHILE (my_recipients IS NOT NULL) LOOP
    utl_smtp.rcpt(conn, get_address(my_recipients));
    END LOOP;
    -- Start body of email
    utl_smtp.open_data(conn);
    -- Set "From" MIME header
    write_mime_header(conn, 'From', sender);
    -- Set "To" MIME header
    write_mime_header(conn, 'To', recipients);
    -- Set "Subject" MIME header
    write_mime_header(conn, 'Subject', subject);
    -- Set "Content-Type" MIME header
    write_mime_header(conn, 'Content-Type', mime_type);
    -- Set "X-Mailer" MIME header
    write_mime_header(conn, 'X-Mailer', MAILER_ID);
    -- Set priority:
    -- High Normal Low
    -- 1 2 3 4 5
    IF (priority IS NOT NULL) THEN
    write_mime_header(conn, 'X-Priority', priority);
    END IF;
    -- Send an empty line to denotes end of MIME headers and
    -- beginning of message body.
    utl_smtp.write_data(conn, utl_tcp.CRLF);
    IF (mime_type LIKE 'multipart/mixed%') THEN
    write_text(conn, 'This is a multi-part message in MIME format.' ||
         utl_tcp.crlf);
    END IF;
    END;
    PROCEDURE end_mail_in_session(conn IN OUT NOCOPY utl_smtp.connection) IS
    BEGIN
    utl_smtp.close_data(conn);
    END;
    PROCEDURE end_session(conn IN OUT NOCOPY utl_smtp.connection) IS
    BEGIN
    utl_smtp.quit(conn);
    END;
    END;

    Hello All,
    Small modification - use this package and not the above
    HERE IS A WORKING CODE FOR SENDING HEBREW MESSAGES (INCLUDING SUBJECT IN UTF-8 APPEAR IN ALL EMAIL CLIENTS I HAVE CHECKED) + ATTACHMENTS
    Code attached below is supplied as is with no support. anyhow if help is needed , please contact me via [email protected]
    ============================================================================
    CREATE OR REPLACE PACKAGE demo_mail_heb IS
    ----------------------- Customizable Section -----------------------
    -- Customize the SMTP host, port and your domain name below.
    smtp_host VARCHAR2(256) := pst_ajax.getParameter('EMAIL_SMTP_HOST');
    smtp_port PLS_INTEGER := pst_ajax.getParameter('EMAIL_SMTP_PORT');
    smtp_domain VARCHAR2(256) := pst_ajax.getParameter('EMAIL_SMTP_DOMAIN');
    -- Customize the signature that will appear in the email's MIME header.
    -- Useful for versioning.
    MAILER_ID CONSTANT VARCHAR2(256) := 'Mailer by Oracle UTL_SMTP';
    --------------------- End Customizable Section ---------------------
    -- A unique string that demarcates boundaries of parts in a multi-part email
    -- The string should not appear inside the body of any part of the email.
    -- Customize this if needed or generate this randomly dynamically.
    BOUNDARY CONSTANT VARCHAR2(256) := '-----7D81B75CCC90D2974F7A1CBD';
    FIRST_BOUNDARY CONSTANT VARCHAR2(256) := '--' || BOUNDARY || utl_tcp.CRLF;
    LAST_BOUNDARY CONSTANT VARCHAR2(256) := '--' || BOUNDARY || '--' ||
    utl_tcp.CRLF;
    -- A MIME type that denotes multi-part email (MIME) messages.
    MULTIPART_MIME_TYPE CONSTANT VARCHAR2(256) := 'multipart/mixed; boundary="'||
    BOUNDARY || '"';
    MAX_BASE64_LINE_WIDTH CONSTANT PLS_INTEGER := 76 / 4 * 3;
    -- Sent clear Html Email
    procedure send_html_mail (p_sender in varchar2 default null,
    p_recipients in varchar2 default null,
    p_subject in varchar2 default null,
    p_data in varchar2 default null,
    p_mime_type in varchar2 default 'text/html; charset=windows-1255');
    -- Sent Html Email with Attachment
    procedure send_html_mail_attach (p_sender in varchar2 default null,
    p_recipients in varchar2 default null,
    p_subject in varchar2 default null,
    p_data in varchar2 default '<b>áå÷ø èåá òåìí - áãé÷ä</b',
    p_mime_type in varchar2 default 'text/html; charset=windows-1255',
    p_file_name in varchar2 default 'but_choose_file.gif',
    p_file_mime_type in varchar2 default 'application/pdf',
    p_file_URL in varchar2 default 'http://10.172.246.160:7777/i/but_choose_file.gif');
    -- A simple email API for sending email in plain text in a single call.
    -- The format of an email address is one of these:
    -- someone@some-domain
    -- "Someone at some domain" <someone@some-domain>
    -- Someone at some domain <someone@some-domain>
    -- The recipients is a list of email addresses separated by
    -- either a "," or a ";"
    PROCEDURE mail(sender IN VARCHAR2,
              recipients IN VARCHAR2,
              subject IN VARCHAR2,
              message IN VARCHAR2);
    -- Extended email API to send email in HTML or plain text with no size limit.
    -- First, begin the email by begin_mail(). Then, call write_text() repeatedly
    -- to send email in ASCII piece-by-piece. Or, call write_mb_text() to send
    -- email in non-ASCII or multi-byte character set. End the email with
    -- end_mail().
    FUNCTION begin_mail(sender IN VARCHAR2,
              recipients IN VARCHAR2,
              subject IN VARCHAR2,
              mime_type IN VARCHAR2 DEFAULT 'text/plain',
              priority IN PLS_INTEGER DEFAULT NULL)
              RETURN utl_smtp.connection;
    -- Write email body in ASCII
    PROCEDURE write_text(conn IN OUT NOCOPY utl_smtp.connection,
              message IN VARCHAR2);
    -- Write email body in non-ASCII (including multi-byte). The email body
    -- will be sent in the database character set.
    PROCEDURE write_mb_text(conn IN OUT NOCOPY utl_smtp.connection,
                   message IN VARCHAR2);
    -- Write email body in binary
    PROCEDURE write_raw(conn IN OUT NOCOPY utl_smtp.connection,
              message IN RAW);
    -- APIs to send email with attachments. Attachments are sent by sending
    -- emails in "multipart/mixed" MIME format. Specify that MIME format when
    -- beginning an email with begin_mail().
    -- Send a single text attachment.
    PROCEDURE attach_text(conn IN OUT NOCOPY utl_smtp.connection,
                   data IN VARCHAR2,
                   mime_type IN VARCHAR2 DEFAULT 'text/plain',
                   inline IN BOOLEAN DEFAULT TRUE,
                   filename IN VARCHAR2 DEFAULT NULL,
              last IN BOOLEAN DEFAULT FALSE);
    -- Send a binary attachment. The attachment will be encoded in Base-64
    -- encoding format.
    PROCEDURE attach_base64(conn IN OUT NOCOPY utl_smtp.connection,
                   data IN RAW,
                   mime_type IN VARCHAR2 DEFAULT 'application/octet',
                   inline IN BOOLEAN DEFAULT TRUE,
                   filename IN VARCHAR2 DEFAULT NULL,
                   last IN BOOLEAN DEFAULT FALSE);
    -- Send an attachment with no size limit. First, begin the attachment
    -- with begin_attachment(). Then, call write_text repeatedly to send
    -- the attachment piece-by-piece. If the attachment is text-based but
    -- in non-ASCII or multi-byte character set, use write_mb_text() instead.
    -- To send binary attachment, the binary content should first be
    -- encoded in Base-64 encoding format using the demo package for 8i,
    -- or the native one in 9i. End the attachment with end_attachment.
    PROCEDURE begin_attachment(conn IN OUT NOCOPY utl_smtp.connection,
                   mime_type IN VARCHAR2 DEFAULT 'text/plain',
                   inline IN BOOLEAN DEFAULT TRUE,
                   filename IN VARCHAR2 DEFAULT NULL,
                   transfer_enc IN VARCHAR2 DEFAULT NULL);
    -- End the attachment.
    PROCEDURE end_attachment(conn IN OUT NOCOPY utl_smtp.connection,
                   last IN BOOLEAN DEFAULT FALSE);
    -- End the email.
    PROCEDURE end_mail(conn IN OUT NOCOPY utl_smtp.connection);
    -- Extended email API to send multiple emails in a session for better
    -- performance. First, begin an email session with begin_session.
    -- Then, begin each email with a session by calling begin_mail_in_session
    -- instead of begin_mail. End the email with end_mail_in_session instead
    -- of end_mail. End the email session by end_session.
    FUNCTION begin_session RETURN utl_smtp.connection;
    -- Handling the Email Subject Line
    function mimeheader_encode(
    p_str varchar2
    , p_charset varchar2 := 'UTF-8') return varchar2;
    -- Begin an email in a session.
    PROCEDURE begin_mail_in_session(conn IN OUT NOCOPY utl_smtp.connection,
                        sender IN VARCHAR2,
                        recipients IN VARCHAR2,
                        subject IN VARCHAR2,
    --                     mime_type IN VARCHAR2 DEFAULT 'text/plain; charset=windows-1255',
              mime_type IN VARCHAR2 DEFAULT 'text/plain',
                        priority IN PLS_INTEGER DEFAULT NULL);
    -- End an email in a session.
    PROCEDURE end_mail_in_session(conn IN OUT NOCOPY utl_smtp.connection);
    -- End an email session.
    PROCEDURE end_session(conn IN OUT NOCOPY utl_smtp.connection);
    END;
    CREATE OR REPLACE PACKAGE BODY demo_mail_heb IS
    -- Sent clear Html Email
    procedure send_html_mail (p_sender in varchar2 default null,
    p_recipients in varchar2 default null,
    p_subject in varchar2 default null,
    p_data in varchar2 default null,
    p_mime_type in varchar2 default 'text/html; charset=windows-1255')
    Is
    conn utl_smtp.connection;
    BEGIN
    conn := demo_mail_heb.begin_mail(
    sender => p_sender,
    recipients => p_recipients,
    subject => p_subject,
    mime_type => 'text/html; charset=UTF-8');--p_mime_type);
    demo_mail_heb.write_text(
    conn => conn,
    message => p_data);
    demo_mail_heb.end_mail( conn => conn );
    END;
    -- Sent Html Email with Attachment
    procedure send_html_mail_attach (p_sender in varchar2 default null,
    p_recipients in varchar2 default null,
    p_subject in varchar2 default null,
    p_data in varchar2 default '<b>áå÷ø èåá òåìí - áãé÷ä</b',
    p_mime_type in varchar2 default 'text/html; charset=windows-1255',
    p_file_name in varchar2 default 'but_choose_file.gif',
    p_file_mime_type in varchar2 default 'application/pdf',
    p_file_URL in varchar2 default 'http://10.172.246.160:7777/i/but_choose_file.gif')
    is
    conn utl_smtp.connection;
    req utl_http.req;
    resp utl_http.resp;
    data RAW(200);
    v_mime_type varchar2(32767):=demo_mail.MULTIPART_MIME_TYPE;
    begin
    conn := demo_mail_heb.begin_mail(
    sender => p_sender,
    recipients => p_recipients,
    subject => p_subject,
    mime_type => v_mime_type);
    demo_mail_heb.attach_text(
    conn => conn,
    data => p_data,
    mime_type => 'text/html');
    demo_mail_heb.begin_attachment(
    conn => conn,
    mime_type => p_file_mime_type,
    inline => TRUE,
    filename => p_file_name,
    transfer_enc => 'base64');
    -- In writing Base-64 encoded text following the MIME format below,
    -- the MIME format requires that a long piece of data must be splitted
    -- into multiple lines and each line of encoded data cannot exceed
    -- 80 characters, including the new-line characters. Also, when
    -- splitting the original data into pieces, the length of each chunk
    -- of data before encoding must be a multiple of 3, except for the
    -- last chunk. The constant demo_mail_heb.MAX_BASE64_LINE_WIDTH
    -- (76 / 4 * 3 = 57) is the maximum length (in bytes) of each chunk
    -- of data before encoding.
    req := utl_http.begin_request(p_file_URL);
    resp := utl_http.get_response(req);
    BEGIN
    LOOP
    utl_http.read_raw(resp, data, demo_mail_heb.MAX_BASE64_LINE_WIDTH);
    demo_mail_heb.write_raw(
    conn => conn,
    message => utl_encode.base64_encode(data));
    END LOOP;
    EXCEPTION
    WHEN utl_http.end_of_body THEN
    utl_http.end_response(resp);
    END;
    demo_mail_heb.end_attachment( conn => conn );
    demo_mail_heb.end_mail( conn => conn );
    end;
    -- Return the next email address in the list of email addresses, separated
    -- by either a "," or a ";". The format of mailbox may be in one of these:
    -- someone@some-domain
    -- "Someone at some domain" <someone@some-domain>
    -- Someone at some domain <someone@some-domain>
    FUNCTION get_address(addr_list IN OUT VARCHAR2) RETURN VARCHAR2 IS
    addr VARCHAR2(256);
    i pls_integer;
    FUNCTION lookup_unquoted_char(str IN VARCHAR2,
    chrs IN VARCHAR2) RETURN pls_integer AS
    c VARCHAR2(5);
    i pls_integer;
    len pls_integer;
    inside_quote BOOLEAN;
    BEGIN
    inside_quote := false;
    i := 1;
    len := length(str);
    WHILE (i <= len) LOOP
    c := substr(str, i, 1);
    IF (inside_quote) THEN
    IF (c = '"') THEN
    inside_quote := false;
    ELSIF (c = '\') THEN
    i := i + 1; -- Skip the quote character
    END IF;
    GOTO next_char;
    END IF;
    IF (c = '"') THEN
    inside_quote := true;
    GOTO next_char;
    END IF;
    IF (instr(chrs, c) >= 1) THEN
    RETURN i;
    END IF;
    <<next_char>>
    i := i + 1;
    END LOOP;
    RETURN 0;
    END;
    BEGIN
    addr_list := ltrim(addr_list);
    i := lookup_unquoted_char(addr_list, ',;');
    IF (i >= 1) THEN
    addr := substr(addr_list, 1, i - 1);
    addr_list := substr(addr_list, i + 1);
    ELSE
    addr := addr_list;
    addr_list := '';
    END IF;
    i := lookup_unquoted_char(addr, '<');
    IF (i >= 1) THEN
    addr := substr(addr, i + 1);
    i := instr(addr, '>');
    IF (i >= 1) THEN
    addr := substr(addr, 1, i - 1);
    END IF;
    END IF;
    RETURN addr;
    END;
    -- Write a MIME header
    PROCEDURE write_mime_header(conn IN OUT NOCOPY utl_smtp.connection,
    name IN VARCHAR2,
    value IN VARCHAR2) IS
    BEGIN
    -- utl_smtp.write_data(conn, name || ': ' || value || utl_tcp.CRLF);
    utl_smtp.write_raw_data(conn, UTL_RAW.CAST_TO_RAW(name || ': ' ||value || utl_tcp.CRLF));
    END;
    -- Mark a message-part boundary. Set <last> to TRUE for the last boundary.
    PROCEDURE write_boundary(conn IN OUT NOCOPY utl_smtp.connection,
    last IN BOOLEAN DEFAULT FALSE) AS
    BEGIN
    IF (last) THEN
    utl_smtp.write_data(conn, LAST_BOUNDARY);
    ELSE
    utl_smtp.write_data(conn, FIRST_BOUNDARY);
    END IF;
    END;
    PROCEDURE mail(sender IN VARCHAR2,
    recipients IN VARCHAR2,
    subject IN VARCHAR2,
    message IN VARCHAR2) IS
    conn utl_smtp.connection;
    BEGIN
    conn := begin_mail(sender, recipients, subject);
    write_text(conn, message);
    end_mail(conn);
    END;
    FUNCTION begin_mail(sender IN VARCHAR2,
    recipients IN VARCHAR2,
    subject IN VARCHAR2,
    mime_type IN VARCHAR2 DEFAULT 'text/plain',
    priority IN PLS_INTEGER DEFAULT NULL)
    RETURN utl_smtp.connection IS
    conn utl_smtp.connection;
    BEGIN
    conn := begin_session;
    begin_mail_in_session(conn, sender, recipients, subject, mime_type,
    priority);
    RETURN conn;
    END;
    PROCEDURE write_text(conn IN OUT NOCOPY utl_smtp.connection,
    message IN VARCHAR2) IS
    BEGIN
    utl_smtp.write_raw_data(conn, utl_raw.cast_to_raw(CONVERT(message,'IW8ISO8859P8')));
    -- utl_smtp.write_raw_data(conn, utl_raw.cast_to_raw(message));
    END;
    PROCEDURE write_mb_text(conn IN OUT NOCOPY utl_smtp.connection,
    message IN VARCHAR2) IS
    BEGIN
    utl_smtp.write_raw_data(conn, utl_raw.cast_to_raw(message));
    END;
    PROCEDURE write_raw(conn IN OUT NOCOPY utl_smtp.connection,
    message IN RAW) IS
    BEGIN
    utl_smtp.write_raw_data(conn, message);
    END;
    PROCEDURE attach_text(conn IN OUT NOCOPY utl_smtp.connection,
    data IN VARCHAR2,
    mime_type IN VARCHAR2 DEFAULT 'text/plain',
    inline IN BOOLEAN DEFAULT TRUE,
    filename IN VARCHAR2 DEFAULT NULL,
    last IN BOOLEAN DEFAULT FALSE) IS
    BEGIN
    begin_attachment(conn, mime_type, inline, filename);
    write_text(conn, data);
    end_attachment(conn, last);
    END;
    PROCEDURE attach_base64(conn IN OUT NOCOPY utl_smtp.connection,
    data IN RAW,
    mime_type IN VARCHAR2 DEFAULT 'application/octet',
    inline IN BOOLEAN DEFAULT TRUE,
    filename IN VARCHAR2 DEFAULT NULL,
    last IN BOOLEAN DEFAULT FALSE) IS
    i PLS_INTEGER;
    len PLS_INTEGER;
    BEGIN
    begin_attachment(conn, mime_type, inline, filename, 'base64');
    -- Split the Base64-encoded attachment into multiple lines
    i := 1;
    len := utl_raw.length(data);
    WHILE (i < len) LOOP
    IF (i + MAX_BASE64_LINE_WIDTH < len) THEN
    utl_smtp.write_raw_data(conn,
    utl_encode.base64_encode(utl_raw.substr(data, i,
    MAX_BASE64_LINE_WIDTH)));
    ELSE
    utl_smtp.write_raw_data(conn,
    utl_encode.base64_encode(utl_raw.substr(data, i)));
    END IF;
    utl_smtp.write_data(conn, utl_tcp.CRLF);
    i := i + MAX_BASE64_LINE_WIDTH;
    END LOOP;
    end_attachment(conn, last);
    END;
    PROCEDURE begin_attachment(conn IN OUT NOCOPY utl_smtp.connection,
    mime_type IN VARCHAR2 DEFAULT 'text/plain',
    inline IN BOOLEAN DEFAULT TRUE,
    filename IN VARCHAR2 DEFAULT NULL,
    transfer_enc IN VARCHAR2 DEFAULT NULL) IS
    BEGIN
    write_boundary(conn);
    write_mime_header(conn, 'Content-Type', mime_type);
    IF (filename IS NOT NULL) THEN
    IF (inline) THEN
    write_mime_header(conn, 'Content-Disposition',
    'inline; filename="'||filename||'"');
    ELSE
    write_mime_header(conn, 'Content-Disposition',
    'attachment; filename="'||filename||'"');
    END IF;
    END IF;
    IF (transfer_enc IS NOT NULL) THEN
    write_mime_header(conn, 'Content-Transfer-Encoding', transfer_enc);
    END IF;
    utl_smtp.write_data(conn, utl_tcp.CRLF);
    END;
    PROCEDURE end_attachment(conn IN OUT NOCOPY utl_smtp.connection,
    last IN BOOLEAN DEFAULT FALSE) IS
    BEGIN
    utl_smtp.write_data(conn, utl_tcp.CRLF);
    IF (last) THEN
    write_boundary(conn, last);
    END IF;
    END;
    PROCEDURE end_mail(conn IN OUT NOCOPY utl_smtp.connection) IS
    BEGIN
    end_mail_in_session(conn);
    end_session(conn);
    END;
    FUNCTION begin_session RETURN utl_smtp.connection IS
    conn utl_smtp.connection;
    BEGIN
    -- open SMTP connection
    conn := utl_smtp.open_connection(smtp_host, smtp_port);
    utl_smtp.helo(conn, smtp_domain);
    RETURN conn;
    END;
    -- Handling the Email Subject Line
    function mimeheader_encode(
    p_str varchar2
    , p_charset varchar2 := 'UTF-8') return varchar2 is
    l_str varchar2(2000);
    begin
    l_str:=utl_raw.cast_to_varchar2(utl_encode.quoted_printable_encode(utl_raw.cast_to_raw(p_str)));
    l_str:=replace(l_str,'='||chr(13)||chr(10),''); --unfold the data
    l_str:=replace(l_str,'?','=3f'); --quote question marks
    l_str:=replace(l_str,' ','=20'); --quote spaces
    l_str:='=?'||p_charset||'?Q?'||l_str||'?='; -- add prefix and suffix
    return l_str;
    end;
    PROCEDURE begin_mail_in_session(conn IN OUT NOCOPY utl_smtp.connection,
    sender IN VARCHAR2,
    recipients IN VARCHAR2,
    subject IN VARCHAR2,
    mime_type IN VARCHAR2 DEFAULT 'text/plain',
    -- mime_type IN VARCHAR2 DEFAULT 'text/plain; charset=windows-1255',
    priority IN PLS_INTEGER DEFAULT NULL) IS
    my_recipients VARCHAR2(32767) := recipients;
    my_sender VARCHAR2(32767) := sender;
    BEGIN
    -- Specify sender's address (our server allows bogus address
    -- as long as it is a full email address ([email protected]).
    utl_smtp.mail(conn, get_address(my_sender));
    -- Specify recipient(s) of the email.
    WHILE (my_recipients IS NOT NULL) LOOP
    utl_smtp.rcpt(conn, get_address(my_recipients));
    END LOOP;
    -- Start body of email
    utl_smtp.open_data(conn);
    -- Set "From" MIME header
    write_mime_header(conn, 'From', sender);
    -- Set "To" MIME header
    write_mime_header(conn, 'To', recipients);
    -- Set "Content-Type" MIME header
    write_mime_header(conn, 'Content-Type', mime_type);
    -- write_mime_header(conn, 'Content-Type', 'text/html; charset=UTF-8');
    -- Set "Subject" MIME header
    -- write_mime_header(conn, 'Subject', subject);
    -- write_mime_header(conn, 'Subject', CONVERT(subject,'IW8ISO8859P8'));
    write_mime_header(conn, 'Subject',mimeheader_encode(p_str => subject,p_charset => 'UTF-8'));
    -- write_mime_header(conn, 'Subject',CONVERT(subject,'IW8MSWIN1255'));
    -- Set "X-Mailer" MIME header
    write_mime_header(conn, 'X-Mailer', MAILER_ID);
    -- Set priority:
    -- High Normal Low
    -- 1 2 3 4 5
    IF (priority IS NOT NULL) THEN
    write_mime_header(conn, 'X-Priority', priority);
    END IF;
    -- Send an empty line to denotes end of MIME headers and
    -- beginning of message body.
    utl_smtp.write_data(conn, utl_tcp.CRLF);
    IF (mime_type LIKE 'multipart/mixed%') THEN
    write_text(conn, 'This is a multi-part message in MIME format.' ||
    utl_tcp.crlf);
    END IF;
    END;
    PROCEDURE end_mail_in_session(conn IN OUT NOCOPY utl_smtp.connection) IS
    BEGIN
    utl_smtp.close_data(conn);
    END;
    PROCEDURE end_session(conn IN OUT NOCOPY utl_smtp.connection) IS
    BEGIN
    utl_smtp.quit(conn);
    END;
    END;

  • I continue to have a problem attempting to create Panorama with PE 7

    Has anyone ever received and answer from Adobe for this problem that actually worked?
    Updated
    Sunday, November 1, 2009 12:39:26 PM PST
    Opened
    Wednesday, October 21, 2009 2:47:58 PM PDT
    Status
    Open - Pending Adobe Response
    Product
    Photoshop Elements 7.0
    Support contract
    Adobe Support Program
    Subject
    Panorama function does not work
    Notes & responses
    Notes from Customer
    Sunday, November 1, 2009 12:39:26 PM PST
    I followed your directions and closed all open files including "spySweeper" and "Norton". I went to "run" and entered %appdata% and
    deleted "Adobe" NOTE: there was another file titled AdobeUM which I did not delete. I opened Adobe Elements and went to File->New
    ->Photomerge Panorama and immediately
    got
    Error 1: Unable to create Window
    -Internal error.
    Line: 364
    -> var w = new Window(res);
    I tried this several times from both the edit screen and the screen that shows the individual images and always got the same results
    Notes from Customer
    Friday, October 30, 2009 9:41:22 AM PDT
    I have tried your suggested solution several times and it does not work......fortunately I have found another product that does work
    and have moved on to it. I would like to know what is causing the problem particularly since a "lot" of other users are reporting
    the same problem on the Internet.
    Notes to Customer
    Thursday, October 29, 2009 1:10:51 PM PDT
    Hello John,
    Thank you for contacting Adobe® Web Support for assistance with Adobe
    Photoshop® Elements 7.0.
    Our engineers hopefully will find the issue and post a document about it
    in the Adobe Knowledge Base and/or release a fix.
    Kind regards,
    Nathan F.
    Adobe Web Support
    Notes from Customer
    Wednesday, October 28, 2009 5:10:30 PM PDT
    I followed your instructions and still have exactly the same problem, but thanks for the attempt. I hope your engineers can find th
    e problem as if you look on the internet a lot of other people are having exactly the same difficulty.
    Notes to Customer
    Wednesday, October 28, 2009 10:03:39 AM PDT
    Hello John,
    Thank you for contacting Adobe® Web Support for assistance with Adobe
    Photoshop® Elements 7.0.
    I received your images and was able to reproduce your problem on my
    machine several times and also triggered the same error even after
    resaving the images using the "Save for Web" function.
    Interestingly, after deleting the program's preferences, I was able to
    use Photomerge successfully on your images and could not reproduce the
    error.
    Try the following and see if these steps fix the issue for you as well:
    1. Close all open programs.
    2. Click on Start > Run.
    3. In the run dialog field, type: "%appdata%" [without the quotes].
    4. Delete the Adobe folder shown there (this will delete all Adobe
    software preferences and settings).
    5. Close the window.
    6. Launch Photoshop Elements Editor and try using the Photomerge command
    on your images again.
    The files are being forwarded to our engineers to see if they can
    isolate why these images may corrupt or damage Photoshop Elements'
    preferences and settings.
    I hope this information helps to resolve your issue. If you require
    further assistance with this issue, please update your web case with
    complete details, including what steps you have applied and any error
    messages you are receiving.
    You may also call Technical Support at (800) 642-3623. We are available
    from 6:00 A.M. to 5:00 P.M. Monday - Friday, Pacific Time.
    Kind regards,
    Nathan F.
    Adobe Web Support
    Notes from Customer
    Tuesday, October 27, 2009 1:29:17 PM PDT
    Second file
    Notes to Customer
    Tuesday, October 27, 2009 11:32:49 AM PDT
    Hello John,
    Thank you for contacting Adobe® Web Support for assistance with Adobe
    Photoshop® Elements 7.0.
    We show only one image uploaded to our Support Portal. Its file name is
    Slide-2.jpg. We will need all the images that you are attempting to
    merge uploaded to the Web Portal in order to test and to properly
    investigate your issue.
    Kind regards,
    Nathan F.
    Adobe Web Support
    Notes from Customer
    Monday, October 26, 2009 5:40:57 PM PDT
    Files used to attempt to create panorama are attached
    Notes to Customer
    Monday, October 26, 2009 4:05:05 PM PDT
    Hello John,
    Thank you for contacting Adobe® Web Support for assistance with Adobe
    Photoshop® Elements 7.0.
    I understand that even after using “Save For Web” that you got the same
    error message when you attempted to use Photomerge.
    I checked the attachments on the case and did not see the files that I
    suggested you upload for our engineers to examine.
    Could you please attach the files and we will then see if we can solve
    your problem.
    You may also call Technical Support at (800) 642-3623. We are available
    from 6:00 A.M. to 5:00 P.M. Monday - Friday, Pacific Time.
    Kind regards,
    Nathan F.
    Adobe Web Support
    Notes from Customer
    Monday, October 26, 2009 3:14:06 PM PDT
    Will this help?
    Notes from Customer
    Monday, October 26, 2009 11:03:21 AM PDT
    I tried the work around with the "save for web" and got the same message:
    Error 1: Unable to create Window
    -Internal error.
    Line: 364
    -> var w = new Window(res);
    I can't believe with as many people as are having this problem that Adobe had not developed a solution and released it as a "bug" fi
    x. I see that it is also a problem for people using Elements 8 and I can not imagine that is a very good endorsement for your new p
    roduct.
    Notes to Customer
    Monday, October 26, 2009 10:28:41 AM PDT
    Hello John,
    Thank you for contacting Adobe® Web Support for assistance with Adobe
    Photoshop® Elements 7.0.
    I understand that when you attempt to use the Photomerge feature in
    Photoshop Elements that you immediately get the errors:
    Error 1: Unable to create Window
    - OS error:[1400]
    Line: 364
    -> var w = new Window(res);
    We have seen customer reports of this error and have the matter under
    investigation.
    Currently, it has been determined to be image specific and isolated to
    problems processing the metadata in some images.
    Our software engineers have been unable to isolate the exact issue with
    these problematic images' metadata and have requested that people who
    have images exhibiting this behavior be asked to upload them via the
    Adobe Support Portal so that they can be examined.
    Fortunately, we also do have a potential workaround that may allow you
    to merge your images.
    Try the following:
    1. Open your images in Photoshop Elements Editor.
    2. Save each one using the "Save for Web" command available in the File
    menu in JPG format with the quality set to "High".
    [This will remove all metadata from the images]
    3. Close Photoshop Elements Editor and all open images.
    4. Open the images that you just removed the metadata from using "Save
    for Web" and use Photomerge on them.
    I hope this information helps to resolve your issue. If you require
    further assistance with this issue, please update your web case with
    complete details, including what steps you have applied and any error
    messages you are receiving.
    You may also call Technical Support at (800) 642-3623. We are available
    from 6:00 A.M. to 5:00 P.M. Monday - Friday, Pacific Time.
    Kind regards,
    Nathan F.
    Adobe Web Support
    Notes from Customer
    Sunday, October 25, 2009 9:03:21 AM PDT
    PLEASE!!!!!!!!!!!!!
    Look here
    http://forums.adobe.com/message/2275858#2275 858
    Notes from Customer
    Friday, October 23, 2009 2:42:48 PM PDT
    When I go into Elements 7 and select File->New->Photomerge Panorama I get the message
    Error 1: Unable to create Window
    -Internal error.
    Line: 364
    -> var w = new Window(res);
    and can not go any further. If you look at this on your Forum Site
    http://forums.adobe.com/thread/362825 you will note that a lot of other users are having the same problem
    or look here
    http://www.elementsvillage.com/forums/showth read.php?t=44409
    Same thing.
    I even notice that people usiong Elements 8 are now having the problem.
    Notes to Customer
    Thursday, October 22, 2009 11:52:08 AM PDT
    Hello John,
    Thank you for contacting Adobe® Web Support for assistance with Adobe
    Photoshop® Elements 7.0.
    I understand that when you try to use the Panorama function in Elements,
    you receive a message “unable to create window.”
    Does this problem happen when you are trying to merge specific images or
    does it happen with all images?
    What size are the images you are trying to merge? What dimensions, dots
    per inch, and file type are the images?
    How many images are you trying to merge? Do you have the same problem
    if you try merging just two images?
    Make sure when you are going to do the photomerge that any extra
    programs are closed. The merging process is rather memory intensive so
    the less programs running at once, the better.
    Try to resize each of the photos to a smaller size, and then retry the
    command.
    If you receive the error when saving a panorama, try flattening the file
    (use the Layer>Flatten Image command), or save the panorama in the
    smaller, JPEG format.
    I hope this information helps to resolve your issue. If you require
    further assistance with this issue, please update your web case with
    complete details, including what steps you have applied and any error
    messages you are receiving.
    You may also call Technical Support at (800) 642-3623. We are available
    from 6:00 A.M. to 5:00 P.M. Monday - Friday, Pacific Time.
    Kind regards,
    Scott K.
    Adobe Web Support
    Notes from Customer
    Wednesday, October 21, 2009 2:47:58 PM PDT
    When I try to use the panaroama function I get this message
    Error 1; unable to create window
    -Internal error
    Line; 364
    -> var w = new Window(res);
    I have tried all the solutions from the forum and they do not work. I even bought a new copy of the program, but no luck.
    The function worked before and then stoped working (I had a downloaded version of release 7) That prompted me to buy the new copy A
    LL COPIES WERE PURCHASED BY ME
    Operating System: Windows XP Home
    Has it ever worked? If so, what's changed? (provide comments in description field): Yes
    Same results with different file?: Yes
    Same results with different computer?: Not Applicable
    Recent System Hardware or Software change?: No

    I have recently started having this problem in PSE8. The Adobe workaround
    did work, but I don't fancy having to re register each time I use it.
    What I have discovered is that it's nothing to do with the image metadata as it occurs before any image is opened.
    It SEEMS to only occur if you use file/open with to open an image in the editor - IE start PSE with that command.
    If you close elements down, and start it using programs/PSE/Elements (or your desktop shortcut) - the panorama feature magically works.
    Each time I've opened the editor 'automatically' using image/open with, it seems to create the problem.
    Hope this helps

  • Novice Help with Creating Opportunities Using Web Services 2.0

    Hello,
    I recently took over our CRM integration services and was asked to push some data via our custom portal.
    We use our portal to automate the creation of new opportunities in our Oracle CRM System.
    The code was developed using Web Services 1.0
    I was recently asked to add data to the "Parent Opportunity" field upon creation of a new Opportunity. Now I may be mistaken and if I am I will be very pleased, but it seems to me this field isn't available in 1.0
    If I am mistaken and there IS a way to push data to the "parent opportunity" field using 1.0 Please completely disregard what I have typed below.
    Upon looking at the WSLD for 2.0 I see "ParentoptyID" as an available field.
    I took it upon myself to try and move this process over to 2.0 but I have hit a few major stumbling blocks. Here is the working code for 1.0:
    Public Function CRMAddFinalShipmentOpportunity2(ByVal Session As Session, ByVal Subject As String, ByVal Type As String, ByVal Priority As String, ByVal Account As String, ByVal DueDate As String, ByVal Status As String, ByVal Description As String, ByVal AnnBudget As String, ByVal oppType As String, ByVal partNumber As String, ByVal currency As String, ByVal Territory As String, ByVal Owner As String, ByVal Opp As String) As String
    Dim opportunity As nkkcrm.SiebelOpportunity20.Opportunity = New nkkcrm.SiebelOpportunity20.Opportunity
    Dim input As New nkkcrm.SiebelOpportunity20.OpportunityInsert_Input
    Dim results As New nkkcrm.SiebelOpportunity20.OpportunityInsert_Output
    Dim strPriority As String = "1-High,2-Medium,3-Low"
    Dim strType As String = "Call,Correspondence,Email,Event,Final Shipment - Book,Final Shipment - Special,Lead Follow-Up,Meeting,Opportunity Follow-Up,Other,Presentation,Quote Follow-Up,Sample Follow-Up,Service Request Follow-Up"
    Dim strStatus As String = "Completed,Deferred,Waiting For Someone Else,In Progress,Not Started,Assigned,In Call"
    CRMAddFinalShipmentOpportunity2 = ""
    ' Validate Data (CRM will validate if owner is valid)
    If Owner = "" Then
    AddError("Error: Missing Owner")
    Exit Function
    End If
    If Subject = "" Then
    AddError("Error: Missing Subject")
    Exit Function
    End If
    If strType.IndexOf(Type) < 0 Then
    AddError("Error: Invalid or Missing Type")
    Exit Function
    End If
    If strStatus.IndexOf(Status) < 0 Then
    AddError("Error: Invalid or Missing Status")
    Exit Function
    End If
    If strPriority.IndexOf(Priority) < 0 Then
    AddError("Error: Invalid or Missing Priority")
    Exit Function
    End If
    If Not IsDate(DueDate) Then
    AddError("Error: Invalid or Missing DueDate")
    Exit Function
    End If
    Try
    opportunity.Url = Session.GetURL()
    opportunity.CookieContainer = Session.GetCookieContainer()
    'Create the opportunity
    Dim tmpAry(0) As nkkcrm.SiebelOpportunity20.Opportunity
    input.ListOfOpportunity(0) = tmpAry
    input.ListOfOpportunity.SetValue(New nkkcrm.SiebelOpportunity20.Opportunity, 0)
    'Assign the opportunity Properties
    input.ListOfOpportunity(0).Owner = Owner
    input.ListOfOpportunity(0).OpportunityName = Subject
    input.ListOfOpportunity(0).AccountName = Account
    input.ListOfOpportunity(0).SalesStage = "Rebuy"
    input.ListOfOpportunity(0).CloseDate = Date.Today
    input.ListOfOpportunity(0).Territory = Territory
    input.ListOfOpportunity(0).stProject_Name = "FINAL SHIPMENT REBUY"
    input.ListOfOpportunity(0).SourceCampaign = "Rebuy"
    input.ListOfOpportunity(0).OpportunityType = oppType
    input.ListOfOpportunity(0).Revenue = AnnBudget
    input.ListOfOpportunity(0).Description = Description
    input.ListOfOpportunity(0).bRebuy = "Y"
    input.ListOfOpportunity(0).ProductInterest = partNumber
    input.ListOfOpportunity(0).plCurrency_Type = currency
    'input.ListOfOpportunity(0).ParentoptyId = Opp
    'insert the opportunity
    results = opportunity.OpportunityInsert(input)
    If results.ListOfOpportunity.Length > 0 Then
    CRMAddFinalShipmentOpportunity2 = results.ListOfOpportunity(0).OpportunityId
    End If
    Catch webex As WebException
    AddError(webex.Message)
    Catch ex As Exception
    AddError(ex.Message)
    End Try
    End Function
    What changes might I need to make in order to make this function correctly using Web Services 2.0?
    Currently I get the following errors- For every line of input.ListOfOpportunity(0) I get: '..cannot be indexed because it has no default property.'
    Another example of an issue I'm running into is: 'SetValue' is not a member of 'nkkcrm.SiebelOpportunity20.ListOfOpportunityData'

    We were able to make this work by re-modeling my code after a code sample I found that creates new Activities.
    Here's my code in case it helps someone scanning these forums in the future (Disregard the Opportunity entries that are missing when you compare this to my earlier code- Those weren't relevant to making this work or not work, I simply am not using them now.):
    Public Function CRMAddFinalShipmentOpportunity2(ByVal Session As Session, ByVal Owner As String, ByVal Subject As String, ByVal Type As String, ByVal Priority As String, ByVal DueDate As String, ByVal Status As String, ByVal Description As String, ByVal POValue As String, ByVal oppType As String, ByVal partNumber As String, ByVal currency As String, ByVal servername As String, ByVal pass As String, ByVal usrname As String) As String
    'Get SessionID
    Dim sessionId As String
    sessionId = getSessionLogin(usrname, pass, servername)
    Dim Opportunity As nkkcrm.SiebelOpportunity20.Opportunity = New nkkcrm.SiebelOpportunity20.Opportunity
    Dim OppInput As New nkkcrm.SiebelOpportunity20.OpportunityInsert_Input
    Dim OppOutput As New nkkcrm.SiebelOpportunity20.OpportunityInsert_Output
    Dim strPriority As String = "1-High,2-Medium,3-Low"
    Dim strType As String = "Call,Correspondence,Email,Event,Final Shipment - Book,Final Shipment - Special,Lead Follow-Up,Meeting,Opportunity Follow-Up,Other,Presentation,Quote Follow-Up,Sample Follow-Up,Service Request Follow-Up"
    Dim strStatus As String = "Completed,Deferred,Waiting For Someone Else,In Progress,Not Started,Assigned,In Call"
    'Validate Data (CRM will validate if owner is valid)
    If Owner = "" Then
    AddError("Error: Missing Owner")
    Exit Function
    End If
    If Subject = "" Then
    AddError("Error: Missing Subject")
    Exit Function
    End If
    If strType.IndexOf(Type) < 0 Then
    AddError("Error: Invalid or Missing Type")
    Exit Function
    End If
    If strStatus.IndexOf(Status) < 0 Then
    AddError("Error: Invalid or Missing Status")
    Exit Function
    End If
    If strPriority.IndexOf(Priority) < 0 Then
    AddError("Error: Invalid or Missing Priority")
    Exit Function
    End If
    If Not IsDate(DueDate) Then
    AddError("Error: Invalid or Missing DueDate")
    Exit Function
    End If
    'Instantiate OpportunityData
    Dim objListOfOpportunity As nkkcrm.SiebelOpportunity20.ListOfOpportunityData
    Dim objOpportunity As nkkcrm.SiebelOpportunity20.OpportunityData()
    Try
    objOpportunity = New nkkcrm.SiebelOpportunity20.OpportunityData(0) {}
    objListOfOpportunity = New nkkcrm.SiebelOpportunity20.ListOfOpportunityData()
    objOpportunity(0) = New nkkcrm.SiebelOpportunity20.OpportunityData
    'Assign the opportunity Properties
    objOpportunity(0).Owner = Owner
    objOpportunity(0).OpportunityName = Subject
    objOpportunity(0).AccountName = "UNKNOWN"
    objOpportunity(0).SalesStage = "Rebuy"
    objOpportunity(0).CloseDate = Date.Today
    objOpportunity(0).Territory = "North America"
    objOpportunity(0).stProject_Name = "FINAL SHIPMENT REBUY"
    objOpportunity(0).SourceCampaign = "Rebuy"
    objOpportunity(0).OpportunityType = oppType
    objOpportunity(0).Revenue = POValue
    objOpportunity(0).Description = Description
    objOpportunity(0).bRebuy = True
    objOpportunity(0).ProductInterest = partNumber
    objOpportunity(0).plCurrency_Type = currency
    'Connect the Opportunity to ListOfOpportunity
    objListOfOpportunity.Opportunity = objOpportunity
    'Connect ListofOpportunity to Input Parameter
    OppInput.ListOfOpportunity = objListOfOpportunity
    Opportunity.Url = servername & "/Services/Integration;jsessionid=" & sessionId
    'Opportunity.CookieContainer = Session.GetCookieContainer()
    Opportunity.OpportunityInsert(OppInput)
    Return "success"
    Catch webex As WebException
    AddError(webex.Message)
    Catch ex As Exception
    AddError(ex.Message)
    End Try
    End Function
    Public Function getSessionLogin(ByVal usrname As String, ByVal pass As String, ByVal servername As String)
    Dim loginurl As String = servername & "/Services/Integration?command=login"
    'MessageBox.Show(loginurl);
    Dim req As HttpWebRequest = DirectCast(WebRequest.Create(loginurl), HttpWebRequest)
    ' username and password are passed as HTTP headers
    req.Headers.Add("UserName", usrname)
    req.Headers.Add("Password", pass)
    ' cookie container has to be added to request in order to
    ' retrieve the cookie from the response.
    Dim cookie As Cookie
    req.CookieContainer = New CookieContainer()
    ' make the HTTP callby
    Dim resp As HttpWebResponse = DirectCast(req.GetResponse(), HttpWebResponse)
    If resp.StatusCode = System.Net.HttpStatusCode.OK Then
    ' store cookie for later...
    cookie = resp.Cookies("JSESSIONID")
    If cookie Is Nothing Then
    Return "invalid session"
    End If
    Return cookie.Value
    Else
    Return "invalid session"
    End If
    End Function

  • ItemEditEnd hell - event fires gazillion times

    Well I was making great progress with my first major flex app when I hit a wall. The last element I put in place was to enable user to edit one column in a datagrid. Before I send the changes back to a web service I thought I would confirm that it is firing correctly and passing correct values. To my surprise the event fires over and over again. I believe its something to do with the use of the accordian and multiple canvases. Sorry but this is happening on both flex 3 and 4 platforms (its worse in 4 for some reason). I have not had a chance to scale down the project and simply it so apologies if the code is lenghty.
    Any ideas how to solve this?
    <?xml version="1.0" encoding="utf-8"?>
    <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
                   xmlns:s="library://ns.adobe.com/flex/spark"
                   xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600"
                   creationPolicy= "all">
        <fx:Declarations>
                <mx:WebService
                id="nwCL2"
                wsdl="http://finance-web/BannerWebServices/BannerService.asmx?WSDL">
                <mx:operation name="FetchRequestAsTableToArray"
                              resultFormat="object"
                              showBusyCursor="true"
                              result="resultHandler(event)"
                              fault="onFault(event)">
                    <mx:request>
                        <IncRecItems>{IncRecItems}</IncRecItems>
                        <PmyGUID>{myGUID}</PmyGUID>
                        <AgeItems>{AgeItems}</AgeItems>
                    </mx:request>
                </mx:operation>
            </mx:WebService>
            <mx:WebService
                id="nwCL3"
                wsdl="http://finance-web/BannerWebServices/BannerService.asmx?WSDL">
                <mx:operation name="FetchDirectPOAsTableToArray"
                              resultFormat="object"
                              showBusyCursor="true"
                              result="resultHandler3(event)"
                              fault="onFault(event)">
                    <mx:request>
                        <IncRecItems>{IncRecItems}</IncRecItems>
                        <AgeItems>{AgeItems2}</AgeItems>
                        <PmyGUID>{myGUID}</PmyGUID>
                    </mx:request>
                </mx:operation>
            </mx:WebService>
            <mx:WebService
                id="nwCL4"
                wsdl="http://finance-web/BannerWebServices/BannerService.asmx?WSDL">
                <mx:operation name="FetchDirectPODELAsTableToArray"
                              resultFormat="object"
                              showBusyCursor="true"
                              result="resultHandler4(event)"
                              fault="onFault(event)">
                    <mx:request>
                        <PmyGUID>{myGUID}</PmyGUID>
                    </mx:request>
                </mx:operation>
            </mx:WebService>
            <mx:WebService
                id="nwCL5"
                wsdl="http://finance-web/BannerWebServices/BannerService.asmx?WSDL">
                <mx:operation name="SendMailMessage"
                              resultFormat="object"
                              showBusyCursor="true"
                              result="resultHandler5(event)"
                              fault="onFault(event)">
                    <mx:request>
                        <PmyGUID>{myGUID}</PmyGUID>
                        <from>
                            {from}
                        </from>
                        <recepient>
                            {recepient}
                        </recepient>
                        <bcc>
                            {bcc}
                        </bcc>
                        <cc>
                            {cc}
                        </cc>
                        <subject>
                            {subject}
                        </subject>
                        <body>
                            {myEmailBody}
                        </body>
                        <CallProc>
                            {CallProc}
                        </CallProc>
                    </mx:request>
                </mx:operation>
            </mx:WebService>
            <mx:WebService
                id="nwCL6"
                wsdl="http://finance-web/BannerWebServices/BannerService.asmx?WSDL">
                <mx:operation name="InsRecordFYPOAUD"
                              resultFormat="object"
                              showBusyCursor="true"
                              result="resultHandler6(event)"
                              fault="onFault(event)">
                    <mx:request>
                        <PmyGUID>{myGUID}</PmyGUID>
                        <myuserID>{myuserID}</myuserID>
                        <DocCode>{DocCode}</DocCode>
                    </mx:request>
                </mx:operation>
                <mx:operation name="DelRecordFYPOAUD"
                              resultFormat="object"
                              showBusyCursor="true"
                              result="resultHandler6(event)"
                              fault="onFault(event)">
                    <mx:request>
                        <PmyGUID>{myGUID}</PmyGUID>
                        <DocCode>{DocCode}</DocCode>
                    </mx:request>
                </mx:operation>
                <mx:operation name="FetchUserID"
                              resultFormat="object"
                              showBusyCursor="true"
                              result="resultHandler7(event)"
                              fault="onFault(event)">
                    <mx:request>
                        <PmyGUID>{myGUID}</PmyGUID>
                    </mx:request>
                </mx:operation>
                <mx:operation name="InsGUIDAudit"
                              resultFormat="object"
                              showBusyCursor="true"
                              result="resultHandler8(event)"
                              fault="onFault(event)">
                    <mx:request>
                        <PmyGUID>{myGUID}</PmyGUID>
                    </mx:request>
                </mx:operation>
            </mx:WebService>
            </fx:Declarations>
        <fx:Script>
            <![CDATA[
                import mx.collections.ArrayCollection;
                import mx.collections.IViewCursor;
                import mx.controls.Alert;
                import mx.controls.ToolTip;
                import mx.controls.dataGridClasses.DataGridColumn;
                import mx.controls.dataGridClasses.DataGridItemRenderer;
                import mx.core.mx_internal;
                import mx.events.DataGridEvent;
                import mx.events.ListEvent;
                import mx.rpc.events.FaultEvent;
                import mx.rpc.events.ResultEvent;
                //added after upgrading to flex 4
                import mx.core.FlexGlobals;
                import mx.controls.RichTextEditor
                //import flash.events.Event;
                [Bindable] public var IncRecItems:String;
                [Bindable] public var myGUID:String;
                [Bindable] public var myData:ArrayCollection;
                [Bindable]public var serverData:ArrayCollection; 
                [Bindable]public var serverData3:ArrayCollection;
                [Bindable]public var serverData4:ArrayCollection;
                [Bindable]public var serverData5:ArrayCollection;    
                [Bindable] public var IncRecItems3:String;
                [Bindable] public var from:String;
                [Bindable] public var recepient:String;
                [Bindable] public var bcc:String;
                [Bindable] public var cc:String;
                [Bindable] public var subject:String;
                [Bindable] public var body:String;
                [Bindable] public var CallProc:String;
                [Bindable] public var myEmailBody:String;
                [Bindable] public var myuserID:String;
                [Bindable] public var DocCode:String;
                [Bindable] public var AgeItems:String;
                [Bindable] public var AgeItems2:String;
                [Bindable] public var DocItem:Number;
                [Bindable] public var DocText:String;
                //this adds event listener for mouse over event so I can display descriptive text about various columns values
                //POFromRequest.addEventListener(ListEvent.ITEM_ROLL_OVER, declarePosition);
                //USE ROLLOVER VERSUS MOUSEOVER EVENT AS THE LATTER CAUSES BLINKING
                private function createToolTip(event:ListEvent):void {
                //var col:DataGridColumn = POFromRequest.columns[event.columnIndex];
                //var newValue:String = ArrayCollection(POFromRequest.dataProvider).getItemAt(event.rowIndex)[col.dataField];
                //Alert.show("You are hovering over:" +newValue);
                if (event.columnIndex==13)
                var str:String =  "P-Y=Paid and Completed" + "\r"  + "O-Y=Open and Completed" + "\r"  + "O-R=Open and Unmatched" ;
                //this code works and will fetch active mouse over datagrid values!           
                var col:DataGridColumn = POFromRequest.columns[event.columnIndex];
                var newValue:String = ArrayCollection(POFromRequest.dataProvider).getItemAt(event.rowIndex)[col.dataField];
                //Alert.show("You are hovering over:" +newValue);
                else if (event.columnIndex==21||event.columnIndex==22)
                var col21:DataGridColumn = POFromRequest.columns[21];
                var col22:DataGridColumn = POFromRequest.columns[22];
                var Value21:Number = ArrayCollection(POFromRequest.dataProvider).getItemAt(event.rowIndex)[col21.dataField];
                var Value22:Number = ArrayCollection(POFromRequest.dataProvider).getItemAt(event.rowIndex)[col22.dataField];
                //21=Bal not Rec(BNR);22=Bal not Inv(BNI)
                //evaluate BNR/BNI and give approp message which represents
                //action required by end user (ie they don't have to think!)
                var str:String
                if (Value21>0 && Value22<=0)
                str = "Case1:All invoices sent to AP but we are missing a receiving. Please contact receiving.";
                else if(Value21>0 && Value22>0)
                str = "Case2:We are missing invoices and receiving. Please contact both departments ASAP.";
                else if(Value21<=0 && Value22>0)
                str = "Case3:All receiving completed but we are missing invoices. Please contact AP and forward any invoices to them ASAP.";
                else if(Value21==0 && Value22==0)
                str = "Case4:All documents received. No action required. You can hide these items by clicking/turning off the box:Include Balance of 0 Items? ";
                //var str:String = Value21.toString()+Value22.toString()
                else
                //var str:String = "Row :"  +event.rowIndex + "Column : " +event.columnIndex;
                POFromRequest.toolTip = str;
                private function deleteToolTip(obj:Object):void {
                POFromRequest.toolTip = null;
                //start mouse over code for directPO datagrid
                private function createToolTip2(event:ListEvent):void {
                //var col:DataGridColumn = DirectPOGrid.columns[event.columnIndex];
                //var newValue:String = ArrayCollection(DirectPOGrid.dataProvider).getItemAt(event.rowIndex)[col.dataField];
                //Alert.show("You are hovering over:" +newValue);
                if (event.columnIndex==1)
                var str:String =  "If you know for sure that this item is not yours then highlight item by left clicking, then hit the delete button below. Hold the ctrl key to select multiple items." ;               
                if (event.columnIndex==12)
                var str:String =  "P-Y=Paid and Completed" + "\r"  + "O-Y=Open and Completed" + "\r"  + "O-R=Open and Unmatched" ;
                //this code works and will fetch active mouse over datagrid values!           
                var col:DataGridColumn = DirectPOGrid.columns[event.columnIndex];
                var newValue:String = ArrayCollection(DirectPOGrid.dataProvider).getItemAt(event.rowIndex)[col.dataField];
                //Alert.show("You are hovering over:" +newValue);
                else if (event.columnIndex==20||event.columnIndex==21)
                var col20:DataGridColumn = DirectPOGrid.columns[20];
                var col21:DataGridColumn = DirectPOGrid.columns[21];
                var Value20:Number = ArrayCollection(DirectPOGrid.dataProvider).getItemAt(event.rowIndex)[col20.dataField];
                var Value21:Number = ArrayCollection(DirectPOGrid.dataProvider).getItemAt(event.rowIndex)[col21.dataField];
                //21=Bal not Rec(BNR);22=Bal not Inv(BNI)
                //evaluate BNR/BNI and give approp message which represents
                //action required by end user (ie they don't have to think!)
                var str:String
                if (Value20>0 && Value21<=0)
                str = "Case1:All invoices sent to AP but we are missing a receiving. Please contact receiving.";
                else if(Value20>0 && Value21>0)
                str = "Case2:We are missing invoices and receiving. Please contact both departments ASAP.";
                else if(Value20<=0 && Value21>0)
                str = "Case3:All receiving completed but we are missing invoices. Please contact AP and forward any invoices to them ASAP.";
                else if(Value20==0 && Value21==0)
                str = "Case4:All documents received. No action required. You can hide these items by clicking/turning off the box:Include Balance of 0 Items? ";
                //var str:String = Value21.toString()+Value22.toString()
                else
                //var str:String = "Row :"  +event.rowIndex + "Column : " +event.columnIndex;
                DirectPOGrid.toolTip = str;
                private function deleteToolTip2(obj:Object):void {
                DirectPOGrid.toolTip = null;
                //end tool tip code
                private function GetData():void
                //IncRecItems = "Y"
                //IncRecItems = "Y"
                //myGUID = "d5ef405a-d64a-489f-8583-38dd087de502"
                //var MyurlParams:Dictionary = new Dictionary();
                //MyurlParams = getUrlParamaters();
                //myGUID = MyurlParams['myGUID'];
                nwCL2.FetchRequestAsTableToArray.send();
                private function GetData3():void
                //IncRecItems = "Y"
                //IncRecItems = "Y"
                //myGUID = "d5ef405a-d64a-489f-8583-38dd087de502"
                var MyurlParams:Dictionary = new Dictionary();
                MyurlParams = getUrlParamaters();
                myGUID = MyurlParams['myGUID'];
                nwCL3.FetchDirectPOAsTableToArray.send();
                NotifyDel();
                private function GetData4():void
                //IncRecItems = "Y"
                //IncRecItems = "Y"
                //myGUID = "d5ef405a-d64a-489f-8583-38dd087de502"
                var MyurlParams:Dictionary = new Dictionary();
                MyurlParams = getUrlParamaters();
                myGUID = MyurlParams['myGUID'];
                nwCL4.FetchDirectPODELAsTableToArray.send();
                NotifyStatus();
                public function resultHandler(event:ResultEvent):void {
                serverData = new ArrayCollection(event.result.source);
                //             Alert.show("getdata fired");
                public function resultHandler3(event:ResultEvent):void {
                serverData3 = new ArrayCollection(event.result.source);
                //             Alert.show("getdata fired");
                public function resultHandler4(event:ResultEvent):void {
                serverData4 = new ArrayCollection(event.result.source);
                //             Alert.show("getdata fired");
                public function resultHandler5(event:ResultEvent):void {
                var FunctionResult:String=event.result.toString();
                var Response:String;
                if(FunctionResult != "Success")
                Alert.show("A problem has occurred. " + FunctionResult);
                else
                Alert.show("The email was sent successfully.");
                //             Alert.show("getdata fired");
                public function resultHandler6(event:ResultEvent):void {
                var FunctionResult:String=event.result.toString();
                var Response:String;
                if(FunctionResult != "Success")
                Alert.show("A problem has occurred. " + FunctionResult);
                else
                Alert.show("Item moved.");
                //refresh both datagrids for deleted/ins records
                //need to call diff proc which does the same but does not show the initial message box
                ReloadTables()
                public function resultHandler7(event:ResultEvent):void {
                var FunctionResult:String=event.result.toString();
                if(FunctionResult == "Invalid GUID")
                Alert.show("A problem has occurred. " + FunctionResult);
                else
                myuserID = FunctionResult;
                myGlobVar.globMyUserID = FunctionResult;
                public function resultHandler8(event:ResultEvent):void {
                //we don't really care about handling this event
                var FunctionResult:String=event.result.toString();
                if(FunctionResult == "Invalid GUID")
                Alert.show("A problem has occurred. " + FunctionResult);
                else
                //myuserID = FunctionResult;
                private function initApp():void
                //code for grabing guid passed from .net ldap authentication page
                //this file is located on finance-web box along with guid database.
                //the web service is also located on finance-web
                //and flex source code is on box fin-selement3 but is saved to U and published to finance-web
                //(this is because flex is installed on fin-selement3 only
                //GurfeedTbl = nwCL.FetchFTVACCTAsTable();
                flash.system.Security.allowDomain("*");flash.system.Security.allowInsecureDomain("*");
                //siteData.send();
                //trace("Hello from Flex Debugging!");
                //Alert.show("Init app fired");
                //first get focus of email tab (if we don't then a bug exists;error on object creation)
                //I have tried various techniques for some reason I can't load back to base 0
                //ac.selectedIndex = 3;
                //Alert.show("Please remember to audit documents on all tabssss!");
                //ac.selectedIndex = 1;
                Alert.show("HardCoded GUID in place. Remove after testing")
                myGUID = "c25ef14a-bff4-4e07-bfa5-f9c0725c3fd0";
                //need to set initial value
                AgeItems = "N";
                AgeItems2 = "N";
                myBody.text = "Body";
                //myGUID = "d5ef405a-d64a-489f-8583-38dd087de502"
                //var MyurlParams:Dictionary = new Dictionary();
                //MyurlParams = getUrlParamaters();
                //myGUID = MyurlParams['myGUID'];
                //Alert.show("HardCoded GUID in place. Remove after testing")
                //myGUID = "c25ef14a-bff4-4e07-bfa5-f9c0725c3fd0";
                //insert audit trail record
                nwCL6.InsGUIDAudit.send();
                nwCL6.FetchUserID.send(); //for some reason when this was located inside the proc it was called from it would not
                //set the global variable until after it was required resulting in null error
                //myGlobVar.globMyUserID = myUserID ;
                //Alert.show
                private function checkBoxZero_change(evt:Event):void {
                if(checkBoxZero.selected == true) IncRecItems = "Y" else IncRecItems ="N";
                //Alert.show(IncRecItems.toString())
                GetData() ;
                private function checkBoxAge_change(evt:Event):void {
                //if(checkBoxAge.selected == true) AgeItems = "Y" else AgeItems ="N";
                if(checkBoxAge.selected == true) AgeItems = "N" else AgeItems ="Y";
                GetData() ;
                private function checkBoxAge2_change(evt:Event):void {
                //if(checkBoxAge.selected == true) AgeItems = "Y" else AgeItems ="N";
                if(checkBoxAge2.selected == true) AgeItems2 = "N" else AgeItems2 ="Y";
                GetData3() ;
                private function checkBoxZero3_change(evt:Event):void {
                if(checkBoxZero3.selected == true) IncRecItems3 = "Y" else IncRecItems3 ="N";
                //Alert.show(IncRecItems.toString())
                GetData3() ;
                private function onFault(event:FaultEvent):void {
                Alert.show(event.fault.toString());
                private function RemoveItems():void {
                var selectedItems:Array = DirectPOGrid.selectedItems;
                var listItem:Object;
                if (selectedItems.length < 1)
                Alert.show("You did not highlight any items. Highlight items by left clicking the mouse. To select multiple items, hold the ctrl key down while left clicking.");
                //nwCL6.FetchUserID.send();
                for (var i:int = 0; i < selectedItems.length; i++)
                listItem = selectedItems[i];
                //DirectPOGrid.removeItem(listItem);
                //TargetList.addItem(listItem);
                //var newValue:String = ArrayCollection("selectedItems").getItemAt(i)["PO"];
                var newValue:String = listItem["PO"].toString()
                //Alert.show(newValue);
                DocCode = listItem["PO"].toString()
                //call proc to set userid was not working here as it was getting fired after so I moved it to initapp
                //nwCL6.FetchUserID.send();
                myuserID = myGlobVar.globMyUserID;
                //myUserID = 'testuser';
                nwCL6.InsRecordFYPOAUD.send();
                //Alert.show("doc:"+DocCode+" guid:"+myGUID+"user:"+myGlobVar.globMyUserID);
                //Alert.show(selectedItems[i][PO].toString());
                private function RemoveItems4():void {
                var selectedItems:Array = DirectPOGridNotMine.selectedItems;
                var listItem:Object;
                if (selectedItems.length < 1)
                Alert.show("You did not highlight any items. Highlight items by left clicking the mouse. To select multiple items, hold the ctrl key down while left clicking.");
                for (var i:int = 0; i < selectedItems.length; i++)
                listItem = selectedItems[i];
                //DirectPOGrid.removeItem(listItem);
                //TargetList.addItem(listItem);
                //var newValue:String = ArrayCollection("selectedItems").getItemAt(i)["PO"];
                var newValue:String = listItem["PO"].toString()
                //Alert.show(newValue);
                //Alert.show(selectedItems[i][PO].toString());
                DocCode = listItem["PO"].toString()
                //myGUID = "d5ef405a-d64a-489f-8583-38dd087de502"
                nwCL6.DelRecordFYPOAUD.send();
                private function NotifyDel():void {
                Alert.show("These PO's were not created from requests and we are only guessing that they might belong to you. If you don't want to see specific PO's then you can remove them. This is done by highlighting items (left clicking on row), then clicking the delete button below. Hold the ctrl key to select multiple items.") ;   
                private function NotifyStatus():void {
                Alert.show("These PO's were not created from requests and are displayed here because you have marked them as not belonging to you. If you have accidentally deleted these and they really belong to you then hit the delete button below to reactivate them.") ;   
                private function POSendEmailAP():void {
                var selectedItems:Array = POFromRequest.selectedItems;
                var listItem:Object;
                var newValue:String;
                var ValEmailTO:String = "[email protected],[email protected]";
                var myString:String;
                var txtBody:String;
                var num:int;
                if (selectedItems.length < 1)
                Alert.show("You did not highlight any items. Highlight items by left clicking the mouse. To select multiple items, hold the ctrl key down while left clicking.");
                // emailTO.text = ValEmailTO ;
                txtBody = myBody.text.toString()
                for (var i:int = 0; i < selectedItems.length; i++)
                listItem = selectedItems[i];
                //DirectPOGrid.removeItem(listItem);
                //TargetList.addItem(listItem);
                //var newValue:String = ArrayCollection("selectedItems").getItemAt(i)["PO"];
                newValue = listItem["PO"].toString();
                //Alert.show(newValue);
                emailTO.text = ValEmailTO;
                if (emailSUBJECT.text.toString()=="subject")
                emailSUBJECT.text = newValue ;   
                else
                if (emailSUBJECT.text.indexOf(newValue,0)<0)//this ensures that we only show distinct PO values
                emailSUBJECT.text = emailSUBJECT.text.toString()+"/"+newValue ;   
                //code for email body
                if (txtBody=="Body")
                txtBody = "Dear AP/Receiving:" + "\r" + "\r" + "Please note that I have received the following items directly from the vendor(s): " + "\r" + "\r" + listItem["PO"].toString() + " POItem:" + listItem["POItem"].toString() + " " + listItem["CMDDESC"].toString()  + " " + "QTYRCVD:" + listItem["BALNOTRECD"].toString() + " ";
                else
                txtBody = txtBody + "\r" + listItem["PO"].toString() + " POItem:" + listItem["POItem"].toString() + " " + listItem["CMDDESC"].toString()  + " " + "QTYRCVD:" + listItem["BALNOTRECD"].toString() + " ";   
                myBody.text = txtBody;
                //public variable for sending body text to email service in correct format
                //body = txtBody;
                Alert.show("Items copied to email tab.");
                POFromRequest.selectedIndex=-1;
                private function POSendEmailAPDirectStuff():void {
                var selectedItems:Array = DirectPOGrid.selectedItems;
                var listItem:Object;
                var newValue:String;
                var ValEmailTO:String = "[email protected],[email protected]";
                var myString:String;
                var txtBody:String;
                if (selectedItems.length < 1)
                Alert.show("You did not highlight any items. Highlight items by left clicking the mouse. To select multiple items, hold the ctrl key down while left clicking.");
                // emailTO.text = ValEmailTO ;
                txtBody = myBody.text.toString()
                for (var i:int = 0; i < selectedItems.length; i++)
                listItem = selectedItems[i];
                //DirectPOGrid.removeItem(listItem);
                //TargetList.addItem(listItem);
                //var newValue:String = ArrayCollection("selectedItems").getItemAt(i)["PO"];
                newValue = listItem["PO"].toString();
                //Alert.show(newValue);
                emailTO.text = ValEmailTO;
                if (emailSUBJECT.text.toString()=="subject")
                emailSUBJECT.text = newValue ;   
                else
                if (emailSUBJECT.text.indexOf(newValue,0)<0)//this ensures that we only show distinct PO values
                emailSUBJECT.text = emailSUBJECT.text.toString()+"/"+newValue ;   
                //code for email body
                if (txtBody=="Body")
                txtBody = "Dear AP/Receiving:" + "\r" + "\r" + "Please note that I have received the following items directly from the vendor(s): " + "\r" + "\r" + listItem["PO"].toString() + " POItem:" + listItem["POItem"].toString() + " " + listItem["CMDDESC"].toString()  + " " + "QTYRCVD:" + listItem["BALNOTRECD"].toString() + " ";
                else
                txtBody = txtBody + "\r" + listItem["PO"].toString() + " POItem:" + listItem["POItem"].toString() + " " + listItem["CMDDESC"].toString()  + " " + "QTYRCVD:" + listItem["BALNOTRECD"].toString() + " ";   
                myBody.text = txtBody;
                Alert.show("Items copied to email tab.");
                DirectPOGrid.selectedIndex=-1;
                private function ClearEmail():void {
                myBody.text = "Body";
                emailSUBJECT.text = "Subject";
                private function SEmail():void {
                //hardcode until we fetch via guid
                //Alert.show("Insert code to fetch username from guid. For now its hard coded.");
                CallProc = "FLEX"; //This notifies web service so it parses out \r to <p>
                //from = "[email protected]"
                var MyurlParams:Dictionary = new Dictionary();
                MyurlParams = getUrlParamaters();
                myGUID = MyurlParams['myGUID'];
                //myGUID = "c25ef14a-bff4-4e07-bfa5-f9c0725c3fd0";
                //from = myuserID+"@aus.edu";
                from = myGlobVar.globMyUserID+"@aus.edu";
                recepient =  emailTO.text.toString();
                cc = emailCC.text.toString();
                bcc = "[email protected]"
                subject = emailSUBJECT.text.toString();   
                //var stuffToReplace:RegExp = /\r\n|\n\r/g;
                //the key to this function is the /g means global and means to replace ALL instances of search variable!!!
                var stuffToReplace:RegExp = /\r/g;
                //myEmailBody = myEmailBody.replace("\r","*123");
                myEmailBody = myBody.text.replace(stuffToReplace,"*123*");
                //myEmailBody = myBody.text.replace("\r","*\r").toString();
                //myEmailBody = myBody.text ;
                //myEmailBody.replace("\r","*\r");
                //myGUID = "d5ef405a-d64a-489f-8583-38dd087de502"
                nwCL5.SendMailMessage.send();
                private function ReloadTables():void
                //myGUID = "d5ef405a-d64a-489f-8583-38dd087de502"
                nwCL4.FetchDirectPODELAsTableToArray.send();
                nwCL3.FetchDirectPOAsTableToArray.send();    
                private function getUrlParamaters():Dictionary
                var urlParams:Dictionary = new Dictionary();
                if (ExternalInterface.available)
                var fullUrl:String = ExternalInterface.call('eval', 'document.location.href');
                var paramStr:String = fullUrl.split('?')[1];
                if (paramStr != null)
                var params:Array = paramStr.split('&');
                for (var i:int=0; i < params.length; i++)
                var kv:Array = params[i].split('=');
                urlParams[kv[0]] = kv[1];
                else
                    urlParams = FlexGlobals.topLevelApplication.parameters;
                //urlParams = Application.application.parameters;
                    //urlParams = sparks.components.application.parameters;
                return urlParams;
                private function RefData(event:DataGridEvent):void {
                    var dataGrid:DataGrid = event.target as DataGrid;
                    var dsColumnIndex:Number = event.columnIndex;
                    var col:DataGridColumn = dataGrid.columns[dsColumnIndex];
                    var colPO:DataGridColumn = dataGrid.columns[1];
                    var colPOItem:DataGridColumn = dataGrid.columns[5];
                    var colNotes:DataGridColumn = dataGrid.columns[23];
                    var newValue:String = dataGrid.itemEditorInstance[col.editorDataField];
                    var newValue2:String = dataGrid.itemEditorInstance[colNotes.editorDataField];   
                    var dbval:String;
                    var dbvalLen:Number;
                    DocCode = ArrayCollection(POFromRequest.dataProvider).getItemAt(event.rowIndex)[colPO.dataField];
                    DocItem = ArrayCollection(POFromRequest.dataProvider).getItemAt(event.rowIndex)[colPOItem.dataField ];
                    dbval = ArrayCollection(POFromRequest.dataProvider).getItemAt(event.rowIndex)[col.dataField];
                    if (dbval.length != null)
                    dbvalLen = dbval.length;
                    else
                    dbvalLen = 0;
                    //Alert.show("key=" +myGlobVar.KeyPress)
                    if (newValue2.substr(0,3)!='P00') //this is silly code that is necessary until I sort the whole problem of audit note Dec 2010
                        //When the user hits the tab key the cursor goes to the next line and for some reason assigns PO field value to notes field value
                        //this line of code ignores in that case       
                        //if (dbval==null && newValue2!=null && newValue2!='')
                        //if (newValue2!=null || newValue2!='')
                        //if (newValue2!=null || dbvalLen>=1)
                        Alert.show("grid value" +DocCode+":"+DocItem+"Notes:"+newValue+"colNotes:"+newValue2+"dbvnotes:"+dbval);                
                    //nwCL6.UpdateFYPOAUD.send();
                    //tempCnt
                    //if datagrid edit is true then this will fire       
                    //all the code below is checking if value from datagrid has changed
                    //as compared to value stored in source data so we don't need this in this project
                    //var dsFieldName:String = event.dataField;
                    //var author:VOAuthor = event.itemRenderer.data as VOAuthor;
                    //if (newValue == author[dsFieldName])
                    //    return;
                    //get the new value for the first name or last name
                    //author[dsFieldName] = newValue;
                    //myRemote.saveData(author);
            ]]>
        </fx:Script>
        <mx:Panel title="Auditing of Purchase Order Delivery and Invoicing Status by User:" height="100%" width="100%"
                  creationComplete="initApp()" paddingTop="5" paddingBottom="5" paddingLeft="5" paddingRight="5" fontSize="15" horizontalAlign="left" color="#701193">
            <mx:Accordion id="ac"
                          width="100%"
                          height="100%"
                          selectedIndex="0"
                          historyManagementEnabled="false"  >
                <mx:Canvas width="100%" height="400"  label="Detailed Data for which a PO was issued from a Request" id="POfromReq" backgroundColor="#D2E9DA" color="#A60831">
                    <mx:Button click="GetData()" label="Press to load Data" width="305"></mx:Button>
                    <mx:FormItem label="HeaderWordWrap:" x="335">
                        <mx:CheckBox id="checkBox" selected="true" />
                    </mx:FormItem>
                    <mx:FormItem label="Include Balance of 0 Items?:" x="550">
                        <mx:CheckBox id="checkBoxZero" selected="false" change="checkBoxZero_change(event);"  />
                    </mx:FormItem>
                    <mx:FormItem label="Only Show Items > 30 Days?:" x="850">
                        <mx:CheckBox id="checkBoxAge" selected="true" change="checkBoxAge_change(event);"  />
                    </mx:FormItem>
                    <mx:DataGrid id="POFromRequest"  allowMultipleSelection="true" doubleClickEnabled="true" editable="True" horizontalScrollPolicy="auto" width="3500" height="300" dataProvider="{serverData}" y="36" itemRollOut="deleteToolTip(event)" itemRollOver="createToolTip(event)" itemEditEnd="RefData(event)">
                        <mx:columns>
                            <fx:Array>
                                <mx:DataGridColumn headerText="UserName"  editable="false" dataField="SOURCEREQUESTUSERID" width="100"/>
                                <mx:DataGridColumn headerText="PO" dataField="PO" width="100"/>
                                <mx:DataGridColumn headerText="Vendor" dataField="VENDOR" width="270"/>
                                <mx:DataGridColumn headerText="Po Date" dataField="PO_Date" width="120"/>
                                <mx:DataGridColumn headerText="Ordered QTY (A)" headerWordWrap="{checkBox.selected}" dataField="Ord_Qty" width="120" />
                                <mx:DataGridColumn headerText="PO Item" dataField="POItem" width="100" />
                                <mx:DataGridColumn headerText="Commodity Description" dataField="CMDDESC" width="300"/>
                                <mx:DataGridColumn headerText="PO Unit Price" dataField="POUNITPRICE" width="120"/>
                                <mx:DataGridColumn headerText="Org code" dataField="ACTGORG" width="100"/>
                                <mx:DataGridColumn headerText="Receiving Document" dataField="RECEIVE_DOC_NUM" headerWordWrap="{checkBox.selected}" width="120"/>
                                <mx:DataGridColumn headerText="Received Qty (B)" dataField="RECQTY" width="150"/>
                                <mx:DataGridColumn headerText="Inv Document #" dataField="INVCODE" width="150"/>
                                <mx:DataGridColumn headerText="Vendor Invoice #" dataField="VENDINV" width="150"/>
                                <mx:DataGridColumn headerText="Invoice Status" dataField="INVSTATUS" width="150"/>
                                <mx:DataGridColumn headerText="Invoice Due Date" dataField="DUEDATE" width="150"/>
                                <mx:DataGridColumn headerText="Invoice Date" dataField="VENDORINVDATE" width="120"/>
                                <mx:DataGridColumn headerText="Fund" dataField="FUNDCODE" width="80"/>
                                <mx:DataGridColumn headerText="Account" dataField="ACCT" width="80"/>
                                <mx:DataGridColumn headerText="Org" dataField="ORG" width="80"/>
                                <mx:DataGridColumn headerText="Prg" dataField="PROG" width="80"/>
                                <mx:DataGridColumn headerText="Net Invoiced (C)" headerWordWrap="{checkBox.selected}" dataField="NETINVD" width="130"/>
                                <mx:DataGridColumn headerText="Balance not Received (A-B)" headerWordWrap="{checkBox.selected}" dataField="BALNOTRECD" width="175"/>
                                <mx:DataGridColumn headerText="Balance not Invoiced (B-C)" headerWordWrap="{checkBox.selected}" dataField="BALNOTINVD" width="175"/>
                                <mx:DataGridColumn headerText="Notes" headerWordWrap="{checkBox.selected}" dataField="NOTES" width="300"/>
                            </fx:Array>
                        </mx:columns>
                    </mx:DataGrid>
                    <mx:List id="square"  visible="false" x="298" y="266"></mx:List>
                    <mx:Button click="POSendEmailAP()" label="Press to copy selected items to body of email template" width="478" y="344"></mx:Button>
                </mx:Canvas>
                <mx:Canvas width="100%" height="400"  label="Direct PO Details: PO not created from request" id="DirectPO" backgroundColor="#D2E9DA" color="#A60831">
                    <mx:Button click="GetData3()" label="Press to load Data" width="305"></mx:Button>
                    <mx:FormItem label="HeaderWordWrap:" x="335">
                        <mx:CheckBox id="checkBox3" selected="true" />
                    </mx:FormItem>
                    <mx:FormItem label="Include Balance of 0 Items?:" x="550">
                        <mx:CheckBox id="checkBoxZero3" selected="false" change="checkBoxZero3_change(event);"  />
                    </mx:FormItem>
                    <mx:FormItem label="Only Show Items > 30 Days?:" x="850">
                        <mx:CheckBox id="checkBoxAge2" selected="true" change="checkBoxAge2_change(event);"  />
                    </mx:FormItem>
                    <mx:DataGrid id="DirectPOGrid"  allowMultipleSelection="true" horizontalScrollPolicy="auto" width="3500" height="300" dataProvider="{serverData3}" y="36" itemRollOut="deleteToolTip2(event)" itemRollOver="createToolTip2(event)" itemEditEnd="RefData(event)">
                        <mx:columns>
                            <fx:Array>
                                <mx:DataGridColumn  headerText="PossibleUserName" dataField="PossibleSourceUserid" width="160"/>
                                <mx:DataGridColumn headerText="PO" dataField="PO" width="100"/>
                                <mx:DataGridColumn headerText="Vendor" dataField="VENDOR" width="270"/>
                                <mx:DataGridColumn headerText="Po Date" dataField="PO_Date" width="120"/>
                                <mx:DataGridColumn headerText="Ordered QTY (A)" headerWordWrap="{checkBox3.selected}" dataField="Ord_Qty" width="120" />
                                <mx:DataGridColumn headerText="PO Item" dataField="POItem" width="100" />
                                <mx:DataGridColumn headerText="Commodity Description" dataField="CMDDESC" width="300"/>
                                <mx:DataGridColumn headerText="PO Unit Price" dataField="POUNITPRICE" width="120"/>
                                <mx:DataGridColumn headerText="Org code" dataField="ACTGORG" width="100"/>
                                <mx:DataGridColumn headerText="Received Qty (B)" dataField="RECQTY" width="150"/>
                                <mx:DataGridColumn headerText="Inv Document #" dataField="INVCODE" width="150"/>
                                <mx:DataGridColumn headerText="Vendor Invoice #" dataField="VENDINV" width="150"/>
                                <mx:DataGridColumn headerText="Invoice Status" dataField="INVSTATUS" width="150"/>
                                <mx:DataGridColumn headerText="Invoice Due Date" dataField="DUEDATE" width="150"/>
                                <mx:DataGridColumn headerText="Invoice Date" dataField="VENDORINVDATE" width="120"/>
                                <mx:DataGridColumn headerText="Fund" dataField="FUNDCODE" width="80"/>
                                <mx:DataGridColumn headerText="Account" dataField="ACCT" width="80"/>
                                <mx:DataGridColumn headerText="Org" dataField="ORG

    Thanks...I was using Alert instead of trace to make sure events were firing along with correct parameter values before calling web service. I never thought in a million years that would be causing the problem. However, when user hits return it drops the focus to the next row which causes a second itemEditEnd to fire (so it still doesn't work smoothly). At any rate, I approached it another way by wiring up a pop up box.

  • Mulitple Data Sets

    I've worked for over a month to study and resolve this but have not recognized the answer.
    The web site intent is,
    1. A single XML master data base contains all photographs for display.  My XML data set does not have quotes.
    2. Spry tabbed panels are used to select galleries (Spry regions) (e.g. roses, Big Sur Coast, etc) from the master data base.  There are a dozen galleries.
    3. Thumbnails of a gallery are displayed in the content panel.
    4. Selecting a thumbnail displays a large view of the selected photo in a separate div (Spry detail region).
    My studies of XML, Spry and Javascript has brought me to a stumbling block.
    Solution 1. I tried to use a single name for the gallery filtered data sets.  Each filter would be applied to a separate page of the tabbed panels.  However, I was not successful in getting the thumbnails to change.  (I was not able to get variables within XPath expressions to work.)
    Solution 2. I tried to use unique names for the gallery filtered data sets.  Again, each filter (data set) was applied to a separate page of the tabbed panels.  However, I have not been successful in displaying the large view of a selected thumbnail because the Spry detail region specifies a single data base.  I tried defining a common named data set from the filtered data set but this did not work (see dsrose of the second content panel).
    My two questions are,
    A. How can I get the thumbnails to change (i.e. update the data base and utilize it) for Solution 1.
    B. Can I have a Spry detail region with multiple data sources?
    My current source code follows.
    I thank you for your consideration.
    Scott
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Untitled Document</title>
    <style type="text/css">
    <!--
    body {
    background-color: #FFF;
    text-align: center;
    margin: 0px;
    padding: 0px;
    #wrapper {
    width: 85%;
    margin-top: 10px;
    margin-right: auto;
    margin-bottom: 0px;
    margin-left: auto;
    border: 2px dashed #F0F;
    #leftColumn {
    float: left;
    height: 700px;
    width: 400px;
    #header {
    height: 90px;
    font-size: 24px;
    font-style: italic;
    vertical-align: middle;
    padding: 0px;
    text-align: center;
    float: right;
    width: 50%;
    border: 2px solid #F00;
    #selectedPhoto {
    height: 600px;
    font-size: 24px;
    font-style: italic;
    vertical-align: middle;
    padding: 0px;
    text-align: center;
    float: right;
    margin-top: 135px;
    width: 550px;
    border: 2px solid #0F0;
    -->
    </style>
    <script src="SpryAssets/xpath.js" type="text/javascript"></script>
    <script src="SpryAssets/SpryData.js" type="text/javascript"></script>
    <script type="text/javascript">
    <!--
    var name;
    var width;
    var height;
    var thumbname;
    var thumbwidth;
    var thumbheight;
    var subject;
    var description;
    var thumbnail;
    var dsphoto;
    var dsphotodata;
    //-->
    </script>
    <script type="text/javascript">
    var dsdatanew = new Spry.Data.XMLDataSet("EM_photo_no_Quotes.xml", "/gallery");
    var dsnew = new Spry.Data.XMLDataSet("EM_photo_no_Quotes.xml", "gallery/photos/photo [subject = 'new']");
    var dsdatarose = new Spry.Data.XMLDataSet("EM_photo_no_Quotes.xml", "/gallery");
    var dsrose = new Spry.Data.XMLDataSet("EM_photo_no_Quotes.xml", "gallery/photos/photo [subject = 'rose']");
    var dsdatacallalily = new Spry.Data.XMLDataSet("EM_photo_no_Quotes.xml", "/gallery");
    var dscallalily = new Spry.Data.XMLDataSet("EM_photo_no_Quotes.xml", "gallery/photos/photo [subject = 'callalily']");
    var dsdatablossom = new Spry.Data.XMLDataSet("EM_photo_no_Quotes.xml", "/gallery");
    var dsblossom = new Spry.Data.XMLDataSet("EM_photo_no_Quotes.xml", "gallery/photos/photo [subject = 'blossom']");
    var dsdatapgbeach = new Spry.Data.XMLDataSet("EM_photo_no_Quotes.xml", "/gallery");
    var dspgbeach = new Spry.Data.XMLDataSet("EM_photo_no_Quotes.xml", "gallery/photos/photo [subject = 'pgbeach']");
    var dsdataMonterey = new Spry.Data.XMLDataSet("EM_photo_no_Quotes.xml", "/gallery");
    var dsMonterey = new Spry.Data.XMLDataSet("EM_photo_no_Quotes.xml", "gallery/photos/photo [subject = 'Monterey']");
    var dsdatabigsurcoast = new Spry.Data.XMLDataSet("EM_photo_no_Quotes.xml", "/gallery");
    var dsbigsurcoast = new Spry.Data.XMLDataSet("EM_photo_no_Quotes.xml", "gallery/photos/photo [subject = 'bigsurcoast']");
    var dsdataSalinas = new Spry.Data.XMLDataSet("EM_photo_no_Quotes.xml", "/gallery");
    var dsSalinas = new Spry.Data.XMLDataSet("EM_photo_no_Quotes.xml", "gallery/photos/photo [subject = 'Salinas']");
    var dsdataanimal = new Spry.Data.XMLDataSet("EM_photo_no_Quotes.xml", "/gallery");
    var dsanimal = new Spry.Data.XMLDataSet("EM_photo_no_Quotes.xml", "gallery/photos/photo [subject = 'animal']");
    var dsdatanight = new Spry.Data.XMLDataSet("EM_photo_no_Quotes.xml", "/gallery");
    var dsnight = new Spry.Data.XMLDataSet("EM_photo_no_Quotes.xml", "gallery/photos/photo [subject = 'night']");
    var dsdatachurch = new Spry.Data.XMLDataSet("EM_photo_no_Quotes.xml", "/gallery");
    var dschurch = new Spry.Data.XMLDataSet("EM_photo_no_Quotes.xml", "gallery/photos/photo [subject = 'church']");
    var dsdataother = new Spry.Data.XMLDataSet("EM_photo_no_Quotes.xml", "/gallery");
    var dsother = new Spry.Data.XMLDataSet("EM_photo_no_Quotes.xml", "gallery/photos/photo [subject = 'other']");
    function MM_callJS(jsStr) { //v2.0
      return eval(jsStr)
    </script>
    <script src="SpryAssets/SpryTabbedPanels.js" type="text/javascript"></script>
    <link href="SpryAssets/SpryTabbedPanels.css" rel="stylesheet" type="text/css" />
    </head>
    <body>
    <div id="wrapper">
      <div id="leftColumn">
        <div id="TabbedPanels1" class="TabbedPanels">
          <ul class="TabbedPanelsTabGroup">
            <li class="TabbedPanelsTab" tabindex="0">Welcome</li>
            <li class="TabbedPanelsTab" tabindex="0">Mechanical Engineering</li>
            <li class="TabbedPanelsTab" tabindex="0">Photography</li>
          </ul>
          <div class="TabbedPanelsContentGroup">
            <div class="TabbedPanelsContent">Welcome - Content 1</div>
            <div class="TabbedPanelsContent">Mechanical Engineering - Content 2</div>
            <div class="TabbedPanelsContent"> <!-- Photography - Content 3 -->
              <div id="TabbedPanels2" class="TabbedPanels">
                <ul class="TabbedPanelsTabGroup">
                  <li class="TabbedPanelsTab" tabindex="0">New</li>
                  <li class="TabbedPanelsTab" tabindex="0">Roses</li>
                  <li class="TabbedPanelsTab" tabindex="0">Calla Lilies</li>
                  <li class="TabbedPanelsTab" tabindex="0">Other Blossoms and Leaves</li>
                  <li class="TabbedPanelsTab" tabindex="0">Pacific Grove Beach</li>
                  <li class="TabbedPanelsTab" tabindex="0">Monterey Harbor and Beach</li>
                  <li class="TabbedPanelsTab" tabindex="0">Big Sur Coast</li>
                  <li class="TabbedPanelsTab" tabindex="0">Salinas Valley</li>
                  <li class="TabbedPanelsTab" tabindex="0">Animals</li>
                  <li class="TabbedPanelsTab" tabindex="0">Night</li>
                  <li class="TabbedPanelsTab" tabindex="0">Church</li>
                  <li class="TabbedPanelsTab" tabindex="0">Other</li>
                </ul>
                <div class="TabbedPanelsContentGroup-2">
                  <div class="TabbedPanelsContent-2">
                    <div spry:region="dsnew dsdatanew"> <img src="{dsdatanew::thumbnail/@base}{thumbname}" width = {thumbwidth}px height = {thumbheight}px spry:repeat="dsnew" onclick="dsnew.setCurrentRow('{ds_RowID}');" /></div>
                  </div>
                  <div class="TabbedPanelsContent-2">
                    <div spry:region="dsrose dsdatarose"> <img src="{dsdatarose::thumbnail/@base}{thumbname}" width = {thumbwidth}px height = {thumbheight}px spry:repeat="dsrose" onclick="window.dsphoto=dsrose; window.dsphotodata=dsdatarose;window.dsphoto.setCurrentRow('{ds_RowID}');" /></div>
                  </div>
                  <div class="TabbedPanelsContent-2">
                    <div spry:region="dscallalily dsdatacallalily"> <img src="{dsdatacallalily::thumbnail/@base}{thumbname}" width = {thumbwidth}px height = {thumbheight}px spry:repeat="dscallalily" onclick="dscallalily.setCurrentRow('{ds_RowID}');" /></div>
                  </div>
                  <div class="TabbedPanelsContent-2">
                    <div spry:region="dsblossom dsdatablossom"> <img src="{dsdatablossom::thumbnail/@base}{thumbname}" width = {thumbwidth}px height = {thumbheight}px spry:repeat="dsblossom" onclick="dsblossom.setCurrentRow('{ds_RowID}');" /></div>
                  </div>
                  <div class="TabbedPanelsContent-2">
                    <div spry:region="dspgbeach dsdatapgbeach"> <img src="{dsdatapgbeach::thumbnail/@base}{thumbname}" width = {thumbwidth}px height = {thumbheight}px spry:repeat="dspgbeach" onclick="dspgbeach.setCurrentRow('{ds_RowID}');" /></div>
                  </div>
                  <div class="TabbedPanelsContent-2">
                    <div spry:region="dsMonterey dsdataMonterey"> <img src="{dsdataMonterey::thumbnail/@base}{thumbname}" width = {thumbwidth}px height = {thumbheight}px spry:repeat="dsMonterey" onclick="dsMonterey.setCurrentRow('{ds_RowID}');" /></div>
                  </div>
                  <div class="TabbedPanelsContent-2">
                    <div spry:region="dsbigsurcoast dsdatabigsurcoast"> <img src="{dsdatabigsurcoast::thumbnail/@base}{thumbname}" width = {thumbwidth}px height = {thumbheight}px spry:repeat="dsbigsurcoast" onclick="dsbigsurcoast.setCurrentRow('{ds_RowID}');" /></div>
                  </div>
                  <div class="TabbedPanelsContent-2">
                    <div spry:region="dsSalinas dsdataSalinas"> <img src="{dsdataSalinas::thumbnail/@base}{thumbname}" width = {thumbwidth}px height = {thumbheight}px spry:repeat="dsSalinas" onclick="dsSalinas.setCurrentRow('{ds_RowID}');" /></div>
                  </div>
                  <div class="TabbedPanelsContent-2">
                    <div spry:region="dsanimal dsdataanimal"> <img src="{dsdataanimal::thumbnail/@base}{thumbname}" width = {thumbwidth}px height = {thumbheight}px spry:repeat="dsanimal" onclick="dsanimal.setCurrentRow('{ds_RowID}');" /></div>
                  </div>
                  <div class="TabbedPanelsContent-2">
                    <div spry:region="dsnight dsdatanight"> <img src="{dsdatanight::thumbnail/@base}{thumbname}" width = {thumbwidth}px height = {thumbheight}px spry:repeat="dsnight" onclick="dsnight.setCurrentRow('{ds_RowID}');" /></div>
                  </div>
                  <div class="TabbedPanelsContent-2">
                    <div spry:region="dschurch dsdatachurch"> <img src="{dsdatachurch::thumbnail/@base}{thumbname}" width = {thumbwidth}px height = {thumbheight}px spry:repeat="dschurch" onclick="dschurch.setCurrentRow('{ds_RowID}');" /></div>
                  </div>
                  <div class="TabbedPanelsContent-2">
                    <div spry:region="dsother dsdataother"> <img src="{dsdataother::thumbnail/@base}{thumbname}" width = {thumbwidth}px height = {thumbheight}px spry:repeat="dsother" onclick="dsother.setCurrentRow('{ds_RowID}');" /></div>
                  </div>
                </div>
              </div>
            </div>
            <!-- End "Photography Content 3" Tabbed Panels Content. -->
          </div>
        </div>
      </div><!-- End div "leftColumn" -->
      <div id="header">
        <p>Envision Moore<br />
          Mechanical Engineering and Photography<br />
          Scott W. Moore </p>
      </div><!-- End div "header". -->
      <div id="selectedPhoto">
      <div id="Selection" spry:detailregion = "dsphoto dsphotodata"  >
    <!-- Selected photographs are 400px tall. -->
    <img src="Photo-Email/{name}" width = {width}px height = {height}px align="center" />
      <br />
    Description<br /><br />
    <p> {dsphotodata::email/base}{description} </p>
    </div>
    </div> <!-- End div "selectedPhoto". -->
    </div> <!-- End div "wrapper" -->
    <script type="text/javascript">
    <!--
    var TabbedPanels1 = new Spry.Widget.TabbedPanels("TabbedPanels1");
    var TabbedPanels2 = new Spry.Widget.TabbedPanels("TabbedPanels2");
    //-->
    </script>
    </body>
    </html>

    You do not need multiple data sets. Just the one dataset with all of your photos is sufficient. Then in each tab content you filter the data that you want shown using spry:test="'{subject'}=='roses'" or similar. You will have one spry:region and one spry:detailregion. All very simple
    For master/detail see http://livedocs.adobe.com/en_US/Spry/1.4/help.html?content=WS9F9E1959-1FDF-4fa3-A9AC-20E92 8E07ED1.html
    For spry:test see http://labs.adobe.com/technologies/spry/articles/data_api/apis/attributes.html
    I hope this helps.
    Ben

  • Quality Score in Vendor Rating

    Dear Sir/Mam
    I want to know about quality score which comes in Usage decision,Now in our case when inspection lot is generated we have only one case if accepted the quality score is 100 and when rejected 1,but our requriment is we want different quality score,i maintained different score in selected set,my concern whether this quality score has impact on vendor evaluation score( for quality criteria),how it is calculated please guide.
    Regards
    Kunal
    Edited by: kunal joshi on Mar 26, 2009 6:07 AM

    Dear Kunal
    Quality  score are maintained for quantitative valuation of the quality of inspection lots against a vendor, material , customer
    1) They have to be first maintained in the client level setting
    SPRO > QM> Maintain settings at client level> You need to maintain the highest quality score (100) and lowest quality score (1) system doesnt take 0. also Lower limit for good quality (90)
    2) it is maiinly used in the selected sets for usage decision
    QS51/ 03 catalogs for each UD code you can give a Quality score. So while you are giving UD system picks up this score and update the same for inspection lot , material, vendor, customer as applicable.
    You can give 100 as quality score for clean acceptance, 1 for complete rejection, may be 50 for partial acceptance etc.
    for eg you can maintain your UD selected sets like this Code, Description and UD score
    001     Clean Acceptance     A Accepted (OK)     100
    002     Accepted subject to Rework     R Rejected (not OK)     50
    003     Accepted with deviation     R Rejected (not OK)     70
    004     Accepted after segregation (Partial qty)     R Rejected (not OK)     60
    005     Rejected     R Rejected (not OK)     1
    006     Accepted subject to functional test     A Accepted (OK)     100
    007     UD Changed due to line rejection     R Rejected (not OK)     30
    008     UD changed due to problem at Customer     R Rejected (not OK)     1
    009     Subcontract return - ABB     A Accepted (OK)     100
    010     Auto UD for Skip Lot     A Accepted (OK)     100

  • Binding to an Entire Sequence, How?

    I would like to know if ANY member of a sequence updates.
    For example:
    public class Subject {
        var students: Student[];
    }Then I wanted to do an "all student" calculation, this if any are added or removed work do the calculation again).
    public class AverageStudentScore {
        var subject: Subject;
        var student: bind getAverageStudentScore(subject.students);
        function getAverageStudentScore(s: Students[]):Number {
            .....do calculation here and return.
    }The examples I have found online only show a sequence bound to a sequence and a var bound to an individual (known)

    Hey dgreive.
    Actually, my problem is a little more complex than I had anticipated. I will change the example so that it's a little easier to explain...
    Each 'Person' exists in a sequence of 'people' and has a bound on replace listener hoping to discover friends amounst the 'people' as they are inserted.
    public class SocialScene {
        public var people: Person[];
        init {
            insert Person{name:"Fred", socialScene: this, friends: ["Jane","Pete"]} into people
            insert Person{name:"Jane", socialScene: this, friends: ["Fred"]} into people       
            insert Person{name:"Pete", socialScene: this, friends: ["Fred"]} into people               
    public class Person {
        public var name: String;
        public var friends: String[];
        public var socialScene: SocialScene;
        var people: Person[] = bind socialScene.people on replace {
            //do whatever you do with friends as they appear
    }The real problem is that as a person is a bound listener on the people sequence. When the binding is fired (initially by a new person insert) for some reason the 'replace' bind firing then causes another 'replace' bind firing on sequence, and another bind on replace is fired. This results in more or less and infinite loop and I get a lovely stack overflow. Can a member of a sequence be a bound listener on the sequence it exists within? I guess I don't understand the rules here.

  • SMTP Authorization code for PHP Mail Form

    Can anyone help me in figuring out the correct way to incorporate the SMTP authentication into a form? I am having a lot of trouble in getting my forms to send with this format. My code for my php action page is below. I have my correct information where i included *******. Please let me know what i have wrong.
    CODE STARTS HERE
    <?php
    //new function
    $to = "*******";
    $nameto = "LTL Freight Shop";
    $from = "*******";
    $namefrom = "LTL Freight Shop";
    $subject = "Account Request";
    authSendEmail($from, $namefrom, $to, $nameto, $subject, $message);
    ?>
    <?php
    $recipient  = "*******";
    //$subject = "Account Request";
    $companyname = check_input($_POST['CompanyName'], "Enter your company name");
    $firstname  = check_input($_POST['FirstName'], "Enter your first name");
    $lastname  = check_input($_POST['LastName'], "Enter your last name");
    $phone  = check_input($_POST['PhoneNumber'], "Enter your phone number");
    $fax  = check_input($_POST['FaxNumber']);
    $email  = check_input($_POST['Email'], "Enter your email");
    $address  = check_input($_POST['StreetAddress'], "Enter your address");
    $city  = check_input($_POST['City'], "Enter your city");
    $state  = check_input($_POST['State'], "Enter your state");
    $zipcode  = check_input($_POST['ZipCode'], "Enter your zip code");
    $country  = check_input($_POST['Country'], "Enter your country");
    $yearsinbusiness  = check_input($_POST['YearsinBusiness'], "Enter your years in business");
    $typeofindustry  = check_input($_POST['TypeofIndustry'], "Enter your type of industry");
    $multiplelocations    = check_input($_POST['MultipleLocations']);
    $numberoflocations  = check_input($_POST['LocationsCount']);
    $ltl  = check_input($_POST['ServicesLTL']);
    $ftl  = check_input($_POST['ServicesFTL']);
    $domesticparcel  = check_input($_POST['ServicesDomesticParcel']);
    $intlparcel  = check_input($_POST['ServicesInternationalParcel']);
    $airfreight  = check_input($_POST['ServicesAirFreight']);
    $oceanfreight  = check_input($_POST['ServicesOceanFreight']);
    $other  = check_input($_POST['ServicesOther']);
    $none  = check_input($_POST['ServicesNone']);
    $volume  = check_input($_POST['TypicalVolume'], "Enter your typical volume");
    $carrier  = check_input($_POST['CurrentCarrier'], "Enter your current carrier");
    $class  = check_input($_POST['AverageClass'], "Enter your average class");
    $weight  = check_input($_POST['AverageWeight'], "Enter your average weight");
    $process   = check_input($_POST['Process']);
    $hearabout = check_input($_POST['HearAbout']);
    $comments = check_input($_POST['Comments']);
    if (!preg_match("/([\w\-]+\@[\w\-]+\.[\w\-]+)/", $email))
        show_error("E-mail address not valid");
    $message = "You have received an account request from:
    Company Name: $companyname
    First Name: $firstname
    Last Name: $lastname
    Phone Number: $phone
    Fax Number: $fax
    E-mail: $email
    Street Address: $address
    City: $city
    State: $state
    Zip Code: $zipcode
    Country: $country
    Years in Business: $yearsinbusiness
    Type of Industry: $typeofindustry
    Multiple Locations: $multiplelocations
    Number of Locations: $numberoflocations
    Services they use: $ltl, $ftl, $domesticparcel, $intlparcel, $airfreight, $oceanfreight, $other, $none
    Typical Volume: $volume
    Current Carrier: $carrier
    Average Class: $class
    Average Weight: $weight
    How they currently process: $process
    How they heard about us: $hearabout
    Comments: $comments
    End of message
    //ini_set("SMTP","smtp.emailsrvr.com");
    //ini_set("SMTP_PORT", 25);
    //ini_set("sendmail_from","*******");
    //mail($recipient, $subject, $message);
    function check_input($data, $problem='')
        $data = trim($data);
        $data = stripslashes($data);
        $data = htmlspecialchars($data);
        if ($problem && strlen($data) == 0)
            show_error($problem);
        return $data;
    function authSendEmail($from, $namefrom, $to, $nameto, $subject, $message)
    $smtpServer = "smtp.emailsrvr.com";
    $port = "25";
    $timeout = "30";
    $username = "********";
    $password = "********";
    $localhost = "smtp.emailsrvr.com";
    $newLine = "\r\n";
    $smtpConnect = fsockopen($smtpServer, $port, $errno, $errstr, $timeout);
    $smtpResponse = fgets($smtpConnect, 515);
    if(empty($smtpConnect))
    $output = "Failed to connect: $smtpResponse";
    return $output;
    else
    $logArray['connection'] = "Connected: $smtpResponse";
    fputs($smtpConnect,"AUTH LOGIN" . $newLine);
    $smtpResponse = fgets($smtpConnect, 515);
    $logArray['authrequest'] = "$smtpResponse";
    fputs($smtpConnect, base64_encode($username) . $newLine);
    $smtpResponse = fgets($smtpConnect, 515);
    $logArray['authusername'] = "$smtpResponse";
    fputs($smtpConnect, base64_encode($password) . $newLine);
    $smtpResponse = fgets($smtpConnect, 515);
    $logArray['authpassword'] = "$smtpResponse";
    fputs($smtpConnect, "HELO $localhost" . $newLine);
    $smtpResponse = fgets($smtpConnect, 515);
    $logArray['heloresponse'] = "$smtpResponse";
    fputs($smtpConnect, "MAIL FROM: $from" . $newLine);
    $smtpResponse = fgets($smtpConnect, 515);
    $logArray['mailfromresponse'] = "$smtpResponse";
    fputs($smtpConnect, "RCPT TO: $to" . $newLine);
    $smtpResponse = fgets($smtpConnect, 515);
    $logArray['mailtoresponse'] = "$smtpResponse";
    fputs($smtpConnect, "DATA" . $newLine);
    $smtpResponse = fgets($smtpConnect, 515);
    $logArray['data1response'] = "$smtpResponse";
    $headers = "MIME-Version: 1.0" . $newLine;
    $headers .= "Content-type: text/html; charset=iso-8859-1" . $newLine;
    $headers .= "To: $nameto <$to>" . $newLine;
    $headers .= "From: $namefrom <$from>" . $newLine;
    fputs($smtpConnect, "To: $to\nFrom: $from\nSubject: $subject\n$headers\n\n$message\n.\n");
    $smtpResponse = fgets($smtpConnect, 515);
    $logArray['data2response'] = "$smtpResponse";
    fputs($smtpConnect,"QUIT" . $newLine);
    $smtpResponse = fgets($smtpConnect, 515);
    $logArray['quitresponse'] = "$smtpResponse";
    function show_error($myError)
    ?>
        <html>
        <body>
        <b>Please correct the following error:</b><br />
        <?php echo $myError; ?>
        </body>
        </html>
    <?php
    exit();
    ?>

    I have tried the standard PHP mail function and it doesnt seem to work. Here is my most recent warning or error message.
    Warning: mail() [function.mail]: SMTP server response: 554 5.7.1 <*****>: Sender address rejected: Access denied in D:\inetpub\vhosts\ltlfreightshop.com\httpdocs\requestaccount.php on line 78
    I had the standard mailing set up but it wouldnt ever send and when i set up just the form, it requires the default email client. Am i wrong to assume that i need the SMTP authentication?
    I am not sure about the sockets being enabled. We currently outsource our web hosting and email hosting. I cannot find the phpinfo(), where would this be?
    Thanks,
    Ben

  • SMTP Authentication for PHP Mail

    Can anyone help me in figuring out the correct way to incorporate the SMTP authentication into a form? I am having a lot of trouble in getting my forms to send with this format. My code for my php action page is below. I have my correct information where i included *******. Please let me know what i have wrong.
    CODE STARTS HERE
    <?php
    //new function
    $to = "*******";
    $nameto = "LTL Freight Shop";
    $from = "*******";
    $namefrom = "LTL Freight Shop";
    $subject = "Account Request";
    authSendEmail($from, $namefrom, $to, $nameto, $subject, $message);
    ?>
    <?php
    $recipient  = "*******";
    //$subject = "Account Request";
    $companyname = check_input($_POST['CompanyName'], "Enter your company name");
    $firstname  = check_input($_POST['FirstName'], "Enter your first name");
    $lastname  = check_input($_POST['LastName'], "Enter your last name");
    $phone  = check_input($_POST['PhoneNumber'], "Enter your phone number");
    $fax  = check_input($_POST['FaxNumber']);
    $email  = check_input($_POST['Email'], "Enter your email");
    $address  = check_input($_POST['StreetAddress'], "Enter your address");
    $city  = check_input($_POST['City'], "Enter your city");
    $state  = check_input($_POST['State'], "Enter your state");
    $zipcode  = check_input($_POST['ZipCode'], "Enter your zip code");
    $country  = check_input($_POST['Country'], "Enter your country");
    $yearsinbusiness  = check_input($_POST['YearsinBusiness'], "Enter your years in business");
    $typeofindustry  = check_input($_POST['TypeofIndustry'], "Enter your type of industry");
    $multiplelocations    = check_input($_POST['MultipleLocations']);
    $numberoflocations  = check_input($_POST['LocationsCount']);
    $ltl  = check_input($_POST['ServicesLTL']);
    $ftl  = check_input($_POST['ServicesFTL']);
    $domesticparcel  = check_input($_POST['ServicesDomesticParcel']);
    $intlparcel  = check_input($_POST['ServicesInternationalParcel']);
    $airfreight  = check_input($_POST['ServicesAirFreight']);
    $oceanfreight  = check_input($_POST['ServicesOceanFreight']);
    $other  = check_input($_POST['ServicesOther']);
    $none  = check_input($_POST['ServicesNone']);
    $volume  = check_input($_POST['TypicalVolume'], "Enter your typical volume");
    $carrier  = check_input($_POST['CurrentCarrier'], "Enter your current carrier");
    $class  = check_input($_POST['AverageClass'], "Enter your average class");
    $weight  = check_input($_POST['AverageWeight'], "Enter your average weight");
    $process   = check_input($_POST['Process']);
    $hearabout = check_input($_POST['HearAbout']);
    $comments = check_input($_POST['Comments']);
    if (!preg_match("/([\w\-]+\@[\w\-]+\.[\w\-]+)/", $email))
        show_error("E-mail address not valid");
    $message = "You have received an account request from:
    Company Name: $companyname
    First Name: $firstname
    Last Name: $lastname
    Phone Number: $phone
    Fax Number: $fax
    E-mail: $email
    Street Address: $address
    City: $city
    State: $state
    Zip Code: $zipcode
    Country: $country
    Years in Business: $yearsinbusiness
    Type of Industry: $typeofindustry
    Multiple Locations: $multiplelocations
    Number of Locations: $numberoflocations
    Services they use: $ltl, $ftl, $domesticparcel, $intlparcel, $airfreight, $oceanfreight, $other, $none
    Typical Volume: $volume
    Current Carrier: $carrier
    Average Class: $class
    Average Weight: $weight
    How they currently process: $process
    How they heard about us: $hearabout
    Comments: $comments
    End of message
    //ini_set("SMTP","smtp.emailsrvr.com");
    //ini_set("SMTP_PORT", 25);
    //ini_set("sendmail_from","*******");
    //mail($recipient, $subject, $message);
    function check_input($data, $problem='')
        $data = trim($data);
        $data = stripslashes($data);
        $data = htmlspecialchars($data);
        if ($problem && strlen($data) == 0)
            show_error($problem);
        return $data;
    function authSendEmail($from, $namefrom, $to, $nameto, $subject, $message)
    $smtpServer = "smtp.emailsrvr.com";
    $port = "25";
    $timeout = "30";
    $username = "********";
    $password = "********";
    $localhost = "smtp.emailsrvr.com";
    $newLine = "\r\n";
    $smtpConnect = fsockopen($smtpServer, $port, $errno, $errstr, $timeout);
    $smtpResponse = fgets($smtpConnect, 515);
    if(empty($smtpConnect))
    $output = "Failed to connect: $smtpResponse";
    return $output;
    else
    $logArray['connection'] = "Connected: $smtpResponse";
    fputs($smtpConnect,"AUTH LOGIN" . $newLine);
    $smtpResponse = fgets($smtpConnect, 515);
    $logArray['authrequest'] = "$smtpResponse";
    fputs($smtpConnect, base64_encode($username) . $newLine);
    $smtpResponse = fgets($smtpConnect, 515);
    $logArray['authusername'] = "$smtpResponse";
    fputs($smtpConnect, base64_encode($password) . $newLine);
    $smtpResponse = fgets($smtpConnect, 515);
    $logArray['authpassword'] = "$smtpResponse";
    fputs($smtpConnect, "HELO $localhost" . $newLine);
    $smtpResponse = fgets($smtpConnect, 515);
    $logArray['heloresponse'] = "$smtpResponse";
    fputs($smtpConnect, "MAIL FROM: $from" . $newLine);
    $smtpResponse = fgets($smtpConnect, 515);
    $logArray['mailfromresponse'] = "$smtpResponse";
    fputs($smtpConnect, "RCPT TO: $to" . $newLine);
    $smtpResponse = fgets($smtpConnect, 515);
    $logArray['mailtoresponse'] = "$smtpResponse";
    fputs($smtpConnect, "DATA" . $newLine);
    $smtpResponse = fgets($smtpConnect, 515);
    $logArray['data1response'] = "$smtpResponse";
    $headers = "MIME-Version: 1.0" . $newLine;
    $headers .= "Content-type: text/html; charset=iso-8859-1" . $newLine;
    $headers .= "To: $nameto <$to>" . $newLine;
    $headers .= "From: $namefrom <$from>" . $newLine;
    fputs($smtpConnect, "To: $to\nFrom: $from\nSubject: $subject\n$headers\n\n$message\n.\n");
    $smtpResponse = fgets($smtpConnect, 515);
    $logArray['data2response'] = "$smtpResponse";
    fputs($smtpConnect,"QUIT" . $newLine);
    $smtpResponse = fgets($smtpConnect, 515);
    $logArray['quitresponse'] = "$smtpResponse";
    function show_error($myError)
    ?>
        <html>
        <body>
        <b>Please correct the following error:</b><br />
        <?php echo $myError; ?>
        </body>
        </html>
    <?php
    exit();
    ?>

    I have the same problem - user has Outlook 2010 on Exchange 2007. Mail goes directly into the deleted items folder. After browsing around the net I found 2 different site with the same potential fix. It seems that when migrating a user from Exch 2003 to
    2007 (which we did) some of the configs get set incorrectly. The weird thing is we migrated over 2 years ago, and some others are experiencing the same after a long period after the migration. The fix that was suggested is:
    Go to your Exch server, open up Exchange Management Shell and type the following:
    get-mailboxcalendarsettings "domain/ou/user" | fl 
    set-mailboxcalendarsettings "doman/ou/user" -automateprocessing: Autoupdate 
    My user already had Autoupdate set, but this seems to have fixed it for me...

Maybe you are looking for

  • How to get all input columns of script components checked by default to use the same in code ?

    Hi , I am working on BIML Script component, where I am taking data from OLEDB Source. In Script Component I want all the input columns to be checked by default as input. I have no idea how to proceed for the same. Below is my code :- <Biml xmlns="htt

  • Fraudulent insurance plan

    I went into verizon in August 2012 since the mi-fi was not working . I has originally gotten it in Jan 2011.  I was told I needed to update.  I decided to update my phone at the same time. The rep stated that they now had an insurance plan that you p

  • Ripping smaller size tunes for iPod

    When I rip CDs, I pick lossless. At that codec, I can get only so many tunes on my 8gig nano. Is there a way I can take a selection of songs/albums and rip them to a smaller file size without harming or destroying my higher-quality rips? thanks for a

  • I want to copy edited files to a second computer, do I need to export the catalog or can I just copy

    I find that I edit files on my laptop but I want the files, with their edits to reside on my desktop computer also. I had been exporting the folder as a Catalog, but can't think of shy I can't just copy the folder with both the RAW and XMP files and

  • Can't compile with any layers hidden on timeline

    Can someone explain what could possibly be going on? Running CS4 I have a .fla that was compiling fine yesterday.  Today I made some slight additions and it wouldn't compile, giving errors saying that various things were undefined.  I was starting to