Hello,
In datalist(custom), I am submitting a form (creating 'NewItem' ) and validating that it should not allow saving duplicate based on a property(e.g BatchName).
I know that it's handled by http://localhost:8080/share/proxy/alfresco/api/type/my
rop/formprocessor. That's why I am overriding form.post.json.js
In form.post.json.js, based on itemId I am doing validation.
if(itemId == "my
rop"){
var luceneQuery = "PATH:\"/app:company_home/st:sites/cm:"+siteId+"//*\" AND TYPE:\"my
rop\" AND @my\\:batchName:\""+selectedValue+"\"";
var result = search.luceneSearch(luceneQuery);
logger.system.out("@ luceneQuery : " + luceneQuery);
logger.system.out("@ Result length: " + result.length);
if(result.length >0){
status.setCode(409, "already exist..");
return;
}
}
persistedObject = formService.saveForm(itemKind, itemId, repoFormData);
But my prob is that I am not able to get the site value here. and I want to check duplicate in the current site.
Anyway so that I can get the site here ???
'NewItem' of toolbar.js and toolBar.get.html.ftl the method is already overwritten in another datalist. Hope I cannot override toolbar multiple times.