# system.kanoa.asset.upsertAssetStateLinks(assetStateList, userId)

Updated function that does fast bulks inserts/updates for linking assets and states

---
### Parameters
**assetStateList** `List of Dictionaries`: list of dictionaries<br />
<table class='dictionaryKeyTable'>
	<tbody>
 	<tr><td> - assetId</td><td>Integer</td><td></td></tr>	
 	<tr><td> - stateCode</td><td>Integer</td><td></td></tr>	
 	<tr><td> - stateId</td><td>Integer</td><td></td></tr>	
	</tbody>
</table>

**userId** `Integer`:Id of the user executing the function<br />

---
### Returns
**# of records modified** `Integer`<br />
**msg** `String` None if success<br />

---
### Example
```python
assetStateList = [{'assetId': 901, 'stateId': 2, 'stateCode': 1}]
userId = 5
retVal, msg = system.kanoa.asset.upsertAssetStateLinks(assetStateList, userId)
```
