Steve

Forum Replies Created

Viewing 15 posts - 31 through 45 (of 45 total)
  • Author
    Posts
  • in reply to: Lock form after 09:00 #28449
    Steve
    Participant

    I don’t understand exactly what you mean. Do you want to lock ALL items in the list at 09:00, or only those that have a due date on that same day?

    Only those that have a due date on that same day.

    And if the item has a due date “today” – locking it at 09:00 should keep it locked permanently?

    Yes, keep it locked permanently after “today” – 09:00.

    Steo

    in reply to: Custom JS count sum (€) #28409
    Steve
    Participant

    Well, all columns have been set as “Number”. I set them as “one line of text” and it works out.

    • This reply was modified 4 years, 3 months ago by Steve.
    in reply to: Custom JS count sum (€) #28406
    Steve
    Participant

    The last thing, I cannot save the “item”, because of the value, for example: “0.7“, but in Czech, we have the value with a decimal point (comma) “0,7“. Can you help me?
    Otherwise, it works perfectly.

    Steo

    Attachments:
    in reply to: Custom JS count sum (€) #28400
    Steve
    Participant

    Thank you Alex for pointing out the errors.
    Now, it works perfectly.
    Steo

    in reply to: Custom JS count sum (€) #28382
    Steve
    Participant

    Hi Alex,
    I tried that and it worked perfectly. Then I made “tot” read-only and customized the JS function and it also worked followed by your instructions. But I need to sum 5 columns summed in “tot” column. So I have created 5 columns. “sumAll” is a column where it adds up.

    Here is my code:

    
    
    jQuery("#dffs__x0043_hK1000 input, #dffs__x0043_hK450 input,#dffs_RozStan50 input, #dffs__RozGrah60 input, #dffs_Vian350 input").on("keyup",function(){
        var str = jQuery(this).val().replace( /[^0-9.]/g, "" );
        jQuery(this).val(str);
        setFinalCost();
    });
    
    function setFinalCost(){
    	var a, b, c, d, e, f, aa, bb, cc, dd, ee, ff;
    	a = Number($("#dffs__x0043_hK1000 input").val());
    	b = Number($("#dffs__x0043_hK450 input").val());
    	c = Number($("#dffs_RozStan50 input").val());
    	d = Number($("#dffs_RozGrah60 input").val());
    	e = Number($("#dffs_Vian350 input").val());
    	f = Number($("#dffs_sumAll input").val());
    	aa = !isNaN(a) ? a : 0;
    	bb = !isNaN(b) ? b : 0;
    	cc = !isNaN(c) ? c : 0;
    	dd = !isNaN(d) ? c : 0;
    	ee = !isNaN(e) ? c : 0;
    	ff = !isNaN(f) ? c : 0;
    	
    	if(isNaN(a)){
    		alert("Number format error in \""+spjs.dffs.fieldData._x0043_hK1000.disp+"\"");
    	}
    	if(isNaN(b)){
    		alert("Number format error in \""+spjs.dffs.fieldData._x0043_hK450.disp+"\"");
    	}
    	if(isNaN(c)){
    		alert("Number format error in \""+spjs.dffs.fieldData.RozStan50.disp+"\"");
    	}
    	if(isNaN(d)){
    		alert("Number format error in \""+spjs.dffs.fieldData.RozGrah60.disp+"\"");
    	}
    	if(isNaN(e)){
    		alert("Number format error in \""+spjs.dffs.fieldData.Vian350.disp+"\"");
    	}
    	if(isNaN(f)){
    		alert("Number format error in \""+spjs.dffs.fieldData.sumAll.disp+"\"");
    	}
    	setFieldValue("Tot",aa+bb+cc+dd+ee+ff);
    	setTimeout(function(){
    		$("input.fieldValueUpdated").removeClass("fieldValueUpdated");
    	},1000);
    }

    Thank you in advance.
    Steo

    in reply to: Rename Add/remove buttons with description #26769
    Steve
    Participant

    Thank you so much Alex, it helped me a lot.
    Thank you
    Steve

    in reply to: SOAP Server Exception was thrown #25396
    Steve
    Participant
    
    
    spjs.ac.textField({
     "applyTo": "n2k6",
     "helpText": "Sem zadejte požadovanou roli",
     "loadText": "Čekejte prosím",
     "listGuid": "{8c19e719-01f7-4248-9fc8-188bb360f736}",
     "listBaseUrl": "/apps/xxxx/Stepan",
     "showField": "Hledej",
     "searchFields": "Hledej", (Is this doing something wrong)?
     "filterCAML": "",
     "useREST": false,
     "preloadData":false,
     "filterREST": "",
     "optionDetailFields": [],
     "optionDetailPrefix": [],
     "enforceUniqueValues": true,
     "rowLimit": 10,
     "listOptionsOnFocus": false,
     "minLengthBeforeSearch": 3,
     "reValidateOnLoad": false,
     "allowAddNew": false,
     "isLookupInSelf": false,
     "addNewAdditionalFields": [],
     "multiselect": false,
     "multiselectSeparator": "; ",
     "orderBy": [],
     "clearSetFieldsOnInvalidSelection": false,
     "setFields": [],
     "debug": false
    });

    I tried this and it’s been kind of working, but…I still cannot set it up. It looks like searching, but it cannot find anything. I followed your manual, but I probably forgot for something or missed.

    I just have a list of people (list A) (people are written in a single line of text column). Then I have a form (list B) with “single line of text” where I want to see the data autocompleted from the list A.

    Another help for me?
    Sorry, Alex for the delay.

    Steve

    • This reply was modified 4 years, 11 months ago by Steve.
    in reply to: Auto Populate People Picker with current user #24353
    Steve
    Participant

    Thank you so much, I’ve spent all day trying to do it in Javascript.

    Steve.

    in reply to: Make a "Copy" button #24212
    Steve
    Participant

    If I understand the vLookup function, it won’t help me at all. Initiation of a form offers the author specific columns like -Type of product, the number of the product, the validity of price since, expiration dates etc.… If I always wanted to have the same data taking from another list (vLookup) then it would be a perfect way how to do it. But…

    There are too many specific data filling in the columns in the form, that means I need only some columns to be copied, but They always change. It’s hard for me to describe the situation, but the Copy button is the best way how to solve my problem out.

    • This reply was modified 5 years, 1 month ago by Steve.
    in reply to: Make a "Copy" button #24124
    Steve
    Participant

    Alex, It’s working so, there is no problem with those errors. I changed nothing, I was just looking at the wrong list on the same page. My mistake. When I clicked on the web “xxxxx” on SharePoint, the list has shown up where I use the javascript. But I had to click on the list at navigation panel.

    Now, all of it is working. Thank you very much Alex.

    in reply to: Make a "Copy" button #24112
    Steve
    Participant

    Thanks Alex, the first form doesn’t save. I do not need the second form to be saved automatically. I fill the columns in the NewForm, then I hit “Save and Copy”, another NewForm is initiated but its predecessor (first form) did not save at all.

    And you were right, I wan to make changes in the “copied” form.

    Steve

    in reply to: Make a "Copy" button #24064
    Steve
    Participant

    Alexander, it works! The break in that line was a mistake and that’s why it did not work out. Now, it’s working, but…

    If I create a new form, then I fill in columns, then I hit “Save and Copy” – the new for is initiated but it hasn’t saved.

    in reply to: Make a "Copy" button #24060
    Steve
    Participant

    I’m sorry Alexander but still I cannot see a button at the bottom of the form and the same error pops up whenever I put commas, for example: “Cena”, “StavSchvalovani”,.. Even if I remove them.
    The error says: The operation cannot be completed due to error 80020101. The Code looks like:

    
    
    // If creating a copy
    if(GetUrlKeyValue("CreateCopy") === "1"){
        var str = sessionStorage.getItem("SaveAndCreateNewData"), data;
        if(str !== null){
            data = JSON.parse(str);
            jQuery.each(data,function(fin,val){
                setFieldValue(fin,val);
            });
        }
    }
    
    // Add button
    jQuery("input[id$='_diidIOSaveItem']").before("<input type='button'
    class='ms-ButtonHeightWidth' style='margin-right:4px;' value='Save and Copy' onclick='saveAndCopy()' />");
    
    var createCopyWhenSaving = false;
    function saveAndCopy(){
        createCopyWhenSaving = true;
        spjs.dffs.triggerSave();
    }
    
    function dffs_PreSaveAction(){
        if(createCopyWhenSaving){
            var arr = [
                "%5Fx0031%5FatributPolozky",
                "NazevPolozky",
                "DruhPolozky",
                "SubdruhPolozky",
                "BaleniAhmotnost",
            ];
            var data = {};
            jQuery.each(arr,function(i,fin){
                data[fin] = getFieldValue(fin);
            });
            sessionStorage.setItem("SaveAndCreateNewData",JSON.stringify(data));
            // Redirect
            spjs.dffs.redirect(location.pathname + "?CreateCopy=1",false);
        }
        return true;
    }
    in reply to: Make a "Copy" button #24052
    Steve
    Participant

    Hi Alex,

    I’ve done everything. I don’t see a button at the bottom of the form. An error pops up – as you can see in the picture.

    In accordance with your last paragraph, dffs_PreSaveAction is not included in my form.
    One sidelight, I have a button “Load data” that is made in javascript above the form in webpart in content editor. It’s not made in DFFS. Could that be a problem?

    Thank you for your time Alex you spend with this article.

    Steve

    • This reply was modified 5 years, 1 month ago by Steve.
    Attachments:
    in reply to: Make a "Copy" button #24015
    Steve
    Participant

    Thank you very much for the code. I’m not great in javascript and coding such as. Please, could you tell me where I should put my “IDs (URLs)” of columns etc? At this moment, it does not work. But I probably have some mistakes in the code. Could you check it? Thank you once again.

    
    
    // If creating a copy
    if(GetUrlKeyValue("CreateCopy") === "1"){
        var str = sessionStorage.getItem("SaveAndCreateNewData"), data;
        if(str !== null){
            data = JSON.parse(str);
            jQuery.each(data,function(fin,val){
                setFieldValue(fin,val);
            });
        }
    }
    
    // Add button
    jQuery("input[id$='_diidIOSaveItem']").before("<input type='button'
    class='ms-ButtonHeightWidth' style='margin-right:4px;' value='Save and Copy' onclick='saveAndCopy()' />");
    
    var createCopyWhenSaving = false;
    function saveAndCopy(){
        createCopyWhenSaving = true;
        spjs.dffs.triggerSave();
    }
    
    function dffs_PreSaveAction(){
        if(createCopyWhenSaving){
            var arr = [
                "Cena"
                "CenoveHladiny"
                "Cena"
                "StavSchvalovani"
                "CenaZaPrepravku"
            ];
            var data = {};
            jQuery.each(arr,function(i,fin){
                data[fin] = getFieldValue(fin);
            });
            sessionStorage.setItem("SaveAndCreateNewData",JSON.stringify(data));
            // Redirect
            spjs.dffs.redirect(location.pathname + "?CreateCopy=1",false);
        }
        return true;
    }
Viewing 15 posts - 31 through 45 (of 45 total)