I have two regions one form and one interactive grid like a master detail. how i can make the interactive grid mandatory ,the user can't submit page ,he/she need add at least one row in interactive grid
❇️ OrclQA.Com is a question and answer forum for programmers.
❇️ Here anyone can ask questions and anyone can answer to help others.
❇️ It hardly takes a minute to sign up and it is 100% FREE.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
OrclQA.Com is a question and answer forum for programmers.
Here anyone can ask questions and anyone can answer to help others.
It hardly takes a minute to sign up and it is 100% FREE.
Vinish Kapoor
You can write a process as follows:
Click on the Process tab and create a process below the IG automatic row process and add the PL/SQL code something as below:
Then in the Error Message section of the process, add the following error text:
Please add at least one record in the detail section.
Now at the time of saving, if there are no records in the grid, the above error will occur, and it will not allow saving.
Try it and let me know if any issues.
VARSHA
Thanks for the reply
Here which is IGKeyField ?
Vinish Kapoor
By which you are relating master and detail tables. For example, PK field BILL_NO in the form and FK field BILL_NO in the IG.
afzal
step 1-- assign static id for your interactivegrid like - emp
step 2- create a "before page submit" dynamic action
action- execute javascript code
like--
var model = apex.region('emp').widget().interactiveGrid('getViews','grid').model;
var total_rec= model.getTotalRecords();
if(total_rec == 0){
apex.message.clearErrors();
// Now show new errors
apex.message.showErrors([
{
type: "error",
location: [ "page" ],
message: "atleast one record should be add at ig",
unsafe: false
}
]);
// to stop page submission
apex.da.cancel();
}
afzal
sorry above answer has one step is missing, follow this one
step 1 -- donot use interactive grid inbuild save button to save the data,
to save data create a seprate save button and that save button will submit the page
step 2-- assign static id for your interactivegrid like - emp
step 3- create a "before page submit" dynamic action
action- execute javascript code
like--
var model = apex.region('emp').widget().interactiveGrid('getViews','grid').model;
var total_rec= model.getTotalRecords();
if(total_rec == 0){
apex.message.clearErrors();
// Now show new errors
apex.message.showErrors([
{
type: "error",
location: [ "page" ],
message: "atleast one record should be add at ig",
unsafe: false
}
]);
// to stop page submission
apex.da.cancel();
}
VARSHA
Thanks for the reply
VARSHA
Its working...
Thank you Vinish