Skip to main content

Hi all,


I have a SmartObject that is associated with another to serve as a lookup:


Eg. [Company] associated to [Region] where there are many Companies in a region. Only the Region.ID field is stored on [Company]


I have a form based off a different SmartObject where I want to display a drop-down list of companies but I want the Display of the drop-down to display in the following way:


{CompanyName} - {RegionName}


Where CompanyName is a field of [Company] and RegionName is a field of [Region].


I can't seem to get this to work. If I configure a drop-down list to display the list of companies I can configure that the display displays the CompanyName field, but only the RegionID is available to add it to the display items.


Is there a way to get this to work or is this not possible even with smartforms 1.0.2?


Thanks,

Hi Johan,


 


I could get this to work, but I had to create an additional composite SmartObject for the Company. In short:



  1. Create the 2 SmartObjects you need as per normal
  2. Create a 3rd, I called mine CompanyRegion. Remove all methods and create a GetList. Add the GetList Service Method for Companies and create properties from that.
  3. Add the GetList Service Method for Regions to the GetList method. Link the Region PK to the FK in the Company SmO
  4. Create a new property called RegionName. Map this to the Name of the Region Service Method.
  5. Create a Method Link between RegionID in Company Service Method to the PK in the Region Service Method.
  6. Reference this SmO in the DropDown list. Since you have the Region name as a field, it will show up. 

Hi DC,


Thank you for the suggestion.


I added an extra method on the Company smartobject which called the GetList from Company and then the GetList from Region joining them on the RegionID key. I created an extra property on the Company smartobject called RegionName and mapped it to the Region GetList's property.


On my drop-down I now call the GetListDropDown which will bring back the correct properties to build up the Display item.


Regards,


Reply