Content
Editable table with row validation
Table Functionality
Add a new row using the ‘+’ button
Row validation
Display a warning message using the Bizagi widget called HTML Viewer (Beta).
Actions & Validations
/*
Name: Valeriu Bosneaga
Desc: Clean input data
Date: 24 March 2023
*/
var sRuleName = "TSH_CleanShiftRatesCollection";
LPT.Global_Trace(Me,"1",sRuleName,"START---------------------------------");
var bMultipleShitRates = <bMultipleShitRates>;
if (bMultipleShitRates == false)
{
<cHolidayShiftRate> = null;
<cNocturnalShiftRate> = null;
<cWeekendShiftRate> = null;
}
LPT.Global_Trace(Me,"1",sRuleName,"END ---------------------------------");
/*
Name: Valeriu Bosneaga
Desc: Add a new row to the Specialty Shift Rate table
Date: 24 March 2023
*/
var sRuleName = "TSH_AddRowSpecialtyShiftRate";
LPT.Global_Trace(Me,"1",sRuleName,"START---------------------------------");
Me.Context.newCollectionItem("kmLPTermSheet.xmTSHSpecialtyShiftRates");
LPT.Global_Trace(Me,"1",sRuleName,"END ---------------------------------");
Cell Editable
/*
Name: Valeriu Bosneaga
Desc: An Expression to validate whether Shift Rate Fields are editable or not
Date: 24 March 2023
*/
var sRuleName = "TSH_EditableDailyShiftRate";
LPT.Global_Trace(Me,"1",sRuleName,"START---------------------------------");
var editable = false;
var multipleShiftRate = <bMultipleShitRates>;
if(!CHelper.IsNull(multipleShiftRate)){
editable = true;
}
LPT.Global_Trace(Me,"1",sRuleName,"END ---------------------------------");
editable;
Panels visibility
/*
Name: Valeriu Bosneaga
Desc: Panel visibility rule
Date: 24 March 2023
*/
var sRuleName = "TSH_VisPanelsCallRequirements";
LPT.Global_Trace(Me,"1",sRuleName,"START---------------------------------");
var bVisible = false;
var bEmergencyRoomCallC = <bEmergencyRoomCallC>;
if (bEmergencyRoomCallC)
{
bVisible = true;
}
LPT.Global_Trace(Me,"1",sRuleName,"END ---------------------------------");
bVisible;
/*
Name: Valeriu Bosneaga
Desc: Panel visibility rule
Date: 24 March 2023
*/
var sRuleName = "TSH_VisPanelAlertShiftRate";
LPT.Global_Trace(Me,"1",sRuleName,"START---------------------------------");
var visible = true;
var sHTML = <kmLPTermSheet.kmTSHLabelAlert.sAlertShiftRate>;
if(CHelper.IsEmpty(sHTML))
{
visible = false;
}
LPT.Global_Trace(Me,"1",sRuleName,"END ---------------------------------");
visible;
Filter dropdown values to exclude already selected ones
The filter is applied to the Title dropdown.
/*
Name: Valeriu Bosneaga
Desc: Show the Titles that were not selected privously
Date: 05 June 2023
*/
var sRuleName = "TSH_FilterTitleMedicalDirectorship";
LPT.Global_Trace(Me,"1",sRuleName,"START---------------------------------");
var sFilter = null;
var oMedicalDiretorships = CHelper.GetValueAsCollection(<mTSH_Compensation.xmTSHMedicalDirectorships>);
if (oMedicalDiretorships.size() > 0)
{
for (var i = 0; i<oMedicalDiretorships.size(); i++)
{
var oMedicalDiretorship = oMedicalDiretorships.get(i);
var iTitleId = oMedicalDiretorship.getXPath("kpLPMedicalDirectorship.Id");
if (!CHelper.IsNull(iTitleId))
{
if (CHelper.IsEmpty(sFilter))
{
sFilter = "Id != "+ iTitleId;
}
else
{
sFilter += " AND Id != "+ iTitleId;
}
}
}
}
LPT.Global_Trace(Me,"1",sRuleName,"sFilter: "+ sFilter);
LPT.Global_Trace(Me,"1",sRuleName,"END ---------------------------------");
sFilter;