Sharepoint online list Create Folder and insert item in it - list

I am trying to create folder into share point list and add items into newly created folder.
Currently i am open newform.aspx page with folder path which was not already exists as below:-
https://sharepointonline.com/sites/SiteName/Lists/ListName/NewForm.aspx?IsDlg=1&RootFolder=/sites/SiteName/Lists/ListName/Folder1/Folder2
When user click on save button with items details i am creating Folder1 and Folder2 using code into presave. Folders are created successfully but item is not inserted into it, it throws error that folder path not exists.
If i refresh page and try to add item, it will easily inserted into folder.
Please help me in this.

JSOM/Rest api are asynchronous,you should try to delay the add item function and return when previous function complete.
Try to use jQuery Deferred for this case.
You may check this thread for a sample demo.

Related

sitecore Copy bucket item issue

Issue with the copy functionality.
When I try to copy any bucket item to another item(bucket or non bucket item) on selection of item in content tree it works fine.
But when the same has been attempted by mentioning the path of destination folder in path field of “Copy item to dialog box” it creates a copy in the same parent.
Please follow below mentioned steps to recreate the scenario mentioned above.
Right click on the item to be copied.
EDIT the path field with desired destination field and click copy button.
Item is created under the same parent though path mentioned in the Path field was different
Note: If the case is like we have to select item in the content tree, and mentioning the path in the path field is of no use, Can I get a patch where path field is disabled.
Bucketed items loose their parent-child relation. To put simply, programatically, we cannot find the parent of a bucketed item. This is not an answer to your question but it can help to investigate further. If 'Copy To' functionality using 'Path' field needs to know the parent of current item, then it will not work in case of bucketed item. In worst case it may end up creating a duplicate of the item in same hierarchy.

Copy List Item to Folder in Seperate List

I have two lists, List A and List B. I have folders in List B. Can I set up a workflow that copies list items from List A to a specific folder in List B?
Yes but it does'nt seem the most appropriate.
You could use a custom action available in the ribbon or in the edit control block.
When you select a folder, you click on this custom action and launch a javascript function or a postback. And then, you program your copy.
Custom action :
http://www.c-sharpcorner.com/article/adding-custom-action-to-the-ribbon-of-view-in-sharepoint-list-library/
Code example to move folder:
Moving a SharePoint folder and contents to different location in same Document Library

Which .XML file are using for Insert Link button of General Link field in Sitecore 7.2

