dalewill - Thursday, September 5, 2013 10:15 AM:
Everyone:
My problem is linking a new method I wrote calling Federated data with the form.
I wrote a method to pull data out of our MRP system. To be honest I thought this would be the hard part. We are running CA-Maxcim, circa late 1980's, in a Virtual Alpha environment with a 3rd part software that allows us access to the data tables. We are able to write C# applications against this data all the time. One MS-SQL linked server later, that part is up and running. I can click Actions->Run Server Method and the proper data is returned:
<Item type="a_CN" typeId="4301258ECE5F4A759530A5E57833C8E1" id="BCD7C2E9DCEE42CC886FC034FBD40E80"> <y_maxcim_source_code>G</y_maxcim_source_code> </Item>
For the ItemType, I created a property called 'y_maxcim_source_code' with the datatype 'Federated'. On the form itself, I added this field and set a form event to call my method during the 'onFormPopulate' event.
I don't receive any errors but the field will never populate. I pretty sure the error is either the return dataset isn't formatted correctly or I'm not calling the method on the form correctly.
Sincerely,
Dale
Eric Domke - Thursday, September 26, 2013 8:27 AM:
The two typical scenarios for federation are:
- Federated column: Write a server method that runs onAfterGet. This server method will loop through the one or more items in the context item (me/this) and calculate the value of the federated column for each item and set it on that item (item.setProperty()).
- Federated item type (typically relationship of a real item type): Write a server method that runs onGet for the item type. This server method uses the search criteria passed in as the context item to determine the items to return and returns them.
It sounds like your scenario matches #1 above. Therefore, try calling your server method onAfterGet instead.