2012年9月18日 星期二

JPA 捉到舊資料的問題

如果你有一直捉到舊資料的問題,請使用
有用 BEAN Transaction ,請加上 begin(); commit();


Employee e = em.find(Employee.class, id);
try {
  em.refresh(e);
} catch(EntityNotFoundException ex){
  e = null;
}


參考文件: http://weblogs.java.net/blog/guruwons/archive/2006/09/understanding_t.html

2012年9月10日 星期一

Advanced Introduction to JavaScript


asp.net MVC3 入門初學的好網站


感謝無私的分享

http://www.dotblogs.com.tw/wadehuang36/archive/2012/07/05/aspnetmvc-startfromscratch.aspx




Html.BeginForm 和 Ajax.BeginForm 的用法
Html.BeginForm() vs Ajax.BeginForm() in MVC3

JQuery AJAX API
http://api.jquery.com/load/

html.partial 和 html.action的用法
Razor: Html.RenderPartial vs Html.Partial, Html.RenderAction vs Html.Action – what one should use?

What's the difference between “return View()” and “return PartialView()”

ASP.NET MVC 3 APP_Code 已不使用

目前 MVC 專案不需要這個目錄,如果你手動建立這個目錄並產生一個類別後作 compile  ,好像不會有任何作用,一般的作法好像要建立 Class Library,然後再 MVC Project 作  reference的動作。 而 APP_Code好像也可以拿來放 Helper的程式,不過我是新手還沒用到。


參考
http://stackoverflow.com/questions/10620947/asp-net-mvc-3-app-code-folder
http://stackoverflow.com/questions/4866462/having-razor-helper-in-app-code-folder-using-asp-net-mvc-3
http://blog.miniasp.com/post/2010/02/22/ASPNET-MVC-Developer-Note-Part-15-Running-under-WebSite-Project.aspx
http://blog.sanc.idv.tw/2011/08/aspnet-mvc-razorhelper.html

MVC3 是否有 isPostBack 的機制

