synchronizeAssociatedModel() |
It triggers a request for the specified associated model to the backend and synchronizes the data according to the current active business object of the current model.
Syntax
Script |
modelID.synchronizeAssociatedModel(associatedModel, unconditional) |
Parameters
Parameter |
Description |
---|---|
associatedModel |
Object that denotes the model to be synchronized. |
unconditional |
This is an optional parameter. It takes boolean value that denotes whether the synchronization should happen unconditionally, irrespective of the active data of the current model. When set to true, request will be activated even if the associated model already points to the data in the current model. The default value is false. |
Return Value
No value is returned.
Remarks
This method can be used when:
- Associated model is not automatic and the developer decides when to synchronize to the current model and fire accordingly.
- Developer wishes to retrieve the data i.e. data is updated by some other user, and developer wishes to update the status of data.
- Developer knows the name of the associated model, and wishes to synchronize the data of only the specified model. If the model is not known, then the developer can use synchronizeAssociatedModels() to update all associated models.
Sample Code
This sample code demonstrates how the method can be used.
//This method call synchronizes the Orders Model associated to Employees model unconditionally, //thus retrieving the data for the Orders Model irrespective of // the current data it is pointing to. function employeeid_Change(eventObject) { EmployeesModel.synchronizeAssociatedModel(OrdersModel,true); }