the following URL is called on our application to add a new subscription record.
http://example.com/Subscriptions/create?defaultValues={"login_id":1234}
Part of the creationView code is the following:
subscription.creationView()
.title('<h4>Subscriptions <i class="fa fa-angle-right" aria-hidden="true"></i>Create: Subscription</h4>')
.fields([
nga.field('login_id', 'reference')
.targetEntity(admin.getEntity('LoginData'))
.targetField(nga.field('username'))
.attributes({ placeholder: 'Select Account' })
.validation({ required: true })
.singleApiCall(function (login_id) {
return { 'login_id[]': login_id };
})
.label('Username'),
The API call to the LoginData entity is bringing back all the records; what we want is to pass to the API call the login_id value coming from the initial URL.
Something like: http://example.com/api/LoginData?login_id=1234
How do we do that ?