在 MVC的架構中在 Controller內要寫一個 Get 和一個 Post的 actionName 就可以作到類似 ispostback的判斷


       //Get
        public ActionResult Notify()
        {


       [HttpPost]
        public ActionResult Notify(SAL_NOTIFY model){


參考:http://stackoverflow.com/questions/8275384/mvc3-page-ispostback-like-functionality

基礎提供者在 Open 失敗

在使用 ODAC Oracle Providers for ASP.NET 4 11.2.0.3.0如果出現 基礎提供者在 Open 失敗的錯誤時,請先檢查 tnsnames.ora 看看連線字串是否有加入

2012年9月6日 星期四

FND Log

Create SR時,常常 support 人員會要求你執行操作時有問題的 FND Log
但平常預設是不開啟的
所以設定如下


FND: Debug Log Enabled -> Yes
FND: Debug Log Level -> Statement
FND: Debug Log Module -> %

記得不要設在 Site or Application level,要不然會造成系統效能的下降


















至 sqlplus 執行 sql


select USER_ID from fnd_user where user_name= 'userName'

select max(LOG_SEQUENCE) FROM FND_LOG_MESSAGES

上面那一段 sql 執行後,再去執行有問題的操作,讓錯誤重現
之後再執行下面的 sql

select max(LOG_SEQUENCE) FROM FND_LOG_MESSAGES (note down req.in step 6)

SELECT *
FROM FND_LOG_MESSAGES LOG
WHERE user_id = USER_ID

AND LOG_SEQUENCE between 18534640 and 18534676

ORDER BY LOG.LOG_SEQUENCE;


如何檢查 系統是否有安裝指定的 patch



select * from ad_applied_patches where patch_name='12572045';

12572045 為 patch number

flash Online MMORPG game

http://www.flashrealtime.com/herokon-online/

IIS6 設定 for MVC3

今天寫了第一隻 MVC3 的程式,用 VS2010開發的,還是屬於不熟的狀態

不過想放至測試機時出現


Directory Listing Denied


This Virtual Directory does not allow contents to be listed.

找了文件
萬用字元加上
C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll
並把 確認該檔是否存在 選項取消即可



















參考文件
http://haacked.com/archive/2008/11/26/asp.net-mvc-on-iis-6-walkthrough.aspx
http://www.asp.net/mvc/mvc3
http://blog.masonchu.com/2012/03/iis-6-aspnet-mvc-directory-listing.html



但是asp.net MVC3 installer裝在第二台時出現了
SetupResources.dll missing from 1028 directory 的問題,還在決解中.................
找到解決方式了,因為 server裝了 patch之後沒重開,後來重新開机後就可以安裝了

2012年9月5日 星期三

Oracle EBS SR Created

Problem Summary SR Number Product Severity Contact Status Last Updated
Error 95314 occurred by running Create Accounting 3-6012754541 Oracle Payables Severity 22-Significant catton chang Resolved with Solution 29-Aug-2012 15:34 (Wednesday)
Functional Amount of AP Invoice Line become editable 3-5717828981 Oracle Payables Severity 22-Significant catton chang Resolved with Workaround 19-Aug-2012 00:04 (12 days ago)
How to disable sending Remittance Advice mail after payment process request done 3-5989679461 Oracle Payables 3-Standard catton chang Resolved with Solution 17-Aug-2012 06:54 (14 days ago)
PPR Status shows Formatting while the corresponding Payment Instruction Status shows Formatted. 3-5994411961 Oracle Payables Severity 22-Significant catton chang Resolved with Solution 05-Aug-2012 02:54 (26 days ago)
Cannot view po from invoice distribution 3-5807888491 Oracle Payables Severity 22-Significant catton chang Review Update 26-Jul-2012 16:33 (1+ month ago)
Unable to validate invoice 3-5832158661 Oracle Payables Severity 22-Significant catton chang Customer Abandoned 05-Jul-2012 22:21 (1+ month ago)
Error 95314 where Create Accounting 3-5869845561 Oracle Payables 3-Standard catton chang Customer Abandoned 03-Jul-2012 19:38 (1+ month ago)
APP-SQLAP-97731 error occured when calculating tax or validate invoice 3-5858193021 Oracle Payables Severity 22-Significant catton chang Customer Abandoned 02-Jul-2012 21:11 (1+ month ago)
AP Invoice Schedule Payment Holds shows 1 but no any schedule payment hold. 3-5858564071 Oracle Payables Severity 22-Significant catton chang Resolved with Solution 30-Jun-2012 05:24 (2+ months ago)
FRM-40735: POST-QUERY trigger raised unhandled exception ORA-01403 occured. 3-5835566031 Oracle Payables Severity 22-Significant catton chang Resolved with Solution 25-Jun-2012 21:02 (2+ months ago)
Can not unapply an prepayment successfully. 3-5807888521 Oracle Payables Severity 22-Significant catton chang Resolved with Solution 24-Jun-2012 00:57 (2+ months ago)
AP Data Validation Report got Results for Signature # 26: Script: canc_tax_lines_sel.sql Bug: 923653 3-5835296091 Oracle Payables Severity 22-Significant catton chang Resolved with Solution 23-Jun-2012 18:01 (2+ months ago)
Invoice Payment Method is empty, not default value, when creating new invoice. 3-5794685891 Oracle Payables Severity 22-Significant catton chang Resolved with Solution 23-Jun-2012 09:35 (2+ months ago)
Could not update the Payables Information for the modification 3-5716744251 Oracle Payables Severity 22-Significant catton chang Resolved with Solution 19-Jun-2012 02:45 (2+ months ago)
Can I apply Patch 13563472:R12.AP.B on my instance 3-5707027031 Oracle Payables Severity 22-Significant catton chang No fault found 12-Jun-2012 23:05 (2+ months ago)
amount of tax line become 0 and can not calculate tax correctlly 3-5513666111 Oracle Payables Severity 22-Significant catton chang No fault found 21-May-2012 20:21 (3+ months ago)
Invoice item line has Tax Classfication Code but tax line amount is 0 3-5514509021 Oracle Payables Severity 22-Significant catton chang Resolved with Solution 20-May-2012 01:07 (3+ months ago)
EXCHANGE_RATE of ap_checks_all is null for foreign currency payment 3-5587271091 Oracle Payables Severity 22-Significant catton chang Resolved with Solution 26-Apr-2012 02:50 (4+ months ago)
Error occured when Update supplier Accounting 3-5515224251 Oracle Payables Severity 22-Significant catton chang Resolved with Solution 16-Apr-2012 22:52 (4+ months ago)
ORA-06512: at "APPS.IBY_EXTRACTGEN_PVT", line 380 3-5502192061 Oracle Payables Severity 22-Significant catton chang Resolved with Solution 08-Apr-2012 09:31 (4+ months ago)
Unable to create account for an invoice 3-5141731591 Oracle Payables Severity 22-Significant catton chang Resolved with Solution 06-Apr-2012 22:09 (4+ months ago)
Document Number of Journal is empty 3-5502262751 Oracle General Ledger Severity 22-Significant catton chang Resolved with Solution 04-Apr-2012 19:51 (4+ months ago)
SHRD0019: GLLEZL - process exiting after successful execution. 3-5456436671 Oracle General Ledger Severity 22-Significant catton chang Resolved with Workaround 30-Mar-2012 09:06 (5+ months ago)
Create Accouting Accounting Program Completes In Error: "An Internal Error Has Occurred In The Prog 3-4985296921 Oracle Payables Severity 22-Significant catton chang Resolved with Solution 22-Mar-2012 08:35 (5+ months ago)
FA new Cost genterated in same Invoice Novice after undo accounting. 3-5264769261 Oracle Assets Severity 22-Significant catton chang Resolved with Solution 21-Mar-2012 09:56 (5+ months ago)
Invoice amount paid is not correct after payment void 3-5266019951 Oracle Payables Severity 22-Significant catton chang Resolved with Solution 02-Mar-2012 18:11 (6+ months ago)
Other Exceptions in Period Close Exception Report 3-5264886501 Oracle Payables Severity 22-Significant catton chang Resolved with Solution 29-Feb-2012 07:18 (6+ months ago)
Running Report got an error Replicate Seed Data ORA-20000: ORA-00001: unique constraint (AR.RA_BATCH 3-5318831201 Oracle Receivables Severity 22-Significant catton chang Resolved with Solution 24-Feb-2012 08:38 (6+ months ago)
GL Accounted DR, CR is not correct for foreign currency invoice 3-5266019881 Oracle Payables Severity 22-Significant catton chang Resolved with Solution 13-Feb-2012 21:22 (6+ months ago)
Credit reduces payment amount below zero 3-5034774201 Oracle Payables Severity 22-Significant catton chang Customer Abandoned 09-Feb-2012 12:29 (6+ months ago)
create accounting error 95314 occured 3-5140979191 Oracle Payables Severity 22-Significant catton chang Resolved with Solution 02-Feb-2012 09:17 (7+ months ago)
Cannot void a check succefully 3-5066330871 Oracle Payables Severity 22-Significant catton chang Resolved with Solution 23-Jan-2012 02:32 (7+ months ago)
Create Accounting failure 3-5171931271 Oracle Payables Severity 22-Significant catton chang Resolved with Solution 22-Jan-2012 10:52 (7+ months ago)
Amount Paid is not correct after doing unpay prepayment 3-4985116971 Oracle Payables Severity 22-Significant catton chang Resolved with Solution 16-Jan-2012 08:52 (7+ months ago)
payment amount is not equal to sum of invoice amount 3-5129264311 Oracle Payables Severity 22-Significant catton chang Resolved with Solution 16-Jan-2012 07:02 (7+ months ago)
Build Payment Status Error 3-5104066931 Oracle Payables Severity 22-Significant catton chang Customer Abandoned 06-Jan-2012 06:20 (7+ months ago)
APP-SQLAP-97634 error occured when revalidate after cancle invoice 3-5016265531 Oracle Payables Severity 22-Significant catton chang Resolved with Solution 16-Dec-2011 18:28 (8+ months ago)
Build Payments Error SQLERRM: ORA-01403: no data found 3-4971689871 Oracle Payables Severity 22-Significant catton chang Resolved with Solution 14-Dec-2011 21:41 (8+ months ago)
Create Accounting With Errors Number 95937 3-4996062891 Oracle Payables Severity 22-Significant catton chang Resolved with Solution 14-Dec-2011 13:13 (8+ months ago)
AP Invoice Hold occured after SR 3-4825946131 data fixed. 3-4950451771 Oracle Payables Severity 22-Significant catton chang Resolved with Solution 13-Dec-2011 05:12 (8+ months ago)
overpaymnet message occured after regenerate new manual invoice by discard ap invoice 3-4825946131 Oracle Payables Severity 22-Significant catton chang Resolved with Solution 23-Nov-2011 13:42 (9+ months ago)
Journal Total of Journals - Voucher does not show decimals for foreign currency 3-4811059551 Oracle General Ledger Severity 22-Significant catton chang Not Entitled 16-Nov-2011 14:47 (9+ months ago)
APP-SQLAP-10000: Frozen Tax Distribution Delete by ETax. this would cause orphan events. 3-4777569921 Oracle Payables Severity 22-Significant catton chang Resolved with Solution 06-Nov-2011 12:34 (9+ months ago)
Accounting Program Status is Warning 3-4772904611 Oracle Payables Severity 22-Significant catton chang No fault found 02-Nov-2011 10:38 (10+ months ago)
Supplier View Accountgin Error 3-4760148931 Oracle Payables Severity 22-Significant catton chang Resolved with Workaround 26-Oct-2011 17:46 (10+ months ago)
Accounting Error : Unequal DR/CR 3-4178232681 Oracle Payables Severity 22-Significant catton chang Resolved with Solution 31-Aug-2011 16:21 (1+ year ago)
P: Payment Void Issue : without generating minus record 3-3955555861 Oracle Payables Severity 22-Significant catton chang Resolved with Solution 24-Jul-2011 05:54 (1+ year ago)
P: Error when trying to pay the Invoice(Spin-Off for SR# 3-3955555861) 3-4003386611 Oracle Payables Severity 22-Significant catton chang Resolved with Solution 24-Jul-2011 05:54 (1+ year ago)
is there only one email address on Supplier Site mail address for R12 ? 3-3701885951 Oracle Purchasing 3-Standard catton chang Resolved with Workaround 03-Jun-2011 15:04 (1+ year ago)

不應帶稅的 AP Invoice 處理方式

可能因為 supplier 設定上的錯誤,造成原本沒有稅的 AP Invoice 產生了一筆 tax 的 line,處理的方式為兩種

1. 在 AP Invoice Line將 Tax Classification Code 清空後再執行 calculate tax,這樣 tax line的金額就會變成 0

2.將整張 AP Invoice cancel,再請倉管人員作 return to supplier後,請採購人員將 PO打開,執行 Actions - Manage Tax ,將 Tax Classification Code 刪除或清空後,再請倉管人員作收料後,重新拋轉至 AP的 Invoice就會沒有 tax line了

Cancel PO Line後為什麼整張 PO會不見

這是因為 PO 的狀態還在 Incomplete 還沒被 Approve過,而這一張 PO 只有一筆 PO Line,所以 cancel po line的話,整張 PO就會消失。


PO, PR 如果狀態還在  Incomplete 的話,是可以按 delete 作刪除,而 AP Invoice 也一樣,如果還沒作 validate 的話,也是一樣可以刪除。

2012年9月4日 星期二

使用 AJAX updatepanel 後原本的按鈕無法使用

這是一位漂亮女同事分享的~

原本程式內有些按鈕正常作用,會開啟另一個 browser,但是加了updatepanel 後,button 點了之後都沒有反應,後來找到的解決方式如下。

動態產生 asp.net 元件加入


http://stackoverflow.com/questions/2864398/javascript-code-inside-updatepanel
http://www.ajaxtutorials.com/ajax-tutorials/using-javascript-and-updatepanels-in-asp-net-3-5/

Hadoop in Taiwan 2012


http://www.hadoopintaiwan.com/

Oracle ODAC 11.2 Release 4 support for Entity Framework and LINQ



ODAC 下載網址
http://www.oracle.com/technetwork/database/windows/downloads/index-101290.html

下載之後請安裝它,安裝完之後請檢查  oracle register內 NLS_LANG是否正確,因為原本你可能有裝 oracle client,加裝這個之後可能 NLS_LANG會被更改,造成原本的程式在捉取資料時可能出現問題

















裝完之後,請參考一個很棒的網站,關於 .net MVC, LINQ, Entity Framework 的東東都可以來這邊找找看哦~~

http://kevintsengtw.blogspot.tw/2011/11/oracle-data-access-components-odac-for.html
http://kevintsengtw.blogspot.tw/2012/01/odac-112-release-4-112030-includes.html
http://kevintsengtw.blogspot.tw/2012/01/odac-for-entity-framework.html

fetch data from .Net entity framework , Java JPA

我個人覺得 LINQ比較讚

.net entity framework 使用 LINQ 技術


using (MIDSModel.MIDSEntities md = new MIDSModel.MIDSEntities())
                {
                    string query = (from c in md.WT_MIDS_OTH_DOC_TYPE
                                    where 1 == 1 && c.TYPE_ID == id1
                                    select c.TYPE_NAME).FirstOrDefault()
                                ;
               
                    ((Label)e.Row.FindControl("tNameL1")).Text = query;
                }


Java JPA


@PersistenceContext
 private EntityManager em;



List list1 = em.createQuery("select object(o) from WtSalNotify as o WHERE o.status = 'I' ORDER BY  o.notifyId ").getResultList();


PSY (ft. HYUNA) 오빤 딱 내 스타일

程式寫多了~~~  放鬆一下吧 (美國有主持人叫他 condom style )


LabVIEW Days 2012


9/18 高雄。9/19 台南。9/20 台中。9/25 新竹。9/26 桃園。9/27 台北

http://sine.ni.com/nievents/app/overview/p/eventId/2212/site/tw/country/tw/lang/zht/scope/country/location/tw

JPA EntityManager merge, persist 的用法

persist ():用來新增一筆資料
merge (): 用來新增或修改一筆資料


Entity1 e = new Entity1();

// scenario 1
//交易開始
em
.persist(e);
e
.setField1(Value); 
// 交易結束後, Field1 會自動更新至資料庫

// scenario 2
// 交易開始
e
= new MyEntity1();
em
.merge(e);
e
.setField1(anotherValue); 
// 交易結束後,Field1 不會更新至資料庫,除非你再作一次 merge


// scenario 3
// 交易開始
e
= new Entity1();
Entity1 e2 = em.merge(e);
e2
.setField1(anotherValue); 
// 交易結束後,Field1 會自動更新至資料庫,但是指 e2 不是 e




參考文件
http://caterpillar.onlyfun.net/Gossip/EJB3Gossip/EntityManager.html
http://stackoverflow.com/questions/1069992/jpa-entitymanager-why-use-persist-over-merge
http://blog.csdn.net/javavenus/article/details/6289616

Java Persistence Transaction

關於於使用 JPA  transaction 的設定

http://en.wikibooks.org/wiki/Java_Persistence/Transactions

2012年9月2日 星期日

glassfish 上使用 javaMail

在原廠的文件上在使用 JNDI 找時,會用 initialContext.lookup("java:comp/env/mail/mailSource");
java:comp/env 開頭來找 mail source,但這樣用時會出現錯誤,找不到這個 mail source,
而如果用  initialContext.lookup("mail/mailSource"); 取消 java:comp/env 字串時,捉出來的 object 會是
MailConfiguration 而非 Session,所以網友有分享以下的作法,可以參考看看


                    ic = new InitialContext();
 Object object = ic.lookup(snName);

         if (object instanceof MailConfiguration)
        {
           MailConfiguration configuration = (MailConfiguration) object;
           session1 = Session.getInstance(configuration.getMailProperties());
        }
        else if (object instanceof Session)
        {
           session1 = (Session) object;
       }

關於 po_line_locations_all QUANTITY 開頭的欄位


po_line_locations_all  儲存的是 PO Shipment的資料。

QUANTITY:屬於該 shipment的訂購量


QUANTITY_RECEIVED:為倉庫人員作暫收的數量


QUANTITY_ACCEPTED:為倉庫人員(驗收)入庫的數量

QUANTITY_REJECTED:為倉庫人員作 return to supplier的數量

QUANTITY_BILLED :有轉成 AP Invoice 的數量

QUANTITY_CANCELLED :採購人員 cancel 的數量