I would dump the function names and make them more palatable. Then, indent properly and you'll see your error. Your code, properly indented...
Code:
var email_check = {dialog.Object}.getValue('Email_P');
if (email_check == ''){
alert("Customer must have an email to add them to your team, edit the referral an add a valid email");
}else{
function call_crudAction() {
{dialog.object}.ajaxCallback('','','system:CRUDaction','','_xbfunction=CRUDAction_533968d9a516412d90d7947a734df97d');
}
function call_refreshList() {
{dialog.object}.refreshListData('VR_REFERRALS',{mode: 'incremental'});
A5.executeThisThenThat(call_crudAction,call_refreshList);
}
}
You see that the executeThisThenThat is inside the function.
Corrected code...
Code:
var email_check = {dialog.Object}.getValue('Email_P');
if (email_check == ''){
alert("Customer must have an email to add them to your team, edit the referral an add a valid email");
}else{
function call_crudAction() {
{dialog.object}.ajaxCallback('','','system:CRUDaction','','_xbfunction=CRUDAction_533968d9a516412d90d7947a734df97d');
}
function call_refreshList() {
{dialog.object}.refreshListData('VR_REFERRALS',{mode: 'incremental'});
}
A5.executeThisThenThat(call_crudAction,call_refreshList);
}
Bookmarks