MySuite
03/26/2020, 3:41 PMLuiz Morais
03/26/2020, 3:44 PMbattk
03/26/2020, 3:45 PMbattk
03/26/2020, 3:45 PMbattk
03/26/2020, 3:53 PMMySuite
03/26/2020, 3:57 PM/**
* Module Description
*
* Version Date Author Remarks
* 1.00 20 Mar 2020 ------
*
*/
var parmAllowedRoles = nlapiGetContext().getSetting('SCRIPT', 'custscript__pi_ue_project_taskp0'); // Allowed Roles
/**
* The recordType (internal id) corresponds to the "Applied To" record in your script deployment.
* @appliedtorecord recordType
*
* @param {String} type Operation types: create, edit, view, copy, print, email
* @param {nlobjForm} form Current form
* @param {nlobjRequest} request Request object
* @returns {Void}
*/
function __pi_ue_project_taskBeforeLoad(type, form, request){
try{
if (!isEmpty(parmAllowedRoles)) {
var aRoles = parmAllowedRoles.split(',');
if (aRoles.length > 0) {
if (aRoles.indexOf(nlapiGetRole().toString()) < 0) {
form.getSubList('assignee').getField('unitcost').setDisplayType('hidden');
form.getSubList('assignee').getField('cost').setDisplayType('hidden');
}
}
}
}catch(e){
var nle = nlapiCreateError(e);
err = {
stacktrace: nle.getStackTrace(),
reasoncode: nle.getCode(),
message: nle.getDetails(),
event: nle.getUserEvent(),
id: nle.getId(),
internalid: nle.getInternalId()
};
nlapiLogExecution('error', '__pi_ue_project_taskBeforeLoad', JSON.stringify(err));
}
}
/**
* The recordType (internal id) corresponds to the "Applied To" record in your script deployment.
* @appliedtorecord recordType
*
* @param {String} type Operation types: create, edit, delete, xedit
* approve, reject, cancel (SO, ER, Time Bill, PO & RMA only)
* pack, ship (IF)
* markcomplete (Call, Task)
* reassign (Case)
* editforecast (Opp, Estimate)
* @returns {Void}
*/
function __pi_ue_project_taskBeforeSubmit(type){
}
/**
* The recordType (internal id) corresponds to the "Applied To" record in your script deployment.
* @appliedtorecord recordType
*
* @param {String} type Operation types: create, edit, delete, xedit,
* approve, cancel, reject (SO, ER, Time Bill, PO & RMA only)
* pack, ship (IF only)
* dropship, specialorder, orderitems (PO only)
* paybills (vendor payments)
* @returns {Void}
*/
function __pi_ue_project_taskAfterSubmit(type){
}
function isEmpty(stValue)
{
if ((stValue == '') || (stValue == null) || (stValue == undefined) || (stValue.length == 0)) {
return true;
}
return false;
}
battk
03/26/2020, 4:02 PMbattk
03/26/2020, 4:03 PMbattk
03/26/2020, 4:04 PMbattk
03/26/2020, 4:04 PMfunction beforeLoad(type, form, request) {
form.getSubList("assignee").getField("unitcost").setDisplayType("hidden");
form.getSubList("assignee").getField("cost").setDisplayType("hidden");
}
MySuite
03/26/2020, 4:55 PMMySuite
03/26/2020, 5:09 PM