This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Read/Write multiselect property

Former Member
Former Member
Guys, I again need your help. I'm going crazy with a (i think simple) problem, maybe you can help me out?
I've got a "onboarding" document, containing a multi-select property called "Department". It's a simple "choose from list Departments (multiselect).
At the And of the Onboarding, I create a Employee Object in the workflow and "copy" some of the onboarding property values. That works fine! I can copy text and single select (lookup).

What drives me crazy is to read a multiselect and write the same values to the "same" property in the new employee object.

I tried alot... at the moment i try it this way:

Read Multi-Select property

...
' Abteilung/Department
Dim ilookups_abteilung : set ilookups_abteilung = PropertyValues.SearchForProperty(1234).TypedValue.GetValueAsLookups
...


Write to the new object

...
' Abteilung
oPropVal.PropertyDef = 1234
oPropVal.TypedValue.SetValue MFDatatypeMultiSelectLookup, ilookups_abteilung
oPropValues.Add -1, oPropVal
...


That gives me a "type conflict"
What's the problem?
Regards
Chris
  • Hi,

    The "why" is because you're passing the Lookups object to the SetType method. See the notes on this page:
    www.m-files.com/.../index.html

    Specifically this:

    If the data type of a typed value is MFDataTypeMultiSelectLookup, the caller can supply lookups in one of the following two ways:
    1. By passinga single integer. A single primitive integer is interpreted to be the ID part of a lookup. In this case, the multi-select lookup consists of only one lookup.
    2. By passing a two-dimensional array containing the IDs and display values of lookups. The IDs must be located in the first column and the display values in the second one.


    If you have a Lookups object then the easiest option is to use SetValueToMultiSelectLookup instead:
    www.m-files.com/.../index.html

    Does that help?

    Regards,

    Craig.
  • Former Member
    Former Member
    Dear Craig,

    thank you very much for your detailed explanation!
    SetValueToMultiSelectLookup was exactly the missing part! You made my day!!!

    I'm really happy to find (slowly) into M-Files VBScripting. Because we use more and more workflows, it would not be possible to solve some needs without that.

    Many regards
    Chris
  • Not a problem a all.

    I would also highlight that an alternative to developing in VBScript exists in the Vault Application Framework (VAF): developer.m-files.com/.../

    The VAF may not be something that you look at initially, as it requires a skillset that you may not have in your organisation. What I will say, though, is that the more complex your scripts become, the harder they become to maintain in VBScript. The VAF provides a framework that can be leveraged to make your code less brittle, find issues before deployment, and aid in debugging complex issues.

    That said: VBScript is not going anywhere.

    Regards,

    Craig.
  • Former Member
    Former Member
    Dear Craig,
    during my research of the m-files API i even found your posting where you described the "first steps" with VAF. It looked interesting but as a absolute beginner i had two problems.

    1. I din't understand exactly what the VAF is and how it works.
    For me it looked like applications, developed in visual studio, that are (after compiling) installed on the m-files server and running there in some way?. When i got it right, the advantage is that many bennefits of Visual Studio can be used (f.e. code debugging).
    From my flat point of view this seemed to be a little bit "overkill" if I only want to do some simple operations during workflow changes, for example. Set some properties, create a object...? Maybe I can't see the big picture at the moment? ;) Is it overkill or the best tool for daily scripting work?

    2. I couldn't get it to work!
    I downloaded this "inofficial m-files api template" for Visual studio, but i didn't get it installed.
    Even for me it felt like the M-Files company isn't really interested in taking "normal" users by the hand and leading them into API development, maybe I'm wrong here?

    In my perception the absoulte best demonstration of the VAF would be a 5 minute youtube screen-recorded clip, showing how to install the api tamplate and creating a "hello world" application. Or setting some properties in the demo vault. Step by step That would be heaven!
    The first steps are the hardest ;)
  • Hi Hansecontrol,

    Firstly, let me say that I am sorry that you feel that the experience has been negative so far, and I hope that we can do something about that. The "first steps" articles that you found, I believe, were probably my old LinkedIn articles. These were published a couple of years ago, before I started working at M-Files. As you yourself noted: the template you tried to use was unofficial, and I have heard others have had issues as well. The VAF could be seen as overkill for smaller projects, I concur, but it is mainly aimed at more complex solutions, looking to improve code quality (e.g. type checking), and aid with debugging, maintenance and unit testing.

    That said: I completely take your points on board. M-Files is most definitely interested in ensuring that our worldwide developer family have the information they need to do amazing things. Since I joined M-Files just under a year ago, we have started to publish much more content publicly. This includes the creation of the developer portal (http://developer.m-files.com), which has dedicated sections on the APIs and Frameworks that we provide. This is an ongoing process, and we're far from where we would like to be, but hopefully you will start to see that changing.

    Some points I would raise here:
    1. My role is as a "Partner Developer Evangelist". That is to say that my primary focus is supporting our partners who are developing software. However, my general approach is to always publish content publicly whenever possible to try and also allow developers at our end-users to take advantage of it.
    2. The primary publishing focus for developer resources (code samples, tutorials, introductions, etc.) is the Developer Portal. We have a "what's new" section which shows the content we're adding. You'll notice this has reduced slightly recently, primarily as I am creating content for the 2018 release.
    3. In addition to the public content, the amount of (secured) partner content has grown considerably as well. As an end-user this isn't available to you (yet), unfortunately, but I can see that changing over time as well.
    4. We have a developer newsletter which we are publishing 3 or 4 times per year, going to both end-users and partners. The first one went out in late September. Please let me know if you'd like me to add you to this (sending me a private message is probably easiest).

    In terms of the content that you wanted, let's see what we can do here:
    1. Currently the official Visual Studio VSIX for the VAF is only available to partners. However, I will ensure that your partner is aware of this request and I am sure that they will be able to provide it across to you. Please note that any support for this will need to go through your partner, which may be charged, as we have no official "direct" developer support.
    2. There is already an example of creating a "hello world" application using the template available in the M-Files Developer Portal. Hopefully this helps: developer.m-files.com/.../.
    3. We have published two webinars on "getting started" with the Vault Application Framework to our partners. The first is introductory and talks about what the VAF is, how it works, and why partners should use it. The second is practical and shows actually building and deploying VAF applications for a couple of simple scenarios. I will ensure that your partner is aware of your interest in this as well, as the recordings are available to them.

    Again: I take the points you raised very seriously. Please, let's discuss this further via a private message, and we'll see what we can do to help. Any suggestions you have around content that may aid others in your situation can be added to my backlog and we can see what we can do in the future.

    Regards,

    Craig.
  • I would add to Craig's comprehensive answer that as a consultant who needs to develop custom solutions every now and then I prefer using VAF even for "the small things". Once you get the hang of it, it really just takes minutes to create a new application and get it installed.

    From an administration and maintenance point of view, there's the added bonus of being able to see the list of vault applications which customize the vault functionality (as opposed to hunting through a dozen menus to find out if some workflow states have custom scripts associated and so on). It also makes it easier to build a new environment when you can just install the vault applications which provide the functionality and not having to copy-paste scripts to different places in M-Files Admin.

    Anyway, this is a bit off-topic...
  • Dear Chris

    Even for me it felt like the M-Files company isn't really interested in taking "normal" users by the hand and leading them into API development

    Making visual studio template only available to partners gives me same impression.

    In my experience VAF is great thing.
    I was able get it working using 2 years old template https://github.com/RothAndrew/M-Files-Template---Vault-Application-Using-VAF by following Readme.md
    Reading Craig Hawker's Linkedin posts helped me: https://www.linkedin.com/pulse/getting-started-m-files-vault-application-framework-craig-hawker/

    Maybe this helps you too.

    Best Regards,
    Tigu
  • Making visual studio template only available to partners gives me same impression.


    I can definitely see that point of view, and it's a discussion that I've had with a number of people. I personally feel that it would not be professional of us to provide the VSIX across to end-users without having a support network in place in case they have issues. You have to remember: when this was originally published, we didn't have the developer portal or any other supporting resources for end-users.

    As we move forward and the amount of public content for the VAF grows, we may feel more comfortable with publishing this more widely, but we (currently) do ask that the VSIX is obtained through your partner or account manager at M-Files. This allows them to discuss with you what support they can provide. I know that we have a number of larger (or more technical) end users that have been given access to the VSIX through their partners and are actively developing solutions. I - again, personally - have no issue with this, provided you - as an end-user - have some support network in case of issues.

    Regards,

    Craig.
  • Former Member
    Former Member
    First and most importantly, to the M-Files team on this forum, thank you for your candid discussion. You guys make this forum better, and an excellent resource that I visit daily. Specifically, I appreciate Craig and Joonas's contributions. Furthermore, an open dialog on these topics are helpful.

    While I don't have much insight on "Read/Write multiselect property", I'll toss my 2 cents in here as well.

    I am a new (6 month) M-Files end-user. I have hacked together some Workflow VBS to achieve what I have wanted. Most of these end up being relatively simple (

    I also have not made the jump to the VAF. The startup expense is a bit daunting. However, I can certainly see the benefits as well.

    That perhaps brings us to the bigger picture; using a dedicated partner to distribute a subset of solutions. The M-Files software pretty much speaks for itself. You can download the demo and get started immediately. The API documentation is excellent, and you can start writing VBS scripts right away. I can call software support, and get someone on the phone. This forum is another great resource, that I can access myself.

    However, when it came time to purchase the software, it required a SPOF contact with a rep. A few months back their communication was intermittent. With that being said, when it became time to purchase, they did seem responsive. However, it seems like an odd person for me to contact to get a Visual Basic Studio template. We are a small account (10 licenses), and I almost feel guilty bothering him . Furthermore, I don't know what is available, and am a bit naive on what to ask for, to potentially enhance our experience.

    Just my 2 cents. That being said, I should jump in to VAF. Who should I contact to get all the tools to get started?
  • Hi djb,

    Thank you for your kind words, which I am sure that Joonas will also see.

    I certainly respect those points and this earlier conversation actually prompted me opening some additional internal dialogs about this. We do want to ensure that end-users have support, and that is our utmost concern, but let's see what the future brings.

    In terms of moving you forward - please drop me a private message with your company details. I can find your reseller or account manager, and can open a conversation with them about getting you the tools you need. All you technically need from us to move forward - in addition to both having Visual Studio locally, and the content that is already available on the developer portal - is the Visual Studio template (.vsix) file.

    Regards,

    Craig.