Wednesday, September 24, 2014

How-To Add Secondary Collection (SyteLine) To a Form Grid

How-To Add Secondary Collection (SyteLine) To a Form Grid

To add the secondary collection we need to create a Custom Load Method (CLM) that will retrieve the data that we want displayed in the grid.
First we create and test the stored procedure that will become the CLM..

We then update the IDO (Intelligent Data Object) (In this case we decided not to affect the base IDO, because of release updates, so we created a copy of it for our update).


Within the IDO we add the CLM so it is accessible in the Methods.


 
Now we create the un-bound properties that will be used on the Form Grid for the fields returned from the CLM.
 


At this point we design the form and add the secondary collection(s) entering the Custom Load Method Property to the secondary collection(s) and include the Method Parameters Property with the values to pass to the CLM.
The return from the CLM will be the unbound fields we added in the IDO Properties.
Now we add the grid to the form and bind the unbound Properties to the grid items.


Note the Data Source binding to a specific object.

Once we have all this done we need to establish an event that will refresh the secondary collection so the data in the grid will refresh when another record is selected.

In this case we choose StdObjectSelectedCurrentCompleted for the refresh of the secondary collection.
We also set the "Only When Current Collection Is" value in the Event Handler Parms Window to the primary collection object.


Now that all this is done the Primary form should open with the details in the secondary collections changing as each record is selected.


Notes: We found that if we jus refreshed the secondary collections without the "Only When Current Collection Is" that the form would take a very long time to load (we never allowed it to complete because it was taking so long).

When building the form and IDO make sure that you "Unload All Global Objects" (ctrl+U) on a regular basis.

If you see something not working or working strangely close the application completely and start it over. This sometimes helps because a completely new session is established.




Tuesday, September 16, 2014

How-To Add Application Message (SyteLine)

To add a primary key invalid message to SyteLine Messaging you first create the error message on a form for a duplicate key. (Example)


Then you will see the primary key name message that created the error. This key will be used in the Maintain Application Message Objects form.

Open the "Maintain Application Message Objects" form and add a new record. Enter the Primary key from the error message that was created from your duplicate key entry on your new form. (Example)



Enter the text message that you want returned to the user in the Message Text.

Enter the Message Number ( the key here is to make the message unique to your organization). After you have entered the Message Num Right Click on the Message Num dropdown and select Add.

In The "Maintain Application Messages" Form Enter the Message Number you created and the Message Text that you want the user to see when the error occurs. (Example)


Save the "Maintain Application Messages" record  and close the "Maintain Application Messages" form.

Back at the "Maintain Application Messages Objects " Form.

Enter a message description.
Select the Message Type from the dropdown (17 Constraint Message).
Select the Object Type (in this case it is from a Table).
Leave the Message Severity as 16.
Save the record.
(Example)


Add  Sequence Number 1 to the Build Messages group and save the record again.

At this point the error message should appear when the Primary key constraint occurs on your entry form..