function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
swatijainswatijain 

Get the URL where the document was just created

Hi,

 

I want to create folders and upload documents in SalesForce from .net code.  I am able to do both.  

Next, I want to store information about the user, the created document and the url where he created the document in sql server.  

 

As soon as I create a document using -  SFEnterpriseWSDL.SaveResult[] results = binding.create(sdocObj), I get back results.

 

But, I can not get the URL where the document was created using this.  Any idea how can I get this information back.

 

Swati 

Best Answer chosen by Admin (Salesforce Developers) 
swatijainswatijain

Figured the solution  ---get the url for the tab documents and attach folder id .... 

 

//Get tab url
                            string url = "";
                            SFEnterpriseWSDL.DescribeTabSetResult[] dtsrs = binding.describeTabs();
                            for (int y = 0; y < dtsrs.Length; y++)
                            {
                                SFEnterpriseWSDL.DescribeTabSetResult dtsr = dtsrs[y];                              
                                DescribeTab[] tabs = dtsr.tabs;
                                for (int j = 0; j<tabs.Length; j++)
                                {
                                    SFEnterpriseWSDL.DescribeTab tab = tabs[j];                                   
                                    if (tab.label.ToString() =="Documents")
                                        url = tab.url; 
                                }
                            }

                            //remove the last /0 from url and add folder id
                            int iLastIndexUrl = url.LastIndexOf("/");
                            url = url.Substring(0, iLastIndexUrl);
                            string concatfolderid = folderId.Substring(0, folderId.Length - 3);
                            url = url + "?fcf=" + concatfolderid;

All Answers

swatijainswatijain

Figured the solution  ---get the url for the tab documents and attach folder id .... 

 

//Get tab url
                            string url = "";
                            SFEnterpriseWSDL.DescribeTabSetResult[] dtsrs = binding.describeTabs();
                            for (int y = 0; y < dtsrs.Length; y++)
                            {
                                SFEnterpriseWSDL.DescribeTabSetResult dtsr = dtsrs[y];                              
                                DescribeTab[] tabs = dtsr.tabs;
                                for (int j = 0; j<tabs.Length; j++)
                                {
                                    SFEnterpriseWSDL.DescribeTab tab = tabs[j];                                   
                                    if (tab.label.ToString() =="Documents")
                                        url = tab.url; 
                                }
                            }

                            //remove the last /0 from url and add folder id
                            int iLastIndexUrl = url.LastIndexOf("/");
                            url = url.Substring(0, iLastIndexUrl);
                            string concatfolderid = folderId.Substring(0, folderId.Length - 3);
                            url = url + "?fcf=" + concatfolderid;

This was selected as the best answer
Karthi_VeluKarthi_Velu

Hi,

 

I have tried the above code but getting error in SysLog: ERROR - Compile error: Invalid type: SFEnterpriseWSDL.DescribeTabSetResult 

 

i want to get the webtab URL from Apex Controller.