I have a Record Type with this "Sync Expression":
if( a!isNullOrEmpty(ri!idRecord), {}, a!queryRecordType( recordType: 'recordType!{5608cfad-fc67-4a81-93b5-722c9b55f2c5}MIN Prueba API', filters: a!queryFilter( field: 'recordType!{5608cfad-fc67-4a81-93b5-722c9b55f2c5}MIN Prueba API.fields.{af91da05-b274-48ee-b4f1-c7332fac38ff}id', operator: "=", value: ri!idRecord ), pagingInfo: a!pagingInfo(1, 1) ).data)
,where idRecord is an Integer rule input. When I test the expression it works properly:
I've created a process model with a smart record synchronization service. I'm passing a fixed idRecord to retrieve the record, but an error occurs: An error occurred while syncing record type [name=MIN Prueba API]. Details: Unable to sync due to an error in the sync expression. (APNX-1-4521-040)
When I check the process variables I think everything is OK because I pass the idRecord correctly:
Name: idRecord
Type: Number (integer)
Multiple: No
Value: 2
Do know what is happening and how can I fix the problem?
Thanks!
Discussion posts and replies are publicly visible
Can we see your Sync Records node configuration? Sync record smart service takes identifiers (Primary key values to sync).There is no need for you to fetch the whole data (The result of your query gives record type) if you have the primary keys in the first place .Go through this link for more details https://docs.appian.com/suite/help/25.1/Sync_Records_Smart_Service.html#overview. I do have another question why you trying to use sync records??Are you updating this record outside??
Hi Venkat.
This is my sync record smart service:
And these are the process variables:
Regarding the reason for updating the synchronization of records from a web service, I've set up a full synchronization every so often. This works perfectly. I also have a process model through which a record can be modified via a user interface. When they click Submit, I trigger a POST to send it to the database via a web service. Once this is done, I have to refresh my Record Type to reflect the change and this action is done by a sync record smart service. Am I wrong? Is there any other way to do it?
This is the right way to do this.
But, that PV mapRecord doe not look OK. You need to pass the type of the record.
Yes , Just like Stefan mentioned you need to pass the record name recordType!MIN Prueba API (refer example code below)
a!syncRecords( recordType: recordType!Customer, identifiers: ri!identifiers, onSuccess: a!save( local!records, fv!recordsUpdated ) )
Thank you, Venkat and Stefan. So, in the interface I have to add this code to the submit button and in the process model will get the recordType properly, isn't it?
No ,Sorry to mislead you in Sync records smart service at Record Type just reference your record