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

Add support enabling multiple virtual tables at a time #15

Open
aariste opened this issue Mar 4, 2024 · 6 comments
Open

Add support enabling multiple virtual tables at a time #15

aariste opened this issue Mar 4, 2024 · 6 comments

Comments

@aariste
Copy link

aariste commented Mar 4, 2024

For the cmdlets Set-BapEnvironmentVirtualEntity and Update-BapEnvironmentVirtualEntityMetadata, could it be possible to add support to pass a list of entities with their full names, so we modify the properties for all of them?

Is there any API limitation preventing this?

@FH-Inway
Copy link
Member

FH-Inway commented Mar 4, 2024

Hey @aariste , glad to see you here 😄

Thanks for the suggestion. I'm not sure if the API can handle multiple entities at once, @Splaxi can probably answer that.

But even if the API cannot, our cmdlets sure could and then just call the API in the background separately for each entity name.

You could probably already right now do something like

$entityNames = ("entity1","entity2")
foreach ($entity in $entityNames) {
    Set-BapEnvironmentVirtualEntity -Name $entity -EnvironmentId 00000000-00...
}

@Splaxi
Copy link
Collaborator

Splaxi commented Mar 4, 2024

Hi @aariste

Thanks for the feedback - we welcome all perspectives and suggestions.

As @FH-Inway points out, by wrapping the current implementation in a loop - you get what you're looking for. But that said...

I was in doubt whether or not to support an array on entities or not.

We are using the Organization.svc SOAP endpoint (😬) - which is fairly new territory for me personally. Because of your question, I found the following blog post:

https://softchief.com/2020/12/22/execute-vs-executemultiplerequest-vs-executetransactionrequest-in-dynamics-365/

Where I just learned about the ExecuteMultipleRequest - which requires a bit more investigation on my side.

@Splaxi
Copy link
Collaborator

Splaxi commented Mar 4, 2024

And we get some cool stuff out of the box it seems:

https://learn.microsoft.com/en-us/power-apps/developer/data-platform/org-service/execute-multiple-requests

https://learn.microsoft.com/en-us/power-apps/developer/data-platform/org-service/execute-multiple-requests#specify-run-time-execution-options

Both ContinueOnError and ReturnResponses seems like something that would make sense, when handling an array of entities.

@Splaxi
Copy link
Collaborator

Splaxi commented Mar 4, 2024

https://blogs.infosupport.com/ms-crm-2015-bulk-update-data-using-powershell/

And here we can learn how to load the DLL files and make it easier in the discovery phase of things. I suggest staying away from the DLL files, as I don't know if we are allow to redistribute these along with the module. So for now we can just use them, to map out how the raw data structure for the SOAP is - and do the implementation based on that.

@Splaxi
Copy link
Collaborator

Splaxi commented Mar 6, 2024

@aariste
Copy link
Author

aariste commented Mar 6, 2024

About using the DLLs... I understand the reason to not use them, but I just checked another tool like xrmToolbox and they include them in their package. I'm also using a modified version of AXUtil.dll (which maybe is even worse than using the original DLL 🤣) for the ISVLicenseGenerator tool. I guess that as long as they're used on community-like tools MS is fine with that, but of course they can decide against that at-will.

I'll investigate the PowerShell module from the last comment!

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

3 participants