App wsh 228467 you cannot perform an action on a new record
A classic error!
The error "You cannot perform an action on a new record" typically occurs when you're trying to save a new record in Microsoft Dynamics 365 (formerly Microsoft Dynamics CRM) using the Web Services (WSH) API.
Here are a few possible reasons for this error:
- Missing or invalid GUID: Make sure that the GUID you're passing in the
id
parameter is valid and corresponds to a new record. If you're trying to create a new record, you should pass an empty GUID (""
). - Invalid or missing entity name: Verify that the entity name you're using is correct and matches the entity you're trying to create a new record for. You can check the entity name in the Dynamics 365 web interface or in the
EntityMetadata
object returned by theRetrieveEntityMetadata
method. - Missing or invalid required fields: Ensure that you're providing values for all required fields for the entity. You can check the required fields by retrieving the
EntityMetadata
object and checking theRequired
property for each attribute. - Invalid data type: Verify that the data types you're using for the fields match the data types defined in the entity. For example, if a field is defined as a date, you should pass a date value in the correct format.
To resolve the issue, you can try the following:
- Check the error message for more details about the specific error.
- Verify that your WSH script is correctly formatted and that you're passing the correct parameters.
- Use the
RetrieveEntityMetadata
method to retrieve the entity metadata and check the required fields and data types. - Try creating a new record using the Dynamics 365 web interface to see if the issue is specific to the WSH API.
If you're still having trouble, please provide more details about your WSH script and the error message you're receiving, and I'll do my best to help you troubleshoot the issue!