Alexander Bautz

Forum Replies Created

Viewing 15 posts - 4,036 through 4,050 (of 4,555 total)
  • Author
    Posts
  • in reply to: Display and click through to attachments on child list #9132
    Alexander Bautz
    Keymaster

    Here is a modified version that should work in SP2010:

    function getAttachments(id){
    var url = _spPageContextInfo.webServerRelativeUrl+"/_vti_bin/ListData.svc/TheNameOfTheList("+id+")/Attachments";
    	$.getJSON(url, 
    		function(data) {
    			var b = [];			
    			spjs.$.each(data.d.results,function(i,o){
    				b.push("<div><a href='"+o.__metadata.media_src+"' target='_blank'>"+o.Name+"</a></div>");
    			});
    			spjs.dffs.dlgBox(b.join(""),true);
    		}		
    	)
    }

    Change “TheNameOfTheList” with the name of your list like it is shown in the “href” attribute when you access this URL:

    https://YourSiteUrl.com/YourSite/_vti_bin/ListData.svc

    The record looks like this:

    <collection href="TasksListTest">
    <atom:title>TasksListTest</atom:title>
    </collection>'

    Alexander

    in reply to: I have a form with 77 triggers . . . #9130
    Alexander Bautz
    Keymaster

    Hi,
    When you have this many rules, you should use the “No reversing of this rule” for any rules you don’n want to “reverse” if they do not match. Use the “Stop if this rule = true” and maybe the “and jump to” to skip rules that does not have to be validated.

    If you don’t use these options, all 77 rules will be evaluated when you load the form.

    Also you should put vLookups in separate tabs to prevent them from loading when the form loads. If you do this, the vLookup will only be loaded if you click the tab containing the vLookup.

    Hope this helps,
    Alexander

    in reply to: Resize textarea in IE #9098
    Alexander Bautz
    Keymaster

    I’m not so familiar with it, but if it supports “select” tags you might be able to address these and use it. You would have to test it to see.

    Alexander

    in reply to: Save on Edit form returns to Dispform instead of list view #9094
    Alexander Bautz
    Keymaster

    Hi,
    I’ll look at changing this / making it an option for the next release, but until then you can use this code in the custom js in your dispform to override the current DFFS function:

    spjs.dffs.editItemWithTabIndex = function(){
    	var s, r, u = location.href.replace(/dispform.aspx/i,"EditForm.aspx");
    	r = "";
    	s = spjs.$("#tabWrapper").find('li.tabSelected').attr("tabIndex");
    	if(s!==undefined){
    		r = s;
    	}
    	if(spjs.dffs.data.sTabUseCookie){
    		spjs.dffs.setTabCookie(spjs.dffs.data.tabCookieName.replace("DispForm.aspx","EditForm.aspx"),r);
    	}
    	if(GetUrlKeyValue("ContentTypeId") === ""){
    		u = u.replace("&ContentTypeId=","");
    	}
    	if(spjs.dffs.data.editFormInDlg){
    		spjs.dffs.openEditFormInDialog(u);	
    	}else{
    		location.href = u;
    	}
    }

    Alexander

    in reply to: Task Related Items on EditForm #9091
    Alexander Bautz
    Keymaster

    If you just want to show them in EditForm you can use something like this to read the values:

    var res = spjs.utility.getItemByID({"listName":_spPageContextInfo.pageListId,"id":GetUrlKeyValue("ID"),"viewFields":["RelatedItems"]});
    alert(res.RelatedItems);

    This will output something like this (two related items):

    [{"ItemId":31,"WebId":null,"ListId":null},{"ItemId":45,"WebId":"5b315066-48ba-42b1-9ef1-1387b67dcd9b","ListId":"5f82a17a-d27b-4f6d-8c2b-fa201e40b40b"}]

    This must then be converted into a proper “link”, but if it is internally in one list you can use the “ItemId” directly to create the link using “/Site/List/DispForm.aspx?ID=XYZ”.

    PS:If the link is internal in the list, the ListId and WebId parameter is null.

    Alexander

    in reply to: Resize textarea in IE #9086
    Alexander Bautz
    Keymaster

    Hi,
    You should be able to refer this library (JS and CSS files) in your CEWP (or custom area in JSLink setup) and address the textarea like this:

     $(function() {
        $("#dffs_textAreaFieldInternalName").find("textarea").resizable({
          handles: "se"
        });
      });

    Change “textAreaFieldInternalName” for your fields internal name.

    Please note that this will work for plain text fields only.

    Alexander

    Alexander Bautz
    Keymaster

    Hi,
    The CAML depends on the type of the fields “Associate_x0020_Name” and “Defect_x0020_Type” are, but basically your CAML should look like this:

    <Where>
    <And>
    <And>
    <Eq><FieldRef Name="Associate_x0020_Name" /><Value Type="Text">[currentItem:Associate_x0020_Name]</Value></Eq>
    <Eq><FieldRef Name="Defect_x0020_Type" /><Value Type="Text">[currentItem:Escalation_x0020_Category]</Value></Eq>
    </And>
    <Geq><FieldRef Name="Defect_x0020_Date" /><Value Type="DateTime"><Today OffsetDays="-365" /></Value></Geq>
    </And>
    </Where>

    Alexander

    Alexander Bautz
    Keymaster

    Hi,
    Use the trigger “Compare logged in user with people picker field” and specify “Author” in the “This value” field. You find information by hovering over the help icon.

    Alexander

    in reply to: Function to Create _vlookupID #9058
    Alexander Bautz
    Keymaster

    This is what I use in the vLookup solution:

    var theUniqueID = _spPageContextInfo.userId+":"+new Date().valueOf();

    Alexander

    in reply to: Task Related Items on EditForm #9056
    Alexander Bautz
    Keymaster

    Hi,
    It’s technically possible to have the related items functionality visible in EditForm, but if you change the related items, you are updating the current item – and will receive a save conflict when trying to save the form.

    Therefore it is unfortunately not very practical to have it in other than the DispForm.

    Alexander

    in reply to: Rules based on Content Type not working (WSS 3.0) #9041
    Alexander Bautz
    Keymaster

    Yes, the column is not found in a default NewForm, but is selectable in DFFS backend. This calls for and easy misunderstanding.

    You can use a trigger looking at the “ContentTypeId” in the query string of the URL – look at the trigger “URL Query string key equals” in the rules and create rules based on the various “ContentTypeId” strings.

    Alexander

    in reply to: Redirect from NewForm to EditForm in DFFS #9034
    Alexander Bautz
    Keymaster

    You must split the date and reassemble it in the correct format. If your date format is “US” like this: 10/27/2015 you can use something like this:

    var d = getFieldValue("TheDateColName").split("/");
    data.End_x0020_of_x0020_Week_x0020_Da = d[2]+"-"+d[0]+"-"+d[1]+" 12:00:00";

    Alexander

    in reply to: Save on Edit form returns to Dispform instead of list view #9032
    Alexander Bautz
    Keymaster

    Are you opening the form from DispForm or from a list view? I have done some changes to the “Source” when editing an item from DispForm so it might be this causing the problem.

    Alexander

    in reply to: Rules based on Content Type not working (WSS 3.0) #9029
    Alexander Bautz
    Keymaster

    Hi,
    In which form are you trying to use the ContentTypeChoice (the same columns, just named differently in DFFS)?

    Alexander

    in reply to: Save on Edit form returns to Dispform instead of list view #9023
    Alexander Bautz
    Keymaster

    Hi,
    I suspect the “Launch EditForm in a dialog from DispForm” setting in the Misc tab can be the problem here. Can you enter DFFS backend and look at the Misc tab to see if this is checked?

    Alexander

Viewing 15 posts - 4,036 through 4,050 (of 4,555 total)