[30e88f42] Einfügen

Einfügen
This commit is contained in:
2026-02-22 14:31:00 +00:00
parent 11d2bc03bf
commit 0d294cd0cc
11 changed files with 290 additions and 174 deletions

View File

@@ -157,17 +157,26 @@ class SuperOfficeClient:
import datetime
now = datetime.datetime.utcnow().isoformat() + "Z"
# SuperOffice UI limit: 42 chars.
# We put exactly this in the FIRST line of the description.
short_title = (subject[:39] + '...') if len(subject) > 42 else subject
# SuperOffice often 'steals' the first line of the description for the list view header.
# So we give it exactly the subject it wants, then two newlines for the real body.
formatted_description = f"{short_title}\n\n{description}"
payload = {
"Description": f"{subject}\n\n{description}",
"Description": formatted_description,
"Contact": {"ContactId": contact_id},
"StartDate": now,
"EndDate": now,
"Task": {"Id": 1} # Usually 'Follow-up' or similar, depending on SO config
"MainHeader": short_title,
"Task": {"Id": 1}
}
if person_id:
payload["Person"] = {"PersonId": person_id}
print(f"Creating new appointment: {subject}...")
logger.info(f"Creating new appointment: {short_title}...")
return self._post("Appointment", payload)
def update_entity_udfs(self, entity_id: int, entity_type: str, udf_data: dict):