Create a New Record button in the widget with Instance Options (tables and fields dynamically)
This content was last updated in 2024. It may still be useful, but could contain outdated information. Please confirm its accuracy before relying on it.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-12-2024 12:52 PM
- I have created a button to create new record, it is taking table dynamically from instance options, but not taking the fields using instance options.
Client Script:
$scope.newRecord = function() {
// Open modal with instance option fields
var modalInstance = spModal.open({
title: 'New Record',
widget: 'widget-form',
widgetInput: {
table: $scope.data.table,
fieldList: $scope.data.fieldList, // Pass instance option fields to the modal
view: $scope.data.view,
sys_id: '-1' // Indicates a new record
}
});
modalInstance.result.then(function() {
alert('Modal dismissed');
});
};
Can anyone help me with this.
Thanks in advance.
0 REPLIES 0