Forum Discussion

R_'s avatar
R_
Creator I
9 years ago

How to set property having data type foreign as keyed name of itemtype

hi i want to set property as keyed name of item type but property data type is foreign i create item A having property "bal_part" which data type is item having data source Part item create another property "bal_partname" which data type is foreign having data source Part item and foreign property "name" of bal_part i set keyed name of item A as 1 for "item_no" of property  and 2 for "bal_partname"  property of Item A but in keyed name it only shows item_no, not showing name of Part Item

8 Replies

  • I'm not 100% clear on your explanation, but here is something to consider. If itemtype ONE has a property named bal_part that is an item reference to the PART itemtype and itemtype ONE also has a foreign property named bal_partname that is a foreign property showing the name property of the PART itemtype, then you cannot directly update the name property of the related part from an instance of the ONE itemtype. You'll have to write a method on add/update of itemtype ONE that updates the name property of the PART in the item reference of the ONE itemtype item. You can control what properties are used to build the keyed_name. If you want the keyed_name of the part to be "item_number name" then the easiest thing to do is to set the Keyed Name Order value of the part's item_number property to 10 and the Keyed Name Order value of the part's name property to 20. The keyed name will be the concatenation of the item_number and name properties with a space between them.
  • R_'s avatar
    R_
    Creator I
    hi dlindinger i do same as you said but it not showing name property of Part item in keyed name it only shows item_no of ItemType A i set keyed name order 10 for item_no and keyed name order 20 for bal_partname which is foreign property (name ) of Part Itemtype
  • Did you make the keyed name change before or after the creation of the part item? If the keyed name change was after the creation of the part item, then you'll have to run the rebuild keys action in the admin menu. What happens if you create a brand new part item with an item number and name and then use it as an item reference?
  • R_'s avatar
    R_
    Creator I
    Actually i have one dispatch(bal_dispatch) itemtype , in that itemtype i have three property bal_dispatch_no,  data type-sequence ,  keyed name order-1 bal_part,   data type-Item,   data source-Part itemtype bal_partname,   data type- foreign, data source- bal_part,  keyed name order-2   i have another PDIR itemtype in that item type i have one property bal_dispatch,  data type-item,  data source -bal_dispatch when i create new PDIR item and pick dispatch from Dispatch No field on form as i set dispatch no and part name as keyed name , on PDIR form it must show dispatch no and part name but it only show dispatch no    
  • <p style="text-align: left;">I've never tried it, but I doubt that you can use a foreign property as a keyed name. I think you'll need a method that copies dispatch partname to a property on dispatch and use that property as keyed name order 2. The property can be hidden from the grid and not exposed on the form. Your method will need to keep it in sync if the part is swapped on the dispatch or the part is renamed.</p>
  • R_'s avatar
    R_
    Creator I
    hi dlindinger thanks for your reply
  • Hello guys I am totally new to aras. i want a method  to edit foreign property in form field. please help me regards teju
  • Stuti, Per the Aras training configuration book (I have students guide version 11) on page 132 it says "foreign properties are always displayed as read only to the end user in a from and their values cannot be changed"  I believe the field/property that foreign key is referencing will change foreign key value once the "parent" property changes.  Make sense?