I have had this patch function working for a very longtime, I recently update other sections of the app and notice that the patch was behaving wierd randomly.
I also notice that Text boxes randomly showed a border, this was not something I changed the app changed it when going from one version to another, this was easy to resolve setting the border back to 0 again.
But for my Patch function I know have the following issues happening randomly.
Example 1: Press Patch, nothing gets patch no error message, jumps out of the item screen back to gallery, like it should after is patched successfully, the text i entered is not patched and it is still available in the text box so I can just click save again and it will patch it it.
Example 2: I write in the textbox: "Hello World, how are you doing today" hit save button, it only patches Hello World and leaves out the rest of the text. randomly selected text will get patched.
Example 3: You have to click save button twice, this happens alot (Modern button controls)
Example 4: Everything works as it should.
The issue presented with my patch have also been viewed when i do submitform, it will not submit entire text field selecting some text only and leaves out some.
This all started happening when i went from version: 3.24045.24 to 3.24073.20
Here is my patch code for the button:
If(
TabListMenu.Selected.Value = "Message" && !IsBlank(TextInputTicket.Value),
Patch(
Helpdesk,
CurrentItem, // Use the context variable set in the Gallery
{
'Case Comments': "<b>" & Char(10) & User().FullName & "</b>" & "<br> <span style='font-size:10.5pt'>" & Text(
Now(),
"[$-en-US]yyyy/mm/dd hh:mm"
) & "</span> <br> " & TextInputTicket.Value & CurrentItem.'Case Comments',
LastComment: TextInputTicket.Value,
'Last Modified By': {
'@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
Department: "",
DisplayName: User().FullName,
Claims: "i:0#.f|membership|" & Lower(User().Email),
Email: User().Email,
JobTitle: "",
Picture: ""
},
'Last Comment Made By': {
'@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
Department: "",
DisplayName: User().FullName,
Claims: "i:0#.f|membership|" & Lower(User().Email),
Email: User().Email,
JobTitle: "",
Picture: ""
}
}
);
If(
!IsEmpty(Errors(Helpdesk)),
// Errors occurred, handle them and do not reset TextInputTicket
Notify(
First(Errors(Helpdesk)).Message,
NotificationType.Error
),
// No errors, proceed with additional actions
UpdateContext(
{
CurrentItem: LookUp(
Helpdesk,
ID = CurrentItem.ID
)
}
);
Reset(TextInputTicket)
)
);
If(
TabListMenu.Selected.Value = "Worklog" && !IsBlank(TextInputTicket.Value),
Patch(
Helpdesk,
CurrentItem, // Use the context variable set in the Gallery
{
Worklog: "<b>" & Char(13) & Char(13) & User().FullName & "</b>" & "<br> <span style='font-size:10.5pt'>" & Text(
Now(),
"[$-en-US]yyyy/mm/dd hh:mm"
) & "</span> <br> " & Char(13) & TextInputTicket.Value & CurrentItem.Worklog,
'Last Modified By': {
'@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
Department: "",
DisplayName: User().FullName,
Claims: "i:0#.f|membership|" & Lower(User().Email),
Email: User().Email,
JobTitle: "",
Picture: ""
}
}
);
If(
!IsEmpty(Errors(Helpdesk)),
// Errors occurred, handle them and do not reset TextInputTicket
Notify(
First(Errors(Helpdesk)).Message,
NotificationType.Error
),
// No errors, proceed with additional actions
UpdateContext(
{
CurrentItem: LookUp(
Helpdesk,
ID = CurrentItem.ID
)
}
);
Reset(TextInputTicket)
)
);
If(
TabListMenu.Selected.Value = "Close" && !IsBlank(TextInputTicket.Value),
Patch(
Helpdesk,
CurrentItem, // Use the context variable set in the Gallery
{
Resolution: "<b>" & Char(13) & Char(13) & User().FullName & "</b>" & "<br> <span style='font-size:10.5pt'>" & Text(
Now(),
"[$-en-US]yyyy/mm/dd hh:mm"
) & "</span> <br> " & Char(13) & TextInputTicket.Value & CurrentItem.Resolution,
'Last Modified By': {
'@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
Department: "",
DisplayName: User().FullName,
Claims: "i:0#.f|membership|" & Lower(User().Email),
Email: User().Email,
JobTitle: "",
Picture: ""
},
Status: {
'@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",
Id: 4,
Value: "Closed"
}
},
{
'Assigned To': {
'@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
Claims: "i:0#.f|membership|" & Lower(User().Email),
Department: "",
DisplayName: User().FullName,
Email: User().Email,
JobTitle: "",
Picture: ""
}
}
);
If(
!IsEmpty(Errors(Helpdesk)),
// Errors occurred, handle them and do not reset TextInputTicket
Notify(
First(Errors(Helpdesk)).Message,
NotificationType.Error
),
// No errors, proceed with additional actions
UpdateContext(
{
CurrentItem: LookUp(
Helpdesk,
ID = CurrentItem.ID
)
}
);
Reset(TextInputTicket)
)
);
If(
TabListMenu.Selected.Value = "Close",
// Additional logic for filtering TicketsCollection based on TabList1.Selected.Value
If(
TabList1.Selected.Value = "Unassigned",
ClearCollect(
TicketsCollection,
Filter(
Helpdesk,
Status.Value = "Unassigned"
)
);
UpdateContext({itemSelected: false})
);
If(
TabList1.Selected.Value = "My Tickets",
ClearCollect(
TicketsCollection,
Filter(
Helpdesk,
('Assigned To'.DisplayName = User().FullName) && ((Status.Value = "Assigned") || (Status.Value = "In Progress") || (Status.Value = "Waiting for user response") || (Status.Value = "Waiting for external resource") || (Status.Value = "Backlog"))
)
);
UpdateContext({itemSelected: false})
);
If(
TabList1.Selected.Value = "Closed",
ClearCollect(
TicketsCollection,
Filter(
Sort(
Helpdesk,
ID,
SortOrder.Descending
),
'Assigned To'.DisplayName = User().FullName && Status.Value = "Closed"
)
);
UpdateContext({itemSelected: false});
Notify(
"Ticket was closed and placed under Closed tickets.",
NotificationType.Success,
600
)
);
If(
TabList1.Selected.Value = "All",
ClearCollect(
TicketsCollection,
SortByColumns(
Helpdesk,
"CreatedDate",
SortOrder.Descending
)
);
UpdateContext({itemSelected: false})
)
)