Aggregate with Static Entity Filter
Question
Service Studio Version
11.10.16 (Build 40208)

Please note that when I tried to fetch an aggregate using a static entity filter the application refused to be published with exception error, however the TrueChange didn't show any issue while doing the changes in the Service Studio:



IntegerToIdentifier(GetAuctionStatus(Entities.AuctionStatus.Completed).AuctionStatus.AuctionStatusID)



Internal Error
Compilation Error.
ScreenServices.AuctionMainModule_AdminReports_PurchaseHistory_Controller.cs(154,284): error CS0103: The name 'ObjectKey' does not exist in the current context
ds_output.List = AuctionMainModule_AdminReports_PurchaseHistory_ScreenModel.datasetVehicleCompletedAuctions(heContext, datasetVehicleCompletedAuctions_maxRecords, IterationMultiplicity.Multiple, out count, Functions.ssGetAuctionStatus(heContext, ENAuctionStatusEntity.GetRecordByKey(ObjectKey.Parse("EvFzS7bQjkmzh4BVI7b6Mg")).ssId).ssENAuctionStatus.ssAuctionStatusID, model.varLcTableSort);
ScreenServices.AuctionMainModule_AdminReports_PurchaseHistory_Controller.cs(226,284): error CS0103: The name 'ObjectKey' does not exist in the current context
ds_output.List = AuctionMainModule_AdminReports_PurchaseHistory_ScreenModel.datasetGeneralCompletedAuctions(heContext, datasetGeneralCompletedAuctions_maxRecords, IterationMultiplicity.Multiple, out count, Functions.ssGetAuctionStatus(heContext, ENAuctionStatusEntity.GetRecordByKey(ObjectKey.Parse("EvFzS7bQjkmzh4BVI7b6Mg")).ssId).ssENAuctionStatus.ssAuctionStatusID, model.varLcTableSort2);

 


State: Second stage compilation

mvp_badge
MVP

Hello there Redha,

Hope you're doing well.


It seems that you are adding some unnecessary logic to your filter.

Why don't you simply use something like:

Auction.AuctionStatusId = Entities.AuctionStatus.Completed


Kind regards,

Rui Barradas

Hi Ruy,

Thanks for your reply, the reason behind this is because we're not using the Static Entity Identifier as the one referred to AuctionStatusID.


Auction.AuctionStatusId = LookupValueIdentifier

Entities.AuctionStatus.Completed = AuctionStatusIdentifier


The two values are not matching, we're storing the matching LookupValueIdentifier in the attribute (AuctionStatusID) in the static entity (AuctionStatus).


Hi @Redha Al Muharraqi 

This happens because of the Entities.AuctionStatus.Completed in runtime is like a key, so when is try to compile raizes that error

To apply this filter you need to first get the ID of the static entity, set it into a variable (AuctionStatusId ) and the filter should be Auction.AuctionStatusId = IntegerToIdentifier(GetAuctionStatus(AuctionStatusId).AuctionStatus.AuctionStatusID) 

Hi @Jose Goncalves 

Many thanks for the help, the thing is that true change must show us it's wrong practice to avoid surprises during the compilation as you know, we've done several things and the error is not clear and we deleted the page and done the changes one by one.

Thanks!

Champion

HI Redha Al Muharraqi,

If possible, please share the oml file.

Kind regards,


Hi @Tom Zhao,

Unfortunately I can't share the whole flow as it's a company application which must be not shared, is there a better way to share that specific screen?

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.