web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id : QwWh5zAtB57fBSKkKZrFUI
Power Apps - Building Power Apps
Unanswered

New record in side pane

Like (0) ShareShare
ReportReport
Posted on 5 Feb 2024 13:30:14 by 26

Hi all, 

 

I have created a javascript that does the following:

1. Create a new record and bind it to my table with employee.

2. Open a side pane with this newly created record.

 

 

 

 

var EmployeeID = Xrm.Page.data.entity.getId().replace("{", "").replace("}", "");

var record = {};
record["dvlp_Employee@odata.bind"] = "/dvlp_hr_employeedatabases(" + EmployeeID + ")"; // Lookup

async function createRecordAndOpenPane() {
 try {
 var result = await Xrm.WebApi.createRecord("dvlp_hr_changehistory", record);
 var newId = result.id;
 console.log(newId);

 var pane = await Xrm.App.sidePanes.createPane({
 title: "Make changes",
 imageSrc: "",
 paneId: "ChangeHistory",
 canClose: true
 });
 debugger
 await pane.navigate({
 pageType: "entityrecord",
 entityName: "dvlp_hr_changehistory",
 entityID: newId
 });
 
 
 } catch (error) {
 console.log(error.message);
 }
};

 

 

 

The issue I'm facing is - the console shows me in console.log(newId) the new ID but it doesn't get passed to the entityID field. It just creates the record and then open a side pane form with a new record to create. Has anyone found any workarounds for this? 

Categories:
I have the same question (0)

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Chiara Carbone – Community Spotlight

We are honored to recognize Chiara Carbone as our Community Spotlight for November…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 686 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 433 Super User 2025 Season 2

#3
wolenberg_ Profile Picture

wolenberg_ 266 Moderator

Last 30 days Overall leaderboard