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: 

generatefilenumber .NET

4 REPLIES 4
Reply
Message 1 of 5
Sined99
665 Views, 4 Replies

generatefilenumber .NET

Hello,

 

I Will make a command that get the next file number of a scheme, I have the following code:

private void bt_Click(object sender, EventArgs e)
        {

            login = new UserPasswordCredentials(
             "****", "****", "****", "****",
             true  // log in as read-only, which doesn't consume a license
             );
                       using (WebServiceManager serviceManager = new WebServiceManager(login))
            {
                try
                {
                    
                    string nombre = serviceManager.DocumentService.GenerateFileNumber(2, null);
                    LB.Text = nombre;

                }
                catch (System.Exception ex)
                {
                    MessageBox.Show(ex.ToString(), "Error");
                    return;
                }
            }

 But When I run the program it throws the 303 Exception...Permission Invalid

 

With this credentials I can acces to Vault Workgroup without problem

 

I attached a file with the scheme. My scheme contains 2 Predefined List fields and a sequential number. I dont know if my params are the correct for the GenerateFileNumber method, the first is the Scheme ID but the second is the string[] fields, I dont know if I must put the text of a predefined list for example "Z1" or only an index "1"....

 

I use Vault workgroup, and Visual studio 2010

Thank you very much.

 

 

 

4 REPLIES 4
Message 2 of 5
Redmond.D
in reply to: Sined99

In the SDK documentation, each web service function has a "Required Permissions", which tells you the permission needed to make that call.   For GenerateFileNumber, FileChangeFileNumber is the permission.  If you go to the global administrator settings, you can see what the permissions are for all the roles.  You need to be an Administrator, an File Editor or an Item Editor/Reviewer in order to generate a file number.

 



Doug Redmond
Software Engineer
Autodesk, Inc.

Message 3 of 5
Sined99
in reply to: Sined99

Hello,

 

Yes the user I have is administrator, but I dont really know how to put the params of the generatefilenumber(...), attached is a photo for my scheme, I dont know how to set the string[] params...any help?

Message 4 of 5
Redmond.D
in reply to: Sined99

The params field is for data that the Vault Server can't figure out on it's own.

For example, your Campo1 field can be 1 of 3 values, but the server doesn't know which one you want.  So you have to pass that in as a param.  Same for Campo2. 

The server controls the Auto-generated values, so you don't need to pass in anything for Campo3.

 

So your params array may look like this {"Z3", "100"}.  The order of the params needs to match the order of the fields in the numbering scheme.



Doug Redmond
Software Engineer
Autodesk, Inc.

Message 5 of 5
raghulan
in reply to: Redmond.D

Hello Mate,

I passed all the values to the array but the number generated is not in the proper order..

============================
Data from UI controls in order
-----------------------------------------------
UIObj: tBlock_0Val == >> A2K
UIObj: tBlock_1Val == >> -
UIObj: tBlock_2Val == >> FIXED
UIObj: tBlock_3Val == >> -
UIObj: tBox_3Val == >> FREETXT
UIObj: tBlock_4Val == >> -
UIObj: cBox_4Val == >> dwg
UIObj: tBlock_5Val == >> -
UIObj: tBlock_6Val == >> WG1
UIObj: tBlock_7Val == >>
============================
Data from string array in order
-----------------------------------------------
----FLD : A2K
----FLD : -
----FLD : FIXED
----FLD : -
----FLD : FREETXT
----FLD : -
----FLD : dwg
----FLD : -
----FLD : WG1
----FLD :
============================
Final generated file number is all mixed
-----------------------------------------------
A2K-FIXED-A2K---WG10000012
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

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

Post to forums  

Autodesk Design & Make Report