how to add comments in a page

how to add comments in a page

  

hi,

please explain the meaning of this error and i wanted to save the comment in the input box when the save action is performed  after save button is clicked but I am getting the above error.The comment is not getting save in the entity.

I have two entities Comment which having (comment and PassengerId) and Passenger entity .

I want to save the Comment and aftr clicking the particular passenger that comment should be present there.

1st page:

 2nd page:

3rd page:


4th page:


Please someone help to resolve this issue.


Thanks

Ankita Jaggi wrote:

hi,

please explain the meaning of this error and i wanted to save the comment in the input box when the save action is performed  after save button is clicked but I am getting the above error.The comment is not getting save in the entity.

I have two entities Comment which having (comment and PassengerId) and Passenger entity .

I want to save the Comment and aftr clicking the particular passenger that comment should be present there.

1st page:

 2nd page:

3rd page:


4th page:


Please someone help to resolve this issue.


Thanks

You have to assign the PassengerId to the PassengerComment record being created :)


José Lopes wrote:

Ankita Jaggi wrote:


You have to assign the PassengerId to the PassengerComment record being created :)


hi José,

I have already assigned the PassengerId but still getting the error.


You CAN'T save a comment BEFORE creating a new Passenger.
And if it is a NEW passenger, even after you create it, the value in PassengerId (the input parameter) will still be zero.

So, you have to guarantee that no comments can be added to the passenger before it is created, and guarantee that the input parameter PassengerId is updated with the ID returned by the CreateOrUpdate action that saves a new record in Passenger.

Cheers.

Eduardo Jauch wrote:

You CAN'T save a comment BEFORE creating a new Passenger.
And if it is a NEW passenger, even after you create it, the value in PassengerId (the input parameter) will still be zero.

So, you have to guarantee that no comments can be added to the passenger before it is created, and guarantee that the input parameter PassengerId is updated with the ID returned by the CreateOrUpdate action that saves a new record in Passenger.

Cheers.


Can you please ellaborate a little more and how to update the PassengerId


Ankita Jaggi wrote:

Eduardo Jauch wrote:

You CAN'T save a comment BEFORE creating a new Passenger.
And if it is a NEW passenger, even after you create it, the value in PassengerId (the input parameter) will still be zero.

So, you have to guarantee that no comments can be added to the passenger before it is created, and guarantee that the input parameter PassengerId is updated with the ID returned by the CreateOrUpdate action that saves a new record in Passenger.

Cheers.


Can you please ellaborate a little more and how to update the PassengerId


What Eduardo is saying, is that you need to have a Passenger already created, so that you can have a PassengerId to create a comment!

The most likely problem, Eduardo is keen to point, is that the value of PassengerId (screen input) is not updated after creating the Passenger.. This means, you'll be assigning a null Id to the PassengerComment you're trying to create!
Are you experienced with debugger? Could really help you here :) 

Add a breakpoint there (click right button), start debugging, in tab locals watch PassengerId value :) 

Good luck


Hi Ankita,

Can you check PassengerId you are using to insert comments, is exists in the Passenger Entity. i believe passengerId is nullidentifier(), what value you are passing in querystring "PassengerId". 


Thanks,

Balu

José Lopes wrote:

Ankita Jaggi wrote:

Eduardo Jauch wrote:

You CAN'T save a comment BEFORE creating a new Passenger.
And if it is a NEW passenger, even after you create it, the value in PassengerId (the input parameter) will still be zero.

So, you have to guarantee that no comments can be added to the passenger before it is created, and guarantee that the input parameter PassengerId is updated with the ID returned by the CreateOrUpdate action that saves a new record in Passenger.

Cheers.


Can you please ellaborate a little more and how to update the PassengerId


What Eduardo is saying, is that you need to have a Passenger already created, so that you can have a PassengerId to create a comment!

The most likely problem, Eduardo is keen to point, is that the value of PassengerId (screen input) is not updated after creating the Passenger.. This means, you'll be assigning a null Id to the PassengerComment you're trying to create!
Are you experienced with debugger? Could really help you here :) 

Add a breakpoint there (click right button), start debugging, in tab locals watch PassengerId value :) 

Good luck



Yes passengerId is comming null then what should I do?