Can´t pass the value of a relationship field in a process model

Hi, I would want to ask how can I use the related fields (record relationship fields) in a process model. Now I´m passing a null value

The relation appears in the "Write Record Inputs"

And these are the outputs:

Then, I have a XOR to put conditions to the related fields, but I think I´m not passing the values well because the logic is not working. 

  Discussion posts and replies are publicly visible

Parents Reply Children
  • I could not solve the problem, with my query expression an error called "rank" appeared. probably there are some errors:

    =
        a!queryRecordType(
          recordType: 'recordType!{51d44df6-c727-4443-8114-aef8a7509b41}CPF Maestro Facturas',
          fields: {
            'recordType!{51d44df6-c727-4443-8114-aef8a7509b41}CPF Maestro Facturas.relationships.{42ee17b1-73d1-4012-b242-1356c590c856}cpfMaestroPedidos.fields.{7309402c-2312-4a4e-bdaa-5654789bffb2}idPedido'
    },
    pagingInfo: a!pagingInfo(startIndex: 1, batchSize: 1),
    filters: a!queryFilter(
      field: 'recordType!{51d44df6-c727-4443-8114-aef8a7509b41}CPF Maestro Facturas.relationships.{42ee17b1-73d1-4012-b242-1356c590c856}cpfMaestroPedidos.fields.{7309402c-2312-4a4e-bdaa-5654789bffb2}idPedido',
    operator: "=",
    value: pv!recordFact['recordType!{51d44df6-c727-4443-8114-aef8a7509b41}CPF Maestro Facturas.fields.{e8009662-ca1c-43da-9c72-2840463214be}id_pedido']
            )
            ).data['recordType!{51d44df6-c727-4443-8114-aef8a7509b41}CPF Maestro Facturas.relationships.{42ee17b1-73d1-4012-b242-1356c590c856}cpfMaestroPedidos.fields.{7309402c-2312-4a4e-bdaa-5654789bffb2}idPedido']
    
    
    

    Is there any other way to solve the problem and pass the relationship values in a correct way to the process model? 

  • 0
    Certified Lead Developer
    in reply to carlosp5114

    I have to admit that perhaps the copy pasting of record types could be improved. That is hard to read Slight smile

    I would suggest either referring to whatever original query you had somewhere in your process model.

    The only alternative would be to create a custom record field and have your XOR process that.

  • I uploaded a pic of the code. On the other hand, is it possible to add a custom record of a related field? 

    How can I do this step by step? It says that I must use a custom record field function

    Thank you so much

  • 0
    Certified Lead Developer
    in reply to carlosp5114

    Not sure what's wrong with your query. Looks fine from what I can see. What is the error?

    For the custom record field, you can use a customFieldDefaultValue to access the related record field.