Record Picker component is not working

I am trying to implement a record picker component within a form layout. For some reason is not working the way it should be. After implementing the expression code below the search results appears to be "No results found" when I tried to search for something using the component. I have created a constant (cons!ERP_PROVIDER_RECORD) that points to the record type and a local variable to hold the selected records. What I need to do is to find a way to fetch a list of providers (which are already stored in the backend) so the user can pick them to complete the form.

Here is the expression code:

a!pickerFieldRecords(
label: "Proveedores Seleccionados",
labelPosition: "ABOVE",
placeholder: "Escriba para seleccionar proveedores",
recordType: cons!ERP_PROVIDER_RECORD,
value: local!storedRecord,
saveInto: local!storedRecord,
validations: {}
)

Please help to fix this issue.

  Discussion posts and replies are publicly visible

Parents
  • One of the most common sources for a misbehaving record picker that I've seen is when the Record Title is missing, which defeats the type-ahead as there's no record title to display inside the picker. 

  • Hi Jim, I still having a small issue with the record picker... for some reason when I try to use a!save() to store the selected records on a rule input field it appears to be empty []  even though I have some records selected.

    Do you have an idea of why this is happening?

    Here is how my code looks like right now:

    a!pickerFieldRecords(
                label: "Proveedores Seleccionados",
                labelPosition: "ABOVE",
                placeholder: "Escriba para seleccionar proveedores",
                recordType: cons!ERP_PROVIDER_RECORD,
                filters: a!queryFilter(
                  field: "category",
                  operator: "=",
                  value: ri!ERP_Purchase_Request.category
                ),
                value: local!storedRecord,
                saveInto: local!storedRecord,
                required: true,
                validations: {}
              )

    And this code I have when the user click on submit in the form:

    saveInto: { 
        a!save(ri!ERP_Purchase_Request.providers, local!storedRecord)
    },

    My CDT:

    The output when the user click on submit:

  • Hi - it looks like all you are able to save /set the value to is the Record Identifier(s). So your 'providers' attribute should be an array of Integer (assuming you're using an Integer as the Record Identifier and assuming you want to be able to pick multiple records).

    Also: no need to save to a local!variable and then transfer to the 'providers' attribute when submitting the form. You can save directly to the rule input.

    P.S. If you want to set the value of 'providers' as instances of the CDT that define the Record Type, you could create a Query Entity rule that takes as its input an array of Integer (representing the Record Identifiers) and retrieves the set of CDTs for those Identifiers e.g. something like...

    saveInto: {
    a!save(ri!ERP_Purchase_Request.providers, rule!XXX_QE_getProvidersById(ProviderIds: local!storedRecord))
    },

Reply
  • Hi - it looks like all you are able to save /set the value to is the Record Identifier(s). So your 'providers' attribute should be an array of Integer (assuming you're using an Integer as the Record Identifier and assuming you want to be able to pick multiple records).

    Also: no need to save to a local!variable and then transfer to the 'providers' attribute when submitting the form. You can save directly to the rule input.

    P.S. If you want to set the value of 'providers' as instances of the CDT that define the Record Type, you could create a Query Entity rule that takes as its input an array of Integer (representing the Record Identifiers) and retrieves the set of CDTs for those Identifiers e.g. something like...

    saveInto: {
    a!save(ri!ERP_Purchase_Request.providers, rule!XXX_QE_getProvidersById(ProviderIds: local!storedRecord))
    },

Children