Re: Query entity
Skip and Mridul Thanks very much for your help. My mistake is I have field name="id" as my primary key. But field which I need to query is not a primary key. So If I need to query field from another table, I need to query by primary key only. I set the field which I need to query as primary key. Then I can solve this problem. Nattanicha Mridul Pathak wrote: You have not defined the prim-key fields and also you have not defined the foreign key relationships if any of the field is coming from some other entity. On Mon, Apr 21, 2008 at 10:45 AM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: One thing that jumps out at me is that I see no primary key. Perhaps adding and maybe if asset_itemid is not always unique -Original Message- From: Nattanicha Rittammanart [mailto:[EMAIL PROTECTED] Sent: Sunday, April 20, 2008 1:38 PM To: user@ofbiz.apache.org Subject: Query entity Hi all, I have a problem to ask you. I have table like this: I want to show it by using form, I do like this: itemid"> number"> But asset_itemid is a field which link from another table. If I show table as above, it will show asset_itemid. What I want is, I need it to show asset_item_name. So, I do like this: .. .. But it caused error like this org.ofbiz.widget.screen.ScreenRenderException: Error rendering screen [component://ams/widget/common/CommonScreens.xml#GlobalDecorator]: java.lang.IllegalArgumentException: Error getting value from the database for display of field [asset_itemid] on form [ShowDepreTables]: org.ofbiz.entity.GenericModelException: [GenericDelegator.findOne] Passed primary key is not a valid primary key: [GenericEntity:AssetItems][asset_itemid,08000200010002(java.lang.String)] (Error getting value from the database for display of field [asset_itemid] on form [ShowDepreTables]: org.ofbiz.entity.GenericModelException: [GenericDelegator.findOne] Passed primary key is not a valid primary key: [GenericEntity:AssetItems][asset_itemid,08000200010002(java.lang.String)]) How can I do to link asset_item_name from another table to show in table which has asset_itemid?? Thank in advances, Nattanicha No virus found in this incoming message. Checked by AVG. Version: 7.5.524 / Virus Database: 269.23.0/1381 - Release Date: 4/16/2008 9:34 AM No virus found in this outgoing message. Checked by AVG. Version: 7.5.524 / Virus Database: 269.23.0/1381 - Release Date: 4/16/2008 9:34 AM
Re: Query entity
You have not defined the prim-key fields and also you have not defined the foreign key relationships if any of the field is coming from some other entity. On Mon, Apr 21, 2008 at 10:45 AM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > One thing that jumps out at me is that I see no primary key. > > Perhaps adding > > > > and maybe if asset_itemid is not always unique > > > > -Original Message- > From: Nattanicha Rittammanart [mailto:[EMAIL PROTECTED] > Sent: Sunday, April 20, 2008 1:38 PM > To: user@ofbiz.apache.org > Subject: Query entity > > > > > Hi all, > > I have a problem to ask you. > > I have table like this: > > > > > entity-name="DepreciationTrans" title="Keeps depreication record from > > depreciation table which created in each period"> > > > > > > > > > > > > > > I want to show it by using form, I do like this: > > > > > paginate-target="ShowDepreTable"> > > > > > field-name="calculate_date"/> > > > > > > > > > > > > > > > > But asset_itemid is a field which link from another table. If I show > > table as above, it will show asset_itemid. What I want is, I need it > > to show asset_item_name. So, I do like this: > > > > .. > > > > > description="${asset_item_desc}" > > key-field-name="asset_itemid"> > > > > .. > > > > But it caused error like this > > > > org.ofbiz.widget.screen.ScreenRenderException: Error rendering screen > > [component://ams/widget/common/CommonScreens.xml#GlobalDecorator]: > > java.lang.IllegalArgumentException: Error getting value from the > > database for display of field [asset_itemid] on form > > [ShowDepreTables]: org.ofbiz.entity.GenericModelException: > > [GenericDelegator.findOne] Passed primary key is not a valid primary > > key: > > > [GenericEntity:AssetItems][asset_itemid,08000200010002(java.lang.String)] > > (Error getting value from the database for display of field > > [asset_itemid] on form [ShowDepreTables]: > > org.ofbiz.entity.GenericModelException: [GenericDelegator.findOne] > > Passed primary key is not a valid primary key: > > > [GenericEntity:AssetItems][asset_itemid,08000200010002(java.lang.String)]) > > > > > > How can I do to link asset_item_name from another table to show in > > table which has asset_itemid?? > > > > Thank in advances, > > Nattanicha > > > > > No virus found in this incoming message. > Checked by AVG. > Version: 7.5.524 / Virus Database: 269.23.0/1381 - Release Date: 4/16/2008 > 9:34 AM > > No virus found in this outgoing message. > Checked by AVG. > Version: 7.5.524 / Virus Database: 269.23.0/1381 - Release Date: 4/16/2008 > 9:34 AM > > -- Thanks & Regards Mridul Pathak Hotwax Media http://www.hotwaxmedia.com [EMAIL PROTECTED]
RE: Query entity
One thing that jumps out at me is that I see no primary key. Perhaps adding and maybe if asset_itemid is not always unique -Original Message- From: Nattanicha Rittammanart [mailto:[EMAIL PROTECTED] Sent: Sunday, April 20, 2008 1:38 PM To: user@ofbiz.apache.org Subject: Query entity > Hi all, > I have a problem to ask you. > I have table like this: > > entity-name="DepreciationTrans" title="Keeps depreication record from > depreciation table which created in each period"> > > > > > > > I want to show it by using form, I do like this: > > paginate-target="ShowDepreTable"> > > field-name="calculate_date"/> > > > > > > > > But asset_itemid is a field which link from another table. If I show > table as above, it will show asset_itemid. What I want is, I need it > to show asset_item_name. So, I do like this: > > .. > > description="${asset_item_desc}" > key-field-name="asset_itemid"> > > .. > > But it caused error like this > > org.ofbiz.widget.screen.ScreenRenderException: Error rendering screen > [component://ams/widget/common/CommonScreens.xml#GlobalDecorator]: > java.lang.IllegalArgumentException: Error getting value from the > database for display of field [asset_itemid] on form > [ShowDepreTables]: org.ofbiz.entity.GenericModelException: > [GenericDelegator.findOne] Passed primary key is not a valid primary > key: > [GenericEntity:AssetItems][asset_itemid,08000200010002(java.lang.String)] > (Error getting value from the database for display of field > [asset_itemid] on form [ShowDepreTables]: > org.ofbiz.entity.GenericModelException: [GenericDelegator.findOne] > Passed primary key is not a valid primary key: > [GenericEntity:AssetItems][asset_itemid,08000200010002(java.lang.String)]) > > > How can I do to link asset_item_name from another table to show in > table which has asset_itemid?? > > Thank in advances, > Nattanicha > No virus found in this incoming message. Checked by AVG. Version: 7.5.524 / Virus Database: 269.23.0/1381 - Release Date: 4/16/2008 9:34 AM No virus found in this outgoing message. Checked by AVG. Version: 7.5.524 / Virus Database: 269.23.0/1381 - Release Date: 4/16/2008 9:34 AM
Query entity
Hi all, I have a problem to ask you. I have table like this: entity-name="DepreciationTrans" title="Keeps depreication record from depreciation table which created in each period"> I want to show it by using form, I do like this: paginate-target="ShowDepreTable"> field-name="calculate_date"/> But asset_itemid is a field which link from another table. If I show table as above, it will show asset_itemid. What I want is, I need it to show asset_item_name. So, I do like this: .. description="${asset_item_desc}" key-field-name="asset_itemid"> .. But it caused error like this org.ofbiz.widget.screen.ScreenRenderException: Error rendering screen [component://ams/widget/common/CommonScreens.xml#GlobalDecorator]: java.lang.IllegalArgumentException: Error getting value from the database for display of field [asset_itemid] on form [ShowDepreTables]: org.ofbiz.entity.GenericModelException: [GenericDelegator.findOne] Passed primary key is not a valid primary key: [GenericEntity:AssetItems][asset_itemid,08000200010002(java.lang.String)] (Error getting value from the database for display of field [asset_itemid] on form [ShowDepreTables]: org.ofbiz.entity.GenericModelException: [GenericDelegator.findOne] Passed primary key is not a valid primary key: [GenericEntity:AssetItems][asset_itemid,08000200010002(java.lang.String)]) How can I do to link asset_item_name from another table to show in table which has asset_itemid?? Thank in advances, Nattanicha
Query entity
Hi all, I have a problem to ask you. I have table like this: title="Keeps depreication record from depreciation table which created in each period"> I want to show it by using form, I do like this: paginate-target="ShowDepreTable"> field-name="calculate_date"/> But asset_itemid is a field which link from another table. If I show table as above, it will show asset_itemid. What I want is, I need it to show asset_item_name. So, I do like this: .. description="${asset_item_desc}" key-field-name="asset_itemid"> .. But it caused error like this org.ofbiz.widget.screen.ScreenRenderException: Error rendering screen [component://ams/widget/common/CommonScreens.xml#GlobalDecorator]: java.lang.IllegalArgumentException: Error getting value from the database for display of field [asset_itemid] on form [ShowDepreTables]: org.ofbiz.entity.GenericModelException: [GenericDelegator.findOne] Passed primary key is not a valid primary key: [GenericEntity:AssetItems][asset_itemid,08000200010002(java.lang.String)] (Error getting value from the database for display of field [asset_itemid] on form [ShowDepreTables]: org.ofbiz.entity.GenericModelException: [GenericDelegator.findOne] Passed primary key is not a valid primary key: [GenericEntity:AssetItems][asset_itemid,08000200010002(java.lang.String)]) How can I do to link asset_item_name from another table to show in table which has asset_itemid?? Thank in advances, Nattanicha