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

[Event Request] Remove DotNet parameters from events #15140

Open
ajkauffmann opened this issue Nov 8, 2021 · 4 comments
Open

[Event Request] Remove DotNet parameters from events #15140

ajkauffmann opened this issue Nov 8, 2021 · 4 comments
Labels
extensibility-enhancement New feature or request related to extensibility Integration GitHub request for Integration area

Comments

@ajkauffmann
Copy link
Contributor

ajkauffmann commented Nov 8, 2021

Can you please remove the DotNet variables from the events in codeunit 8614 "Config. XML Exchange"

Some events in this codeunit pass parameters as DotNet objects. So they can't be used in a cloud extension.
Internal work item: AB#416596

@pri-kise
Copy link
Contributor

pri-kise commented Nov 8, 2021

Normally you can only add the need parameters to a event subscriber. Without the Dotnet parameters a event subscriber should be possible.
The following snippet does not create any error in my dummy project.

[IntegrationEvent(false, false)]
local procedure OnFillPackageMetadataFromXMLOnAfterGetPackageTableValueFromXML(ConfigPackageTable: Record "Config. Package Table"; var TableNode: DotNet XmlNode)
begin
end;
[EventSubscriber(ObjectType::Codeunit, Codeunit::"Config. XML Exchange", 'OnFillPackageMetadataFromXMLOnAfterGetPackageTableValueFromXML', '', false, false)]
local procedure OnFillPackageMetadataFromXMLOnAfterGetPackageTableValueFromXML(ConfigPackageTable: Record "Config. Package Table")
begin

end;
}

Wouldn't it be better if the Codeunit is refactored to the new XMl Types with new events....

@ajkauffmann
Copy link
Contributor Author

Sure, I know that you can leave the parameters you don't need. But in this case, I need the Xml parameter.

Obviously, the best way to get rid of the DotNet parameters is to refactor the codeunit. I guess Microsoft is smart enough to recognize that. 😊 But after all, I don't really care what variable types are used internally, as long as I can use the events. 😊

@AlexanderYakunin AlexanderYakunin added the event-request Request for adding an event label Nov 9, 2021
@Oleg-Romashkov Oleg-Romashkov added extensibility-enhancement New feature or request related to extensibility and removed event-request Request for adding an event labels Nov 11, 2021
@Oleg-Romashkov
Copy link

Hi,

Do you have any suggestions which parameters should be used instead of DotNet to fit you needs (same object as text, etc)?
It would be nice to have some scenarios/examples of using those events to simplify the refactoring.

@ajkauffmann
Copy link
Contributor Author

It is used to create extra XML elements and add them to the TableNode parameter. In this case a feature that is similar to "Dimensions as Columns", but for item specifications.

For example:

[EventSubscriber(ObjectType::Codeunit, Codeunit::"Config. XML Exchange", 'OnAfterAddTableAttributes', '', false, false)]
local procedure OnAfterAddTableAttributes(ConfigPackageTable: Record "Config. Package Table"; var PackageXML: DotNet XmlDocument; var TableNode: DotNet XmlNode)
var
    FieldNode: DotNet XmlNode;
begin
    if ConfigPackageTable."Item Spec. as Columns" then begin
        FieldNode := PackageXML.CreateElement(ConfigXMLExchange.GetElementName(ConfigPackageTable.FieldName("Item Spec. as Columns")));
        FieldNode.InnerText := '1';
        TableNode.AppendChild(FieldNode);
    end;
end;

@JesperSchulz JesperSchulz added Integration GitHub request for Integration area extensibility-enhancement New feature or request related to extensibility and removed foundation extensibility-enhancement New feature or request related to extensibility labels Jun 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
extensibility-enhancement New feature or request related to extensibility Integration GitHub request for Integration area
Projects
None yet
Development

No branches or pull requests

6 participants