Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check enitity aliases before execution #111

Closed
shytikov opened this issue Feb 15, 2016 · 1 comment
Closed

Check enitity aliases before execution #111

shytikov opened this issue Feb 15, 2016 · 1 comment

Comments

@shytikov
Copy link
Contributor

FXB is not validating entity aliases during operation.

For example following FetchXML will fail to execute due to fact that queueitem entity alias contain illegal characters, in this case it's dash (-).

<fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="false" >
  <entity name="incident" >
    <attribute name="createdon" />
    <attribute name="followupby" />
    <attribute name="subjectid" />
    <filter type="and" >
      <filter type="or" >
        <condition attribute="ownerid" operator="eq-userid" />
      </filter>
      <condition attribute="statecode" operator="eq" value="0" />
    </filter>
    <attribute name="incidentid" />
    <order attribute="createdon" descending="true" />
    <link-entity name="queueitem" from="objectid" to="incidentid" link-type="inner" alias="queue-item" >
      <link-entity name="queue" from="queueid" to="queueid" link-type="inner" alias="queue" >
        <attribute name="name" alias="Queue" />
      </link-entity>
    </link-entity>
  </entity>
</fetch>

FXB fires reasonably logical error, but very broad error:

---------------------------
Execute
---------------------------
Invalid character specified for alias: queue-item. Only characters within the ranges [A-Z], [a-z] or [0-9] or _ are allowed.  The first character may only be in the ranges [A-Z], [a-z] or _.

Try with result as ExecuteFetch?
---------------------------
OK   Cancel   
---------------------------

Through it would be much nicer if such error as incorrect alias would be detected before execution started. This will help user to fix error more quickly. And this is especially important for quite large FetchXML requests.

@shytikov shytikov changed the title Check enitity aliases created by FXB before execution Check enitity aliases before execution Feb 15, 2016
@rappen
Copy link
Owner

rappen commented Feb 16, 2016

Related to #106.
But I have doubts about implementing too specific validation, for two reasons:

  1. The rule causing this error might very well change in later releases of CRM.
  2. The error message given by CRM is already well formed and detailed enough to fix the problem.

That said, this may still be implemented as part of the more extensive validation in related issue.

@rappen rappen closed this as completed in ab3f67e Feb 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants