Skip to content

Instantly share code, notes, and snippets.

@ballerina-github-bot
Created October 24, 2023 12:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ballerina-github-bot/2ab90ca9654eda367c98aeb973f8dd71 to your computer and use it in GitHub Desktop.
Save ballerina-github-bot/2ab90ca9654eda367c98aeb973f8dd71 to your computer and use it in GitHub Desktop.
Ballerina Playground
import ballerina/io;
import record_to_edi.sorder;
public function main() returns error? {
sorder:SimpleOrder simpleOrder =
{header: {code: "HDR", orderId: "ORDER_200", organization: "HMart", date: "17-05-2023"}};
simpleOrder.items.push({code: "ITM", item: "A680", quantity: 15});
simpleOrder.items.push({code: "ITM", item: "A530", quantity: 2});
simpleOrder.items.push({code: "ITM", item: "A500", quantity: 4});
string ediText = check sorder:toEdiString(simpleOrder);
io:println(ediText);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment