How to provide angular ng-templates when cloning OOB form widget in a scoped app in Kingston?

tantony
Mega Guru

In my scoped app I need to display a form widget with initial two field values populated, on a spModal window.This widget is  embedded in another widget. I thought I could clone the OOB form widget and pass the field values as options and provide that as as widgetInput parameter of spModal. But in the cloned widget, form is not displayed. It says 'Record not found'.I see that in the cloned widget's related link the angular ng-templates are missing. I can copy the original ng-templates from OOB form-widget giviing them  new names and add to related list  for the cloned form widget. But I could not find any reference in client or server script for those angular ng-templates. Where is the angular ng-templates referenced in a OOB form-widget?

 

If anybody has  successfully cloned OOB form widget is a scoped app,  please help.

 

6 REPLIES 6

thank you ... if you can read below and offer any insight i would be much obliged ...

When you say the additional data is to be saved to table then I am assuming this is defined as a field in the table. >> yes

Use the input to get any data that was sent from the client controller, for your case the form.And hence available in the server script as 'input._fields'. when i reference input._fields i get undefined cannot ref null object --

here is what i am doing:

I have a page with 3 widgets:

w1: data table form instance definition (using incident)

w2: widget-form

w3: a custom widget-button that gets other data

on the page, i click on an incident in w1 and it displays in w2.

i enter data in w2 and click save >> data is saved to record.

in w2 server script >> there is statement if (input)

if i put a display there gs.info(input.short_description) i get undefined

further down in the script there is statement

var rec = $sp.getRecord(data.table, data.sys_id)

a display here, gs.info(rec.getDisplayValue('short_description'));

shows both the before and after values.

If i can understand how this works i might be able to accomplish my ultimate goal, which is to click w3, get some data, add it to incident, and save.

 

 

Instead of 'gs.info(input.short_description)' , try 'gs.info(input._fields["short_description"])'.

If it is printing correctly then the following should work:

input._fields["my_field"] = 'my data i need entered';