This message was deleted.
# general
s
This message was deleted.
I've written other portlets but not PowerBI. If those products do it, you have validation that it's definitely possible 😃
Thanks, I would appreciate that
Having a look at one of the portlets I have handy - what I did was put my content into an html file in the file cabinet - and in the portlet script I read that file and set the the value of an inline html field to the contents of that file
Using basic find and replace to set some dynamic values
Seems to work well
Copy code
export function render(context: EntryPoints.Portlet.renderContext) {
  context.portlet.title = 'Sales KPI';

  let html = file
    .load({
      id: 'SuiteScripts/Dashboard KPI/assets/mos_dashboardkpi.html',
    })
    .getContents();

  const monthlySalesPercent = calculateMonthlySalesPercent();
  const yearlySalesPercent = calculateYearlySalesPercent();

  const { lowerTarget, upperTarget } = calculateDailyTarget();
  const dailyTarget = `${lowerTarget}-${upperTarget}`;
  const dailyTargetMet =
    parseFloat(monthlySalesPercent) >= lowerTarget ? 'true' : 'false';

  html = html.replace('{{salesPercentMonth}}', monthlySalesPercent);
  html = html.replace('{{salesPercentYear}}', yearlySalesPercent);
  html = html.replace('{{dailyTarget}}', dailyTarget);
  html = html.replace('{{dailyTargetMet}}', dailyTargetMet);

  context.portlet.addField(
    { type: ui.FieldType.INLINEHTML, label: 'Inline HTML', id: 'inlinehtml' }
  ).defaultValue = html;
}
message has been deleted
Lol I just make a multi million dollar sale in sandbox to show off the graffiti when the target is met 🤣
message has been deleted
k
Nice. I helped one of my BI guys add an HTML portlet. Was a lot more work than you did here. Granted, half the battle was getting his power BI hooked to NetSuite