Sign in with your Microsoft account to access the portal.
Go to portal.azure.com → Azure Active Directory → App registrations → New registration.
Name it something like "SafMed CRM Portal". Under Redirect URI, select Single-page application (SPA) and enter the full URL where this HTML file is hosted on SharePoint (e.g. https://yourcompany.sharepoint.com/sites/sales/Shared%20Documents/SafMed_CRM_Portal.html).
Then go to API permissions → Add permission → SharePoint → Delegated and add AllSites.Write. Click Grant admin consent.
Copy the Application (client) ID and Directory (tenant) ID — you'll need both below.
Go to your SharePoint site → New → List → Blank list. Name it exactly Quotes.
Then add the following columns:
| Column display name | Type | Notes |
|---|---|---|
| Title | Single line | Built-in — stores Quote No |
| QuoteDate | Date | |
| BusinessUnit | Choice | IPT, Surgical, Autoclaves, Life Science |
| ProductCategory | Single line | |
| Customer | Single line | |
| ProductDescription | Multiple lines | |
| ItemRef | Single line | |
| PriceExVAT | Number | |
| QuoteStatus | Choice | New, Update |
| QuoteLink | Single line | |
| Representative | Choice | All rep names |
| Probability | Number | |
| ForecastDate | Date | |
| Comment | Multiple lines | |
| QuoteYear | Single line | |
| QuoteMonth | Single line | |
| MonthIndex | Number |
Open this HTML file in a text editor and update the CONFIG object near the top of the <script> section:
const CONFIG = {
clientId: 'paste-your-client-id-here',
tenantId: 'paste-your-tenant-id-here',
siteUrl: 'https://yourcompany.sharepoint.com/sites/sales',
listName: 'Quotes',
localMode: false // keep false for SharePoint
};
Upload the updated HTML file to the SharePoint document library of the site you specified in siteUrl. Share the link with your sales team. They open it in their browser, sign in with their Microsoft account, and they're in.
Important: The file must be opened from the SharePoint URL (not downloaded locally) for Microsoft authentication to work correctly.