This documentation supports the 20.08 version of BMC Helix Platform. 
To view an earlier version, select 20.02 from the Product version menu.

Examples of AngularJS services

The following code snippets are examples of using AngularJS services. You can use these services to create a new record instance, get record instance data, update record instance data, get configuration data, and get user data.

Get data page from record

var queryParams = {  
        propertySelection: "179,7", // ids of fields to get  
        queryExpression: "'7'!= 3" //not rejected  
    };  
var foo = rxRecordInstanceDataPageResource.withName('<package>:<recordname>');  
foo.get(1000,0,queryParams).then()  

Get user data

rxCurrentUser.get() 

Get configuration data

AdminSettingResource.getComponentSettingData('test').then(function(data) {  
     $scope.mode=data.values[0].settingValue;  
});

Create a new record instance

var objectRecord = rxRecordInstanceResource.withName('de.materna.tf.TestTF:Object');  
var createRecord = function () {  
  objectRecord.getNew().then(function (record) {  
  var fields = record.fieldInstances;  
  fields[536870917].value = 0;  
  fields[8].value = 'test description';  
  return objectRecord.post(record);  
    });  
}; 

Get a record

var objectRecord = rxRecordInstanceResource.withName('de.materna.tf.TestTF:Object');  
objectRecord.get('IDxzy').then(  
        function(record) {  
            console.log(record.getValue(8));  
        }  
);  

Update a record

var objectRecord = rxRecordInstanceResource.withName('de.materna.tf.TestTF:Object');  
objectRecord.get('IDxzy').then(  
        function(record) {  
            record.setValue(8, 'new description');  
            record.put();  
        }  
); 

Related topics

Creating custom view components

Creating custom view components for record editor

Enabling browser logging in a Digital Service application

Enabling and downloading logs from BMC Helix Innovation Studio

Naming conventions for angular objects

Was this page helpful? Yes No Submitting... Thank you

Comments