cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Need to share some code when posting a question or reply? Make sure to use the "Insert code sample" menu option. Learn more! X

How to give a popup message sort of if the data edited in grid has been saved once before.

shraddha_21
5-Regular Member

How to give a popup message sort of if the data edited in grid has been saved once before.

Hi Community Team,

 

I have a grid in which lot number has to be entered and saved. But how to give a message that this lot number already exist  if again someone is saving the lot number unknowingly.

 

 

Thanks,

Shraddha

3 REPLIES 3
DanZ
15-Moonstone
(To:shraddha_21)

The simplest solution would be, that your service (that is adding the data) returns a string with a message; like "Sucess", "ID already exist" etc. This result can be bound to a "Status Message" function in the mashup that will be triggered, when the "Service Invoke Completed" event is triggered from you "Data-Add" service. You have to make sure that your service never throws an exception, otherwise the "Service Invoke Completed" event is not triggered.

 

The other way is to use the "Notifcations" (see attached screenshot) of a service. With "[server-message]" you can return the error-message of the exception object, which you can modify if you want to.

msedge_YmX99ip63h.png

shraddha_21
5-Regular Member
(To:DanZ)

Hi @DanZ ,

 

If I use the "notifications", how do I validate it with the data that has been already saved. Like how the check will be done if it's new entry or it's already there.

 

 

DanZ
15-Moonstone
(To:shraddha_21)

That has to be done on your service that will add the data. For example:

 

 

const addData = () => {
  // Magic happens here
};

const isNewDataValid = () => {
  // Your validation logic
};

if (isNewDataValid() === false) throw new Error('Validation failed!');
addData();

 

 

When using the failed notification on your service with [server-message] it should open a small popup with your error message in the mashup if the service throws an exception.

Announcements


Top Tags