Community
Vault Customization
Share your knowledge, ask questions, and explore popular Vault API, Data Standard, and VBA topics related to programming, creating add-ins, or working with the Vault API.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Vault GetAllFileNamingSchemes

6 REPLIES 6
SOLVED
Reply
Message 1 of 7
raghulan
515 Views, 6 Replies

Vault GetAllFileNamingSchemes

I am trying to get all the naming schemes using the following code,

I am geting a null exception and soap exception.

 

VDF.Vault.Currency.Connections.Connection connection = e.Context.Application.Connection;

FileNmngSchm[] fns = connection.WebServiceManager.DocumentService.GetAllFileNamingSchemes();

//error;
foreach (var fsn_value in fns)
            {
                lView.Items.Add("================================");
                lView.Items.Add("Length: " + fsn_value.FieldLen.ToString());
                lView.Items.Add("Descr: " + fsn_value.Descr.ToString());
                lView.Items.Add("Id: " + fsn_value.Id.ToString());
                lView.Items.Add("IsDflt: " + fsn_value.IsDflt.ToString());
                lView.Items.Add("Name: " + fsn_value.Name.ToString());
                lView.Items.Add("Prefix: " + fsn_value.Prefix.ToString());
                lView.Items.Add("StartNum: " + fsn_value.StartNum.ToString());
                lView.Items.Add("Suffix: " + fsn_value.Suffix.ToString());
                lView.Items.Add("================================");

            }

 

Regards,

Raghulan Gowthaman Cert IV TAA, B.E,.
Senior Technical Consultant | Developer - R&D
A2K Technologies Sydney
Web : www.a2ktechnologies.com.au
www.civil3dforum.com | www.e4forums.com
www.zcodia.com.au
www.raghulangowthaman.com
6 REPLIES 6
Message 2 of 7
smithmat
in reply to: raghulan

You need to provide more information:

  • Where are you getting the null expcetion (stack trace)
  • What are the details of the soap exception (e.g. error code)
  • What version of Vault are you using?
  • Is this a Vault extension you are creating?  What kind?  Or where does this code live?

-  Matt

Message 3 of 7
raghulan
in reply to: smithmat

Null exception at 

 

lView.Items.Add("Length: " + fsn_value.FieldLen.ToString());

 

soap exception 106.

 

Vault 2015

 

yes its an explorer application, the code lives in the main claas inside the command.

 

could you give me code on how to access all the naming schemes, that would be great.

Regards,

Raghulan Gowthaman Cert IV TAA, B.E,.
Senior Technical Consultant | Developer - R&D
A2K Technologies Sydney
Web : www.a2ktechnologies.com.au
www.civil3dforum.com | www.e4forums.com
www.zcodia.com.au
www.raghulangowthaman.com
Message 4 of 7
raghulan
in reply to: raghulan

Guys,

 

 If anyone can provide me code snippet on how to get list of all the naming schemes that are stored that would be great.!!

 

Thanks.

Regards,

Raghulan Gowthaman Cert IV TAA, B.E,.
Senior Technical Consultant | Developer - R&D
A2K Technologies Sydney
Web : www.a2ktechnologies.com.au
www.civil3dforum.com | www.e4forums.com
www.zcodia.com.au
www.raghulangowthaman.com
Message 5 of 7
smithmat
in reply to: raghulan

I'm confused: are you getting a null reference exception or a soap exception?

 

For SoapException 106, here is the help information:

TransactionInvalidPrincipal

An example would be making a call without being logged into a vault for methods that require a vault

 

Do you have a logged in connection to vault?  

 

Is fns null when it comes back?  Or are you saying that fsn_value is null?

 

- Matt

 

 

Message 6 of 7
raghulan
in reply to: smithmat

I am getting the following null exception

 

---------------------------
Vault Professional 2015
---------------------------
System.NullReferenceException: Object reference not set to an instance of an object.

   at VaultADVTools.Apps.BulkFileCreator.btn_createFolders_Click(Object sender, create1.cs:line 74

 Yes I have a logged in connection and its working working if i try to get folder list of files, etc.

 

 I tried the following code to get that message.

 

FileNmngSchm[] fns = GV.m_connection.WebServiceManager.DocumentService.GetAllFileNamingSchemes();
            //FileNmngSchm fn = ;
            if (fns.Equals(null)) 
            {
                lView.Items.Add("null"); 
            }
            lView.Items.Add("Length: " +  fns.Length);

 It says fns is null.

 

Regards,

Raghulan Gowthaman Cert IV TAA, B.E,.
Senior Technical Consultant | Developer - R&D
A2K Technologies Sydney
Web : www.a2ktechnologies.com.au
www.civil3dforum.com | www.e4forums.com
www.zcodia.com.au
www.raghulangowthaman.com
Message 7 of 7
smithmat
in reply to: raghulan

I can confirm the behavior that GetAllFileNamingSchemes returns null in Vault 2015 even when there are file naming schemes existing.  I would assume that that is a defect.

 

It appears that Vault Explorer uses the method GetNumberingSchemesByType. So, you should be able to use that to work around the issue.  

 

Hope that helps,

- Matt

 

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report