- This topic has 5 replies, 2 voices, and was last updated 1 month ago by
Rad.
-
AuthorPosts
-
-
March 10, 2026 at 05:58 #39107
Hi, I am using spjs.ac.textField to populate few fields when a user selects a value in Autocomplete field. But there’s one field which needs to be populated based on a Status check from a list. Wondering if it’s possible to set a value returned from a function in the spjs.ac.textField using parseFunction? If not is there a way to achieve this? I want the field populate a field as soo as user selects a value in Autocomplete field.
function getValB(Id){
if (ProjectCreatedDate) {
return val = “Yes”
} else {
return val = “No”
}
}then :
{
“fromFIN”:”setValB”,
“toFIN”:”ValB”,
“parseFunction”:”getValB(123)”,
“skipIfEmpty”:false
}
____________________________
saw this example of date formattingspjs.ac.textField({
“applyTo”:”Project”,
“helpText”:”Project name or number…”,
“listGuid”:”ProjectList”,
“listBaseUrl”:”/DFFS”,
“showField”:”Title”,
“enforceUniqueValues”:true, // New in v1.33
“rowLimit”:15,
“listOptionsOnFocus”:false,
“reValidateOnLoad”:false,
“allowAddNew”:false, // New in v1.4
“isLookupInSelf”:true, // New in v1.4
“setFields”:[
{
“fromFIN”:”ProjectNumber”,
“toFIN”:”PNumber”,
“parseFunction”:””,
“skipIfEmpty”:false
},
{
“fromFIN”:”Created”,
“toFIN”:”ProjectCreatedDate”,
“parseFunction”:”parseDateFunc”,
“skipIfEmpty”:false
}
]
}); -
March 10, 2026 at 16:14 #39108
i tried using spjs.ac.setFieldValue but doesn’t seen to to work
-
March 12, 2026 at 19:13 #39110
I’m not sure I understand exactly what you mean. The setFields part of the config for the autocomplete is used to set the value pulled in from the source list, but using a parse function you can basically set whatever value you like.
The parsefunction should only be the name of the function like “getValB” and the function will get two parameters passed in – the value of the “fromField” and the name of the field.
In the “getValB” function you can try something like this:
{ "fromFIN": "Created", "toFIN": "ProjectCreatedDate", "parseFunction": "getValB", "skipIfEmpty": false } // the function function getValB(created, fin){ // Parse the date const createdDate = new Date(created); // I'm not sure what logic you are looking form here, but // do some comparisons and return Yes or No }Alexander
-
March 12, 2026 at 19:28 #39111
thank you, this helps.
diff q – is there a way to hide the recycle bin and edit links from the left nav of a List view? I know it can be done for the web pages using the script editor in web part. But couldn’t find any help for a List View.
-
March 13, 2026 at 15:39 #39113
As far as I know there is no easy way to inject code in a list view without creating a SPFx solution (like an SPFx Application Customizer).
Alexander
-
March 13, 2026 at 17:31 #39115
thank you
-
-
AuthorPosts
- You must be logged in to reply to this topic.