This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

DEVELOPERS FORUM - Concatenation of a property with a string is not giving exact result.

Harsha - Thursday, August 30, 2012 9:22 AM:

Hi,

  I have concatenated a property of my ItemType with a string, but the result is not that what I need.

The code I used is:

Dim item_num As String  = Me.getProperty("item_num")
Dim new_id As String =  XXX & "-" & item_num
Me.setProperty("new_id",new_id) 

 item_num is the property of my ItemType whose DataType is 'Item', where I am selecting a related Item  and concatenating it with a string 'XXX' on OnBeforeAdd event. But after saving, the result I' m getting is  'XXX-187E....' .

 Instead of getting the name of the 'Item' , I ' m getting the system generated 'id'  of the 'Item' after concatenation.

Here I should get the New_Id as 'XXX-Q1-2012'  , but I' m getting 'XXX-187E7..'.  

How do I  get the name of the Item instead of 'id' .Need help.

Thank You

Harsha

 



aponceot - Thursday, August 30, 2012 9:56 AM:

Hi,

In the case of an 'Item' Property, the value of this property is the ID of the related item.

The "name" of the item is in fact called the keyed_name.

You can get the keyed name of a property by calling : Me.getPropertyAttribute("item_num","keyed_name")

 

 



Harsha - Friday, August 31, 2012 12:59 AM:

Hi Anthony,

   Thanks for your help. That' s worked, now I' m getting the name of 'Item' .Thank you once again.