Can anybody tell me which .xml file are using for Insert Link button of General Link field in Sitecore 7.2.
I have tried to update below files but all are not affecting -
Sitecore.Shell.Application.Dialogs.InternalLink-InternalLink.xml
Sitecore.Shell.Application.Dialogs.InsertLink-InsertLink.xml
Sitecore.Shell.Application.Buckets - BucketInternalLink.xml
Sitecore.Shell.Application.Buckets - InsertLink.xml
I think under Buckets folder files are using in case of General Link field with Search
I have tried for all
If I am updating other files like
Sitecore.Shell.Application.Dialogs.ExternalLink - ExternalLink.xml
then it's showing updates in Sitecore but in case of insert link no one files are working.
Thanks in advance
check out my blogpost about fixing the internal link. It might prove difficult to extend but it is possible. At least I have been able to override the class and pass the preLoadPath.
http://reinoudvandalen.nl/blog/fixing-sitecore-7-internal-link-with-speak/
In Sitecore 7.2 the XML Insert Link Dialog is replaced by the new SPEAK UI Dialog. The actual url of the insert link dialog is located on
http://[yourdomain]/sitecore/client/applications/dialogs/InsertLinkViaTreeDialog
The actual file is located in the core database under: /sitecore/client/Applications/Dialogs/InsertLinkViaTreeDialog.
From there you can navigate to the appropriate renderings and modify them (which might affect other windows.
If you want to enable the old style InsertLink that uses the InsertLink.xml you can disable it from /App_Config/Include/Sitecore.Speak.config and remove the following line:
<override dialogUrl="/sitecore/shell/Applications/Dialogs/Internal%20link.aspx" with="/sitecore/client/applications/dialogs/InsertLinkViaTreeDialog" />

How can you rename a wiki page in Fossil SCM?

How can I rename a wiki page in Fossil SCM?
In my particular case, I'd like to rename my project (in Admin, Configuration, Project Name), but if I do that then when I click Home in the main menu nothing is displayed, because there's not yet a wiki page whose name matches my new Project Name. I'd like to rename my project, and rename my (sole) wiki page to match.
You can’t rename a wiki page, because wiki pages are identified by their name; that would be tantamount to deleting the old page. And you can’t delete a wiki page; Fossil never deletes an existing artifact.
But you can create a new wiki page (with your project's new name), and copy the old page's contents to the new one. If you remove all the text from the old wiki page, that old page will disappear from the list of wiki pages.
There's something to be said for a wiki rename command that would implement this sequence of actions automatically, but that hasn't been done so far. You can post a request on the fossil forum, and see if one of the developers picks it up. :-)
In principle it can be renamed by running the following in a SQLite file editor (if you try it from the "Raw SQL Commands" page, only the first UPDATE is successful):
UPDATE attachment SET target='new name' WHERE target='old name';
UPDATE event SET comment=':new name' WHERE comment=':old name';
UPDATE event SET comment='+new name' WHERE comment='+old name';
UPDATE event SET comment=replace(comment, '[old name]', '[new name]') WHERE comment like '%[old name]%';
UPDATE tag SET tagname='wiki-new name' WHERE tagname='wiki-old name';
At first glance it works but then you will not be able to update the content (which in fact can be useful to protect an article).
For the renaming to be effective you also have to modify the binary blob that contains the article, as well as update the deltas in case you have made previous edits.
I was working on this script that does the above automatically. To use it you have to execute the following in a console:
fossil_editor.py oldname newname repo.fossil
If everything goes well, something like this should appear:
This is fossil version 2.16 [7aedd56758] 2021-07-02 12:46:01 UTC
Artifact 61e7cc32f7 updated to 84b8195fe6
Artifact c2290869ad updated to 3ff4f96773
Artifact e993cd0331 updated to bc7e8d52df
References updated

SharePoint - List of Folders

I'm trying to implement a list where the only item type is a folder. If someone click "New" they are brought to a form that allows them to enter a folder name, description, and select either "Active" or "Inactive" from a drop-down menu. Inside the folder I want a simple list with only 2 columns.
I tried making a custom Folder content type with the columns I needed and making it the default content type. This seems to work to make the list of folders. Once I go inside the folder and try to change the internal view/list setting (I don't want to use the custom folder content type inside the folder...i just need 2 simple columns) it changes the settings for the list of folders as well. Is there any way for the internal list to have different settings than its parent?
I don't know if this issue is still relevant, but maybe someone else will find my answer useful.
I used to implement a list that contains only folders in the root, which in order can contain few item based content types.
There was two event receivers for FeatureActivated and ItemAdded events, which changes UniqueContentTypeOrder property (the list of content types available for user to create) of the lists root folder and a folder being created respectively. Like this:
List<SPContentType> ctl = new List<SPContentType>();
foreach (SPContentType ct in lst.ContentTypes) if (ct.Id.IsChildOf(SPBuiltInContentTypeId.Folder)) ctl.Add(ct);
lst.RootFolder.UniqueContentTypeOrder = ctl;
lst.RootFolder.Update();
Also, I designated different available list views for root folder and the folders it contains, by specifying ContentTypeID attribute for a View definition.
Unfortunately, no. Since SharePoint is Lists are not relational data, the only options to you are allowing several Content Types. If a content type is available to the list, it's available to the entire list (root, and sub-folders).
One possibility to model what you are trying to accomplish relies on SharePoint 2010 Enterprise. Infopath allows you to customize the New Item Form for a List. It might be possible to edit the form such that it only allows Folders on the Top Level, and List Items within a folder, but I don't know for sure - it's been a while since I customized a List Form with Infopath.