saveListFormAttachment
@spartanfx/react / saveListFormAttachment
Function: saveListFormAttachment()
saveListFormAttachment(
listFormContext,listItemId):Promise<void>
Saves the current state of file attachments to SharePoint.
This function:
- Uploads new attachments added by the user
- Deletes attachments marked for removal
It should be invoked after the list item has been saved to ensure a valid itemId is available.
Parameters
listFormContext
The current list form context containing attachment state.
listItemId
number
The ID of the list item to which attachments should be saved.
Returns
Promise<void>
void
Examples
const savedItem = await ctx.saveListItem(data);
await saveListFormAttachment(ctx, savedItem.Id);
saveListFormAttachment(listFormContext, listItemId)
saveListFormAttachment(
// listFormContext: description,
listFormContext,
// listItemId: description,
listItemId
)