Forum Discussion
Issues with customRowAction
We have a library with a handful of metadata fields, including
- Document Status (vStatus) : Managed Metadata, default value = In Progress
- To Be Checked (vToBeChecked) : Yes/No, default value = No
- Checked (vChecked): Yes/No, default value = No
'To Be Checked' is used to filter a view that only shows items that need checking, it's not visible on the view itself - if Yes, then the document is visible for checking.
When 'Checked' is toggled to Yes, a custom row action is triggered that sets 'Document Status' to Final, and sets 'To Be Checked' to No.
This has been working for the last 3 years, now one user has started receiving an error that 'One or more fields have an error', the error points to the 'Document Status' field as having the problem. If I remove the line that updates the Status, everything else works as expected.
I've re-created the above fields on a new site and am able to replicate the error
- The Site Owner account, using Edge or Chrome, normal or incognito/private receives the error
- SC Admin using Edge private mode it works
- One normal site Member has the error, another doesn't
Code for 'vChecked' field
{
"$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
"elmType": "div",
"style": {
"display": "flex",
"width": "100%",
"height": "100%",
"align-items": "center"
},
"children": [
{
"elmType": "div",
"style": {
"display": "flex",
"width": "60px",
"height": "30px",
"border-radius": "15px",
"align-items": "center",
"flex-direction": "row",
"justify-content": "=if(@currentField , 'flex-end' , 'flex-start')",
"cursor": "pointer"
},
"customRowAction": {
"action": "setValue",
"actionInput": {
"vChecked": "=if(@currentField , '0' , '1' )",
"vToBeChecked": 0,
"vStatus": "=if(@currentField,if([$vStatus] == 'Final','Final|{{ GUID }}','In Progress|{{ GUID }}'),'Final|{{ GUID }}')"
}
},
"attributes": {
"class": "=if(@currentField , 'ms-bgColor-themePrimary' , 'ms-bgColor-neutralTertiaryAlt')"
},
"children": [
{
"elmType": "div",
"style": {
"width": "18px",
"height": "18px",
"margin-left": "6px",
"margin-right": "6px",
"border-radius": "50%"
},
"attributes": {
"class": "ms-bgColor-white"
}
}
]
}
]
}
Code for 'vStatus' field
{
"$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
"elmType": "div",
"txtContent": "@currentField",
"style": {
"background-color": "=if(@currentField == 'Final', '#cfe7d8', if(@currentField == 'In Progress', '#fff4cc', if(@currentField == 'Internal Only', '#ccd6ec', '' )))"
}
}
Code for 'vToBeChecked' field
{
"$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
"elmType": "div",
"style": {
"display": "flex",
"width": "100%",
"height": "100%",
"align-items": "center"
},
"children": [
{
"elmType": "div",
"style": {
"display": "flex",
"width": "60px",
"height": "30px",
"border-radius": "15px",
"align-items": "center",
"flex-direction": "row",
"justify-content": "=if(@currentField , 'flex-end' , 'flex-start')",
"cursor": "pointer"
},
"customRowAction": {
"action": "setValue",
"actionInput": {
"vToBeChecked": "=if(@currentField,'0','1')",
"vChecked": 0
}
},
"attributes": {
"class": "=if(@currentField , 'ms-bgColor-themePrimary' , 'ms-bgColor-neutralTertiaryAlt')"
},
"children": [
{
"elmType": "div",
"style": {
"width": "18px",
"height": "18px",
"margin-left": "6px",
"margin-right": "6px",
"border-radius": "50%"
},
"attributes": {
"class": "ms-bgColor-white"
}
}
]
}
]
}
Any ideas would be appreciated.
- R
4 Replies
- RobD365Brass Contributor
After 4 months, Microsoft have finally advised that the functionality has been removed, and there is no official documentation informing users of this ... 🤬
- RobD365Brass Contributor
Unfortunately not, i've had a ticket logged with MS since April with no progress. Now that everyone is having the same issue, i'm unable to show it was actually working.
I'm 100% convinced it's due to a rollout that on the surface only changed the (i) info icon in libraries to be '[<] Details' as initially it was only those with the new icon affected, those with the old were fine, now everyone has the new icon and is affected.
- RobD365Brass Contributor
I believe it has the same root cause as https://techcommunity.microsoft.com/discussions/sharepoint_general/document-viewer-changes-users-view-recent-sp-update/4402068