Question

Problem with sdk.FilterGroup addSchemaColumnInFilterWithParameters

Please tell me what I am specifying wrong when requesting the Id list:
 

var changedSchemaName = "Contact";
var fieldName = "Address";
changedRecordsList = ["xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"]; // can be more then 1000
const filterGroup = new sdk.FilterGroup();
filterGroup.addSchemaColumnInFilterWithParameters(sdk.ComparisonType.Equal, "Id", changedRecordsList);
// I read the old values ​​first.                    
const changedModel = await sdk.Model.create(changedSchemaName);
const resultChanging = await changedModel.load({
     attributes: ["Id", fieldName],
     parameters: [{
                    type: sdk.ModelParameterType.Filter,
                    value: filterGroup
	 }]
});

 

As a result, I get an invalid filter error: 

ye {headers: N, status: 500, statusText: 'Internal Server Error', url: 'https://................./DataService/json/SyncReply/SelectQuery', ok: false, …}

  1. error: {responseStatus: {
    1. ErrorCode: "NullReferenceException"
    2. Errors: []
    3. Message: "Object reference not set to an instance of an object."
  2. }, rowsAffected: -1, nextPrcElReady: false, success: false}
  3. headers: N {normalizedNames: Map(0), lazyUpdate: null, lazyInit: ƒ}
  4. message: "Http failure response for https://................./DataService/json/SyncReply/SelectQuery: 500 Internal Server Error"
  5. name: "HttpErrorResponse"
  6. ok: false
  7. status: 500
  8. statusText: "Internal Server Error"
  9. url: "https://................./DataService/json/SyncReply/SelectQuery"

    Thanks/
Like 0

Like

0 comments
Show all comments