I have a custom entity as a related of Territory entity. In a new create form of that custom entity, I want to retrieve it's parent (territory) id. In edit mode I can get through url but for create mode it doesn't exist as a query string.
I want to retrieve that territory id using javascript client api.
Need your valuable suggestion.
Do you think I can get the lokup field without save the form?
Hi,
Refer to this for getting and setting lookup values trough JavaScript:
www.magnetismsolutions.com/.../how-to-get-and-set-a-lookup-field-using-javascript-in-dynamics-365
If you need to get the id of the current new record, then you First need saving the record.
Try something like this:
Xrm.Page.data.save().then(function(){
var id = Xrm.Page.data.entity.getId();
}, function(){
//handle error here
});
Daivat Vartak (v-9d...
225
Super User 2025 Season 1
Muhammad Shahzad Sh...
106
Most Valuable Professional
Eugen Podkorytov
102