2

I see that the draft record in datasource is deprecated. I read the release notes but am having trouble with one bit of code. Tried to convert this:

widget.datasource.draft.Email = (newValue) ? newValue.PrimaryEmail : null;

to this:

widget.datasource.item.Email = (newValue) ? newValue.PrimaryEmail : null;

But am getting this error: Cannot set property 'Email' of null

Any suggestions on what is wrong? The widget is being passed from the onValueChange action.

Thanks

4

2 回答 2

3

You can change the widget's datasource to the create datasource in the Property Editor on the right side. Click the datasource binding and select "[Datasource Name] (create)". (screenshot)

An alternative option if you want to keep your widget bound to the normal datasource would be to set it programmatically:

widget.datasource.modes.create.item.Email = (newValue) ? newValue.PrimaryEmail : null;

Here is further documentation for accessing the create datasource through scripting.

于 2017-01-26T16:54:31.637 回答
2

我相信您需要将小部件的数据源设置为“创建”数据源,然后再转换为“项目”。

于 2017-01-25T19:53:56.563 回答