HI Team
When User Selects Experienced Then Employment Detail Wizard should be mandatory. for example,
if the candidate forgot to enter Employment Detail then prompt has to show for example please fill the employment details after filling the details only it has to save.
for which process I have to follow.
hoping for a positive reply.
Like
Dear Manikanta,
The algorithm for such task can be the following:
- Override the save or close button logic. For example, if it is save button, you override the save() method on your page.
- Add an ESQ code to the Employment Detail object with the filter by current record Id. If ESQ returns results, it means there is at least one record on the detail, which is connected to this record. In this case call parent method realization for save method (this.callParent(arguments)):
- If ESQ does not return any results, you show modal window with information for the user to add a records to the detail. (this.showInformationDialog("Text")). No parent realization is called, record does not get saved.
Hope you find this helpful.
Regards,
Anastasia
Anastasia Botezat,
Tnqs Anastasia Botezat I am tried in these ways but it was working on when the candidate open employment detail wizard its showing dialogue box.
code:
methods: {
save: function()
{
// var companyName = this.get("UsrCompanyName");
var msg = this.employeementValidator();
if (msg.invalidMessage !== "") {
this.showInformationDialog(msg.invalidMessage);
return;
}
this.callParent(arguments);
},
employeementValidator: function() {
// Variable for storing a validation error message.
var invalidMessage = "";
// Variable for stroing the number check result.
var isValid = true;
// Variable for the phone number.
var number = this.get("Usrcoompanyname");
// Determining the correctness of the number format using a regular expression.
isValid = (Ext.isEmpty(number) ||
new RegExp(/^[0-9]{0,2}(\.[0-9]{1,2})?$/).test(number));
// If the format of the number is incorrect, then an error message is filled in.
if (!isValid) {
invalidMessage = this.get("Resources.Strings.InvalidPhoneFormat1");
}
object.
return {
invalidMessage: invalidMessage
};
}
},
I need
Please tell me how to write the logic for the candidate has to select at least one record if he not selected then it has to show a Dialog.
hoping for a positive reply.
manikanta,
As I have mentioned in my first comment, you need to run a query to the database to check if there is a record in detail object, which is connected to the current record. In bpm'online system we are using Entity Schema Query (ESQ) to run such requests.
You called your validation method employeementValidator, there you can add an ESQ to the Employment Detail object with the filter by current record Id. If ESQ returns results, it means there is at least one record on the detail, which is connected to this record. If ESQ does not return any results, you show modal window with information for the user to add a records to the detail. (this.showInformationDialog("Text")). No parent realization is called, record does not get saved.
Please see following articles on how to write ESQ and work with its response:
https://academy.bpmonline.com/documents/technic-sdk/7-13/entityschemaquery-filters-handling
Regards,
Anastasia