mk3jamie

Forum Replies Created

Viewing 15 posts - 1 through 15 (of 16 total)
  • Author
    Posts
  • in reply to: Calculating Total from multiple fields #21126
    mk3jamie
    Participant

    Perfect Alex, that’s done the trick 🙂

    Your a gentleman and a scholar!

    in reply to: Calculating Total from multiple fields #21095
    mk3jamie
    Participant

    Shockingly it was a syntax error on my part! It’s working perfectly on the New Form but i’m having trouble with the Edit Form.

    So when “Task” is selected it will add the hours to the Actual hours. When tender is selected, it will add the hours to the Planned hours.

    When i edit an item, if i change from Task to Tender or vice versa, the if statement still reads the initial value as the value being selected, and therefore adds the hours to the previous total field.

    So like the above image, if I switched it to “Tender” i want to now add the hours to the Planned Hours total.

    The hours don’t add to Planned, the still add to Actual.

    Is there a way for me to be able to reset the function each time the VO Status field is changed?

    in reply to: Calculating Total from multiple fields #21076
    mk3jamie
    Participant

    Still having issues Alex, no doubt something silly!

    
    
    $("#dffs_NumField1 input, #dffs_NumField2 input, #dffs_NumField3 input").change(function(){
    	setFinalCost();
    });
    
    function setFinalCost(){
    var a,b,c,s,aa,bb,cc;
    	a = Number($("#dffs_Add_x0020_New_x0020_Steel_x0020_ input").val());
    	b = Number($("#dffs_Connection_x0020_Design input").val());
    	c = Number($("#dffs_Connection_x0020_Detailing input").val());
    
    	aa = !isNaN(a) ? a : 0;
    	bb = !isNaN(b) ? b : 0;
    	cc = !isNaN(c) ? c : 0;
    
    	
    	if(isNaN(a)){
    		alert("Number format error in \""+spjs.dffs.fieldData.Add_x0020_New_x0020_Steel_x0020_.disp+"\"");
    	}
    	if(isNaN(b)){
    		alert("Number format error in \""+spjs.dffs.fieldData.Connection_x0020_Design.disp+"\"");
    	}
    	if(isNaN(c)){
    		alert("Number format error in \""+spjs.dffs.fieldData.Connection_x0020_Detailing.disp+"\"");
    	}
    
     s = $("#dffs_Issue_x0020_Status input").val();
    
        if(s === "Tender"){
            // Set value for Tender
            $("#dffs_VO_x0020_Planned_x0020_Hours input").addClass("fieldValueUpdated").val(aa + bb + cc);
        }else{
            // Set value for all other status values
            $("#dffs_VO_x0020_Actual_x0020_Hours input").addClass("fieldValueUpdated").val(aa + bb + cc);
        }
        setTimeout(function () {
            $("input.fieldValueUpdated").removeClass("fieldValueUpdated");
        }, 1000);
    }
    • This reply was modified 3 years, 6 months ago by mk3jamie.
    • This reply was modified 3 years, 6 months ago by mk3jamie.
    • This reply was modified 3 years, 6 months ago by mk3jamie.
    in reply to: Calculating Total from multiple fields #21062
    mk3jamie
    Participant

    **Just an edit!

    The syntax error in my code above is just from my copy and paste, forgot to remove it!

    ” /*else { ”

    So ignore that comment line :p

    in reply to: Load list data into vLookup tab. #19193
    mk3jamie
    Participant

    It’s what my boss insists on using, the logic behind it being you can create forms that are much more “document” like.

    I had suggested we could build them in DFFS and customise them using the custom CSS and field CSS but there are about 50+ forms we need to build!

    As always Alex, thanks for your time!

    in reply to: Load list data into vLookup tab. #19155
    mk3jamie
    Participant

    Hi Alex,

    Sorry to resurrect this old issue but it’s still giving me a hard time! I’ll try to explain it a bit better now so i know why it doesn’t seem to work properly.
    ——————————————————————————-

    So a normal vLookup allows you to prefill values in the child, which works absolutely fine on a normal form but does not work when the form is an InfoPath custom form.

    Prefill Child

    So when i add my new training item via the vLookup, the parent ID will be set in the child list. However when I change the child list to display my custom infopath form, it wont allow me to pass any data to it from the vLookup.

    I’ve tried it with multiple data-types and still nothing.
    ——————————————————————————-

    Is there anyway to get the vLookup to work with InfoPath and set the child value? or is there even a way to pass the URL from the parent list into the vLookup and then access that data in InfoPath?

    As always, thanks for your time Alex.

    in reply to: Load list data into vLookup tab. #18599
    mk3jamie
    Participant

    Have it working as you described Alex. Added the button into the vLookup that will assign the value from my employee name directly to the employee name field on the vLookup.

    My issue now is that Employee Name is the field I used to connect the vLookup to the Employee list. So because I’m wanting to set that automatically, the vLookups will not display as I’ve not set an employee name. Because they don’t display, I cannot use the button to assign the Employee name to them.

    Is there a way I can connect the Employee list and the vLookup together without using the employee name? Or would i just have to use another field that would need to be filled in on the vLookup list so to connect it to the main employee list?

    Hopefully that makes sense!

    Thanks again Alex.

    in reply to: Load list data into vLookup tab. #18595
    mk3jamie
    Participant

    Forgot to mention as well, the vLookup loads an InfoPath form, if that makes any difference.

    in reply to: Load list data into vLookup tab. #18592
    mk3jamie
    Participant

    Here’s what I have so far Alex.

    function callMeFromButton(){
    jQuery.each(spjs.vLookup.dataObj.vLookupTraining[spjs.dffs.data.thisItemID].items,function(id,vLookupListItem){
    spjs.utility.updateItem({
    “listName”:”Training and Accreditation”,
    “id”:id,
    “data”:{“Employee_x0020_Name”:”Full_x0020_Name_x0020_Text”}
    });
    });
    }

    So the vLookup is contained on the Employee List, i’ve reference the correct vLookup at the top to the Training and Accreditation list. Then inside the “data” element I’ve put in the field within the Training and Accreditation list I want to populate with the corresponding value from the employee list. I’ve used their internal names.

    I’m guessing I need to add code in to link the function to a button so to trigger it on the list?

    Thanks again for your help Alex.

    mk3jamie
    Participant

    Yeah it was only 1 line and as always thank you very much Alex. Spot on solution.

    mk3jamie
    Participant

    Quick amendment to this Alex, would it be possible to have the field sync automatically rather than making use of a button?

    Kind regards,
    Jamie.

    in reply to: Set value from vLookup table to a field in the current form #18298
    mk3jamie
    Participant

    Hi Alex,

    This is an excellent solution. Does exactly what I was looking for, thanks again.

    Jamie.

    in reply to: Change Task Status field based on Predecessor Tasks #17301
    mk3jamie
    Participant

    Spot on Alex, works like a dream. Thank you for the help!

    Jamie.

    in reply to: Change Task Status field based on Predecessor Tasks #17277
    mk3jamie
    Participant

    Did a fresh install of DFFS and now the rule and the function both load in perfectly 🙂
    However the rule itself is not turning the task status field into a read-only field if there are still incomplete tasks. How do i go about setting up the rule to achieve this?

    Currently it’s set to kick in on form load and field change, and will set the Task Status field to “read only”

    in reply to: Change Task Status field based on Predecessor Tasks #17275
    mk3jamie
    Participant

    Tested it and still the same error message sadly, “function “” is undefined”. Anything else I can try Alex? Really dislike bugging you with these silly questions but i really do appreciate your help!

    Regards,
    Jamie.

Viewing 15 posts - 1 through 15 (of 16 total)