Bentley Communities
Bentley Communities
  • Site
  • User
  • Site
  • Search
  • User
ProjectWise
  • Product Communities
ProjectWise
ProjectWise PowerShell Extensions Forum Add-PWSavedSearch syntax for $FIELD$ search
    • Sign In

    • State Suggested Answer
    • Replies 15 replies
    • Answers 1 answer
    • Subscribers 66 subscribers
    • Views 1094 views
    • Users 0 members are here

    Add-PWSavedSearch syntax for $FIELD$ search

    Thomas Bogø Nissen
    Offline Thomas Bogø Nissen 9 months ago

    According to the change log, support for $FIELD expression was added in PWPS_DAB version 2.1.18.0

    using the following powershell code:

    $AuditUser = 'thbn'
    $SearchField = "`$FIELD(10)`$ = (SELECT DISTINCT o_userno FROM dms_user WHERE o_username in ('$AuditUser'))"
    $AuditSkabelon = 'Innovationsprojekter\Test_THBN\'
    $SearchFolder = 'Større anlæg\7x\'
    
    Get-PWRichProjects -FolderPath $AuditSkabelon -JustOne | 
    Add-PWSavedSearch -SearchName 'CAD-files' -Environment 'Dokument' -DocumentName $SearchField -SearchFolder $SearchFolder -SearchSubFolders -UpdatedAfter 10/10-2020 -ReplaceExisting -Verbose

    Gives the following in the search builder:
    ='$FIELD(10)$ = (SELECT DISTINCT o_userno FROM dms_user WHERE o_username in ('thbn'))'
    
    however, this was the expected search result:
    $FIELD(10)$ = (SELECT DISTINCT o_userno FROM dms_user WHERE o_username in ('thbn'))

    Do we have any examples for writing the $FIELD expression ?

    • Sign in to reply
    • Cancel

    Top Replies

    • MWBSI
      MWBSI Tue, Dec 13 2022 4:56 PM +1
      Thank you for bringing this to our attention. Your field syntax is correct. This should work better next release. Mark Weisman | Bentley Systems
    • MWBSI
      MWBSI Tue, Mar 21 2023 8:41 AM in reply to craig.tobias +1
      The PWPS module will only work in 32-bit mode. PWPS_DAB works in 32 bit mode and 64 bit mode. If you use both, mix cmdlets carefully. For instance you do no want to login in with a cmdlet from the PWPS_DAB…

    Communities
    • Home
    • Getting Started
    • Community Central
    • Products
    • Support
    • Secure File Upload
    • Feedback
    Support and Services
    • Home
    • Product Support
    • Downloads
    • Subscription Services Portal
    Training and Learning
    • Home
    • About Bentley Institute
    • My Learning History
    • Reference Books
    Social Media
    •    LinkedIn
    •    Facebook
    •    Twitter
    •    YouTube
    •    RSS Feed
    •    Email

    © 2023 Bentley Systems, Incorporated  |  Contact Us  |  Privacy |  Terms of Use  |  Cookies