I have a Configuration for Vault Client and Data Standards that generates a Number by clicking a Button. For this I use PsCmd[] to call my own function. In Vault 2014 it works fine. But in Vault 2015 the new File Dialog won't create any Files if I use this Button, even if the function that is called does nothing, the file creation failed. If i do not use any Buttons I can create Files as it should be.
In Inventor 2015 I can use my Button methods without any Problems.
If I turn on the Log Window, i can see, that the new File Dialog is returning "False" if I have used my Button. If i do not use it, the Dialog returns true. But I have no Idea why I have this behavior.
Can anybody help me with this issue?
hi there, could you please:
1.) look into the c:\temp\DataStandard*.log files and see if there is an exception?
2.) could you post the piece ox XAML and PowerShell that you are using?
in the first place, there should be no reason why your DS dialog that works with 2014 should not work with 2015. There are either some version specific API calls, or something strange. So, if could share a bit of code, i might get a better picture.
thanks!
ciao
marco
Hi,
in the Errorlog I get the follwing failure:
2014-08-18 14:18:03,521 [1] FATAL Common.Vault.VaultServices - AddFile failed with exception
System.ArgumentNullException: Der Puffer darf nicht NULL sein.
Parametername: buffer
bei System.IO.MemoryStream..ctor(Byte[] buffer, Boolean writable)
bei Common.Vault.VaultServices.AddFile(Int64 nFolderId, String fileName, String strComment, DateTime dtLastWrite, FileAssocParam[] associations, BOM bom, FileClassification fileClass, Boolean bHidden, ByteArray fileContents)
But for me, there is no reason in my code for this.
Xaml File:
<Grid Grid.Row="4" Grid.Column="1" Height="26" Visibility="Visible"> <Grid.ColumnDefinitions> <ColumnDefinition Width="2*" /> <ColumnDefinition Width="8" /> <ColumnDefinition Width="*" /> </Grid.ColumnDefinitions> <TextBox Grid.Column="0" Grid.Row="0" IsReadOnly="True" Name="tb_file_name" Background="#F0F0F0" Margin="0,0,0,1"/> <Button Grid.Column="2" Grid.Row="0" Command="{Binding PsCmd[myNumberGenerator]}" Content="Nummer generieren" Name="BtnGenerateNumber"/> </Grid>
Ps1 File:
function myNumberGenerator { }
So my function does nothing. If I do not click my button, it works perfektly, no errors and a new vault file. Only if I click this button, I have this behaviour.
I use the same Button call in VDS2014 and this works, even if I use a function that does something productive work.
the error message is clear, the AddFile throws an error, but the reason is unclear. Could you please make a zip of your DS\Vault folder and attached it? from what i can see the xaml code is clear, and if you function really does nothing, then there must be something in between.
thanks
ciao
marco
I just instaled your configuration. Wow, it's quite custom. Of course i get a lot of error messages as my Vault nevironment does not have all the properties you have configured on your side.
From what i can see, the function you are calling is a custom function called myNumberGenerator, and i have found it only in one PS1 file, so there are no conflicts or the like.
Now, the error moessage from the Log file that you have posted (...FATAL Common.Vault.VaultServices - AddFile...) clearly refers to the action of creating a file in Vault. This command is called when you hit the OK button of your dialog.
I'm wondering if there is another error message in the log file when you hit the Generate Number button. So, please
Could you alsp please do another test:
in both cases, either the messages in the log as per the first test, or then the "recreation" of the dialog starting with the default 2015, let us know what the outcome is. It would be good to either have a more precise error message, or a dialog which is less customized. I can start configureing my Vault in order to match your customizations, but it will take a while.
let me know about the 2 tests described above.
thanks!
ciao
marco
Hi Marco,
i started testing your hints. It seems, that I have found the mistake. If I click on the button, the combobox with the template gets empty. There is no reason for me why this happens, but if you select a template again, it works. So I'll do something that remembers the previous selection and sets them back after my button call. This will work for me. I'll test this within the next days and give a feedback. Very much thanks for your help.
Hi, I'm glad I was able to give you at least some advice where to look. The thing that a button press changes the content of the combobox is not normal and quite weird. It smells to me like some internal binding problems. Comboboxes are very sensitive to this as a combox is a mix of a listbox and a textbox. So, it has an itemssource for the data to be displayed and a single selected item/value for the item chosen by the user. If the itemssource changes/refreshes, the selected item gets reset. Now, how does the button affect the combobox? I don’t know, but I can imagine that there might be an according error in the log file the very moment you hit the button.
Another thing that is worth to look at is to compare your XAML with the 2015 standard XAML. Or start with a blank 2015 XAML and add gradually your customization. It take some time, but the moment it breaks you know exactly the piece which causes trouble, and usually you then get a AHA-effect.
I tested a few things within my Configuration. I got a workaround for my problem, but the real reason why this happens is still not clear. It seems that I have some side effects with my validate functions. The standard configuration of vds 2015 works without problems, also when I put in a button for calling functions. So it must be something within my own code. Maybe I'll find it out, but at this time I'll use my workaround. Thanks for the great help!!