Feature #2331
Validasi pada menu Master Data
Description
Dear Azid,
Tolong bikin validasi untuk Material Code yang ada di Material Master Data. Jadi tidak boleh ada Material Code yang sama. (Dibikin validasi kode unik agar apabila user mengisikan Material Code yang sama tidak bisa)
Tolong bikin validasi untuk Vendor Code yang ada di Vendor Master Data. Jadi tidak boleh ada Vendor Code yang sama. (Dibikin validasi kode unik agar apabila user mengisikan Vendor Code yang sama tidak bisa)
Tolong bikin validasi untuk Customer Code yang ada di Customer Master Data. Jadi tidak boleh ada Customer Code yang sama. (Dibikin validasi kode unik agar apabila user mengisikan Customer Code yang sama tidak bisa)
Menu Path: Logistic & Service > Master Data > Material Master Data
port: https://remote.minovais.com:61138/
Terima Kasih,
Subtasks
Related issues
Updated by Anonymous about 1 year ago
- Subject changed from Validasi External ID pada menu Material Master Data to Validasi Material Code pada menu Material Master Data
- Description updated (diff)
- Status changed from New to Assigned
Updated by haykal haykal about 1 year ago
- Subject changed from Validasi Material Code pada menu Material Master Data to Validasi pada menu Master Data
- Description updated (diff)
Updated by M Azid Wahyudi about 1 year ago
- Status changed from Assigned to QA Test
- Assignee changed from M Azid Wahyudi to haykal haykal
dear haykal , udah bisa di test ya
package :
var keyField = getParam("KeyID");
var table = rec.TableName;
var data = Ext.encode(frmForm.getValues());
var token = MinovaUtil.SESSIONS.Token; console.log(action);
//var action = me.action; // edit by Tri nwh 20231003
var meaction = me.action; console.log(meaction);
//if(action==undefined){action="0"}; // edit by Tri nwh 20231003
if(meaction!=undefined){action=meaction};
if (table == 'PMDMAT0001'){
var CheckMaterialID = frmForm.getForm().findField("MaterialID").getValue();
var inUpdate = '0';
if (CheckMaterialID == ''){
inUpdate = '1'
}
if (inUpdate == '1'){
var ExternalID = frmForm.getForm().findField("ExternalID").getValue();
Ext.Ajax.request({
async: false,
method: 'POST',
url: '/UserControl/GetStore',
params: {
tableName: 'PMDMAT0001',
param: 'ExternalID[=]' + ExternalID
},
success: function (response) {
var results = Ext.decode(response.responseText);
dt = results.data0;
if (dt != undefined) {
MinovaMessage('Not Null', 'FILOVAL001', '', 'E');
}
else
{
var params = {
apiController: 'api/Devt',
methodName: 'SaveTableMaster',
parameter: 'tableName=' + table + '&data=' + data + '&action=' + action + '&token=' + token
};
MinovaAjaxPost('/ApiService/Api/', params, function (xhr) {
var result = Ext.decode(xhr.responseText);
var r = Ext.decode(result.data);
if (r.success) {
headerDisplay.mask("Loading...");
var idNo = r.data;
frmForm.getForm().findField(keyField).setValue(idNo);
frmDisplay.getForm().setValues(frmForm.getValues());
headerDisplay.getForm().setValues(frmForm.getValues());
frmDisplay.setHidden(false);
frmForm.setHidden(true);
MinovaMessage('Not Null', '000006', '', 'S');
headerDisplay.unmask();
} else {
MinovaMessage(' Not Null ', ' 000005 ', r.message.text, 'E');
}
});
}
}
});
} else{
var params = {
apiController: 'api/Devt',
methodName: 'SaveTableMaster',
parameter: 'tableName=' + table + '&data=' + data + '&action=' + action + '&token=' + token
};
MinovaAjaxPost('/ApiService/Api/', params, function (xhr) {
var result = Ext.decode(xhr.responseText);
var r = Ext.decode(result.data);
if (r.success) {
headerDisplay.mask("Loading...");
var idNo = r.data;
frmForm.getForm().findField(keyField).setValue(idNo);
frmDisplay.getForm().setValues(frmForm.getValues());
headerDisplay.getForm().setValues(frmForm.getValues());
frmDisplay.setHidden(false);
frmForm.setHidden(true);
MinovaMessage('Not Null', '000006', '', 'S');
headerDisplay.unmask();
} else {
MinovaMessage(' Not Null ', ' 000005 ', r.message.text, 'E');
}
});
}
} else if (table == 'PMDVEN0001'){
var CheckVendorID = frmForm.getForm().findField("VendorID").getValue();
var inUpdate = '0';
if (CheckVendorID '' || CheckVendorID '0'){
inUpdate = '1'
}
if (inUpdate == '1'){
var ExternalIDVen = frmForm.getForm().findField("ExternalID").getValue();
Ext.Ajax.request({
async: false,
method: 'POST',
url: '/UserControl/GetStore',
params: {
tableName: 'PMDVEN0001',
param: 'ExternalID[=]' + ExternalIDVen
},
success: function (response) {
var results = Ext.decode(response.responseText);
dt = results.data[0];
if (dt != undefined) {
MinovaMessage('Not Null', 'FILOVAL002', '', 'E');
}
else
{
var params = {
apiController: 'api/Devt',
methodName: 'SaveTableMaster',
parameter: 'tableName=' + table + '&data=' + data + '&action=' + action + '&token=' + token
};
MinovaAjaxPost('/ApiService/Api/', params, function (xhr) {
var result = Ext.decode(xhr.responseText);
var r = Ext.decode(result.data);
if (r.success) {
headerDisplay.mask("Loading...");
var idNo = r.data;
frmForm.getForm().findField(keyField).setValue(idNo);
frmDisplay.getForm().setValues(frmForm.getValues());
headerDisplay.getForm().setValues(frmForm.getValues());
frmDisplay.setHidden(false);
frmForm.setHidden(true);
MinovaMessage('Not Null', '000006', '', 'S');
headerDisplay.unmask();
} else {
MinovaMessage(' Not Null ', ' 000005 ', r.message.text, 'E');
}
});
}
}
});
} else{
var params = {
apiController: 'api/Devt',
methodName: 'SaveTableMaster',
parameter: 'tableName=' + table + '&data=' + data + '&action=' + action + '&token=' + token
};
MinovaAjaxPost('/ApiService/Api/', params, function (xhr) {
var result = Ext.decode(xhr.responseText);
var r = Ext.decode(result.data);
if (r.success) {
headerDisplay.mask("Loading...");
var idNo = r.data;
frmForm.getForm().findField(keyField).setValue(idNo);
frmDisplay.getForm().setValues(frmForm.getValues());
headerDisplay.getForm().setValues(frmForm.getValues());
frmDisplay.setHidden(false);
frmForm.setHidden(true);
MinovaMessage('Not Null', '000006', '', 'S');
headerDisplay.unmask();
} else {
MinovaMessage(' Not Null ', ' 000005 ', r.message.text, 'E');
}
});
}
} else if (table == 'PMDCUS0001'){
var CheckCustomerID = frmForm.getForm().findField("CustomerID").getValue();
var inUpdate = '0';
if (CheckCustomerID '' || CheckCustomerID '0'){
inUpdate = '1'
}
if (inUpdate == '1'){
var ExternalIDCus = frmForm.getForm().findField("ExternalID").getValue();
Ext.Ajax.request({
async: false,
method: 'POST',
url: '/UserControl/GetStore',
params: {
tableName: 'PMDCUS0001',
param: 'ExternalID[=]' + ExternalIDCus
},
success: function (response) {
var results = Ext.decode(response.responseText);
dt = results.data[0];
if (dt != undefined) {
MinovaMessage('Not Null', 'FILOVAL003', '', 'E');
}
else
{
var params = {
apiController: 'api/Devt',
methodName: 'SaveTableMaster',
parameter: 'tableName=' + table + '&data=' + data + '&action=' + action + '&token=' + token
};
MinovaAjaxPost('/ApiService/Api/', params, function (xhr) {
var result = Ext.decode(xhr.responseText);
var r = Ext.decode(result.data);
if (r.success) {
headerDisplay.mask("Loading...");
var idNo = r.data;
frmForm.getForm().findField(keyField).setValue(idNo);
frmDisplay.getForm().setValues(frmForm.getValues());
headerDisplay.getForm().setValues(frmForm.getValues());
frmDisplay.setHidden(false);
frmForm.setHidden(true);
MinovaMessage('Not Null', '000006', '', 'S');
headerDisplay.unmask();
} else {
MinovaMessage(' Not Null ', ' 000005 ', r.message.text, 'E');
}
});
}
}
});
} else{
var params = {
apiController: 'api/Devt',
methodName: 'SaveTableMaster',
parameter: 'tableName=' + table + '&data=' + data + '&action=' + action + '&token=' + token
};
MinovaAjaxPost('/ApiService/Api/', params, function (xhr) {
var result = Ext.decode(xhr.responseText);
var r = Ext.decode(result.data);
if (r.success) {
headerDisplay.mask("Loading...");
var idNo = r.data;
frmForm.getForm().findField(keyField).setValue(idNo);
frmDisplay.getForm().setValues(frmForm.getValues());
headerDisplay.getForm().setValues(frmForm.getValues());
frmDisplay.setHidden(false);
frmForm.setHidden(true);
MinovaMessage('Not Null', '000006', '', 'S');
headerDisplay.unmask();
} else {
MinovaMessage(' Not Null ', ' 000005 ', r.message.text, 'E');
}
});
}
} else {
var params = {
apiController: 'api/Devt',
methodName: 'SaveTableMaster',
parameter: 'tableName=' + table + '&data=' + data + '&action=' + action + '&token=' + token
};
MinovaAjaxPost('/ApiService/Api/', params, function (xhr) {
var result = Ext.decode(xhr.responseText);
var r = Ext.decode(result.data);
if (r.success) {
headerDisplay.mask("Loading...");
var idNo = r.data;
frmForm.getForm().findField(keyField).setValue(idNo);
frmDisplay.getForm().setValues(frmForm.getValues());
headerDisplay.getForm().setValues(frmForm.getValues());
frmDisplay.setHidden(false);
frmForm.setHidden(true);
MinovaMessage('Not Null', '000006', '', 'S');
headerDisplay.unmask();
} else {
MinovaMessage(' Not Null ', ' 000005 ', r.message.text, 'E');
}
});
}
Makasih