Idea ID: 1676286

Improve MaaS (SMAX) Connect IT connector

Status : Already Offered
over 2 years ago

Hello,

 

When using SMAX connector in SMAX, the connector call SMAX Web Service, in that connector we can see the fields available in the SMAX table chose, but for entity link we can only fill ID of the record we want to use.

It's not possible to reference a record by another value, like a code.

By example, if we create a user, to set the location we need to put the ID of the location of the location table, it's not possible to find the location by its name or code.

Having that possibility would improve a lot the use of that connector in CIT.

 

Thank you

Tags:

  • Hi,

    you can use the example I documented below. This works fine.

    '================================================================================
    ' Function to query the SMAX database for additional data

    ' Parameters:
    ' sConnector - The name of connector to which the query is performed
    ' sDocumentType - The document type in the Produced Document Type section of the Connector to get data from
    ' sQuery - The Query to execute against the document type; the function below only supports queries which return ONE value. Query need to follow SMAX REST query syntax.
    ' sRetField - The return field value from SMAX. For sample, to get the Id field of the Location entity, pass 'Location(0).properties.Id' for this parameter
    '================================================================================

    Function getSMAXData(sConnector as String, sDocumentType as String, sQuery as String, sRetField as String) as String

    Dim lHandle as Long
    Dim lRc as Long
    Dim sRetValue as String
    sRetValue = ""

    'query the system
    lHandle = pifNewQueryFromFmtName(sConnector, sDocumentType, sQuery)
    lRc = pifQueryNext(lHandle)
    If lRc = 0 then
    sRetValue = pifQueryGetStringVal(lHandle, sRetField)
    else
    sRetValue = ""
    End if

    PiflogInfoMsg ("SM to SMAX - Function getSMAXData; Connector: " & sConnector & " Document Type: " & sDocumentType & " Query: " & sQuery & " Return value: " & sRetValue )
    lRc = pifQueryClose(lHandle)
    getSMAXData = sRetValue

    End Function

     

    Now call this function from the mapping. The example below, will return the Location ID from a SMAX location.

    Retval = getSMAXData("SMAX EMS DataQuery Connector", "locationQuery", "Name='"&[Location]&"'", "Location(0).properties.id")

    A full example:

    1. The query connector is important

    2. the document types of the query connector

     

    3. the script (from above, as global function

     

    4. the function call in the mapping

     

    Hope this helps. 

    Regards,

     

  • Hi Team,

    Did anyone used this PifQueryfromFormat  function to get ID of the record by doing query in CIT. I am trying but its not working.  I can see the function which is added in CIT 9.80 P2 is "pifNewQueryFromFmtName". I got this from release notes of CIT 9.80 P2.

    I am trying to create pifNewQueryFromFmtName function but its not working. Can someone guide me how to use below function in connect

    Function PifNewQueryFromFmtName(strCntrName As String, strFmtName As String, strLayer As String) As Long

     

    Anyone having screenshot of connect-IT , please share help. Thanks in advance

  • This has been supported since CIT 9.80 P2

  • this idea is now open for votes.  please provide your insights, questions, or other considerations

  • this idea is now open for votes.  please provide your insights, questions, or other considerations