@@ -78,6 +78,7 @@ let getBindVars (nameMap: Map<string, EntityInfo>) (filter: XrmAttribute -> bool
7878
7979 entity.manyToOneRelationships
8080 |> List.filter ( fun rel -> Map.tryFind rel.ReferencingAttribute attrMap |> Option.exists filter)
81+ |> List.sortBy ( fun rel -> rel.ReferencingEntityNavigationPropertyName)
8182 |> List.map ( fun rel ->
8283 let eInfo = Map.find rel.ReferencedEntity nameMap
8384
@@ -93,19 +94,18 @@ let getBindVars (nameMap: Map<string, EntityInfo>) (filter: XrmAttribute -> bool
9394 Comment.Basic eInfo.DisplayName,
9495 optional = true
9596 ))
96- |> sortByName
9797
9898let getLookupValueVars ( attrs : XrmAttribute list ) =
9999 attrs
100100 |> List.filter ( fun a -> a.specialType = SpecialType.EntityReference)
101+ |> List.sortBy ( fun a -> a.logicalName)
101102 |> List.map ( fun a ->
102103 Variable.Create(
103104 valueInfix a.logicalName,
104105 TsType.String,
105106 getAttributeComment a None,
106107 optional = true
107108 ))
108- |> sortByName
109109
110110let private toInterfaceName forWrite schemaName =
111111 if forWrite then $" {schemaName}.{CREATE_INTERFACE_NAME}" else schemaName
@@ -206,18 +206,19 @@ let getManyToManyVars nameMap (schemaNames: Set<string>) forWrite (entity: XrmEn
206206let getFormattedVars ( entity : XrmEntity ) =
207207 entity.attributes
208208 |> List.filter hasFormattedValue
209+ |> List.sortBy ( fun attr -> attr.logicalName)
209210 |> List.map ( fun attr ->
210211 Variable.Create(
211212 formattedName attr,
212213 TsType.String,
213214 getAttributeComment attr ( Some entity.optionSets),
214215 optional = true
215216 ))
216- |> sortByName
217217
218218let getLookupNameVars ( attrs : XrmAttribute list ) =
219219 attrs
220220 |> List.filter ( fun a -> a.specialType = SpecialType.EntityReference)
221+ |> List.sortBy ( fun a -> a.logicalName)
221222 |> List.map ( fun a ->
222223 let vType =
223224 match a.targetEntitySets with
@@ -234,7 +235,6 @@ let getLookupNameVars (attrs: XrmAttribute list) =
234235 Comment.Attribute( a.displayName, tes = a.targetEntitySets),
235236 optional = true
236237 ))
237- |> sortByName
238238
239239let getScalarVars ( filter : XrmAttribute -> bool ) ( entity : XrmEntity ) =
240240 entity.attributes
0 commit comments