Forum Replies Created
-
AuthorPosts
-
Alexander BautzKeymaster
Could you try changing to only ONE level (field) in the cascading dropdown configuration in DFFS backed to see if this prevents the error? – also, the indexing might take some time to complete so maybe you need to retest this tomorrow.
Alexander
Alexander BautzKeymasterYes, It has to do with this setting, but my “plan” with the “queryItemsThrottled” in SPJS-utility.js was to overcome this limitation but splitting the query in chunks of 5000 items.
Could you possibly try to index the columns you use in the dropdown (in the source list) to see if this helps?
PS: Are some of these columns of lookup, person or taxonomy / managed metadata?
Alexander
October 13, 2015 at 11:12 in reply to: "Missing ID parameter for the list item in the URL" after upload on doc library #8710Alexander BautzKeymasterHi,
Can you post the URL to your NewForm? – replace the domain with “contoso.com” to not reveal your real domain name.Alexander
October 11, 2015 at 08:55 in reply to: Display a calculated column display value in edit form? #8697Alexander BautzKeymasterHi,
From your code snippet it looks like you must change the quotes in your last line – the last one looks like it is not right.If this is not the issue, please include the error message you receive.
Alexander
Alexander BautzKeymasterThis should do the trick:
function checkLookupFieldValue(){ var data, lookupValue, currValue = getFieldValue("EditFormInput"), a = 0, b; data = spjs.utility.getItemByID({"listName":_spPageContextInfo.pageListId,"id":spjs.dffs.data.thisItemID,"viewFields":["LookupExtraFieldInternalName"]}); lookupValue = data["LookupExtraFieldInternalName"]; if(lookupValue !== null){ $.each(lookupValue.split(";#"),function(i,s){ if(i % 2 !== 0){ if(a === 0 || parseInt(s,10) < a){ a = parseInt(s,10); } } }); b = parseInt(currValue,10); return a < b; } }
Please change “LookupExtraFieldInternalName” and “EditFormInput” to your own field names.
Let me know if this works.
Alexander
Alexander BautzKeymasterI’m glad it worked!
Alexander
October 9, 2015 at 20:35 in reply to: Display calculated age on NewForm/EditForm/DispForm when supplied with D.O.B #8692Alexander BautzKeymasterHi,
This code example will pull the date from a field named “Birthday”, and write it to a field named “Age”. Please note that this will be a static value, and will not automatically tick up a notch next year without you editing the list item.Put this in the Custom JS:
function calculateAge(){ var dfo, sDate, now, age; dfo = spjs.dffs.getRegionalSettings().DateFormat; sDate = spjs.dffs.strToDateObj("Birthday",dfo); now = new Date(); age = now.getFullYear() - sDate.getFullYear(); if(now.getMonth() < sDate.getMonth()){ age -= 1; }else if(now.getMonth() === sDate.getMonth()){ if(now.getDate() < sDate.getDate()){ age -= 1; } } setFieldValue("Age",age); }
Then call this function from a rule in DFFS by putting the function name in the “Run these functions / trigger these rules” field.
Let me know how it works out.
Alexander
Alexander BautzKeymasterCan you post the config / query for the cascading dropdown?
Alexander
Alexander BautzKeymasterHi,
Sorry, I forgot to tell I need to see the “Response” also – can you add it?Alexander
Alexander BautzKeymasterHi,
I’m unable to recreate this issue.Could this be an issue with for example the check out list item rule setup?
If not, could you email me some screenshots of your setup and a more detailed description so I can try to recreate it? – you find my email in the “About me” tab above.
Alexander
Alexander BautzKeymasterHi,
This will also require a custom function. Create a rule with trigger “Custom JavaScript function”, and add this to the “This value” field: “compareLookupFieldValue”. Then add this to the Custom JS section:function compareLookupFieldValue(){ var data = spjs.utility.getItemByID({"listName":_spPageContextInfo.pageListId,"id":spjs.dffs.data.thisItemID,"viewFields":["LookupExtraFieldInternalName"]}), lookupValue = data["LookupExtraFieldInternalName"], currValue = getFieldValue("EditFormInput"), a, b; if(lookupValue !== null){ a = parseInt(lookupValue.split(";#")[1],10); b = parseInt(currValue,10); return a < b; }else{ return false; } }
Please change “LookupExtraFieldInternalName” and “EditFormInput” to your own field names.
Let me know how this works out.
Alexander
- This reply was modified 8 years, 7 months ago by Alexander Bautz. Reason: fixed typo
Alexander BautzKeymasterHi,
You cannot do this directly in the “set field value” section in the rule.If you want the ID to be generated on save, add a rule with the trigger “The form is saved”, and add “generateCustomID” in the “Run these functions / trigger these rules” field.
Then you add this to the Custom JS section:
function generateCustomID(){ var p = getFieldValue("ProgramType").charAt(0), id = spjs.dffs.data.thisItemID; while(id.length < 4){ id = "0"+id } setFieldValue("IdNumber",p+"-"+id); }
Please note that you must change the fieldname “ProgramType” and “IdNumber” to your own field names.
Let me know how this works out.
Alexander
Alexander BautzKeymasterThe edit item bug is related to v4.355 FRONTEND, but I had forgot to add to the change log that I had fixed the error (I have added it now).
You should have v4.357 FRONTEND to fix the problem.
Sorry for the inconvenience,
AlexanderAlexander BautzKeymasterHi,
Can you verify that you have the latest version of DFFS frontend (October 6)? – I had a bug in one of the latest versions related to a fix for an edit button issue in SP2010.Alexander
Alexander BautzKeymasterCould you bring up the developer console (hit F12) and look at the “Network” tab. Double click the “lists.asmx” line with status 500 (or the red one) – can you send me the details from the “Request header” and “Response header”?
Also, can you double check the spjs-utilty.js version by bringing up the developer console and select the “Console” tab. Enter this by the cursor and hit enter:
spjs.utility.version
Whet does the version number read?
Alexander
-
AuthorPosts