-
-
Notifications
You must be signed in to change notification settings - Fork 42
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
Model classes #26
Comments
Hi, @aeadbhard. SAP Business One model classes to be used with B1SLayer can be ordinary C# classes, each representing an entity in SAP and containing its properties. The name and type of each property should match what is defined in the Service Layer metadata. It's worth noting that your C# model classes don't need to have all the properties of a given SAP entity, as they can have an extensive list of properties and in most cases you will only need a few, which will vary depending on your need. Here's an example of a model class for the BusinessPartner entity: public class BusinessPartner
{
public string CardCode { get; set; }
public string CardName { get; set; }
public string CardType { get; set; }
public string EmailAddress { get; set; }
public int GroupCode { get; set; }
// (...) just add all the properties you need, making sure the name and type matches the metadata
} |
Thank you, Bruno, for your kind help. Will follow your advice. Thanks!
…________________________________
From: Bruno Mulinari ***@***.***>
Sent: 07 November 2022 11:30
To: bgmulinari/B1SLayer ***@***.***>
Cc: aeadbhard ***@***.***>; Mention ***@***.***>
Subject: Re: [bgmulinari/B1SLayer] Model classes (Issue #26)
Hi, @aeadbhard<https://github.com/aeadbhard>.
SAP Business One model classes to be used with B1SLayer can be ordinary C# classes, each representing an entity in SAP and containing its properties. The name and type of each property should match what is defined in the Service Layer metadata<https://help.sap.com/doc/6ab840ef2e8140f3af9eeb7d8fef9f06/10.0/en-US/Working_with_SAP_Business_One_Service_Layer.pdf#page=20>.
It's worth noting that your C# model classes don't need to have all the properties of a given SAP entity, as they can have an extensive list of properties and in most cases you will only need a few, which will vary depending on your need.
Here's an example of a model class for the BusinessPartner entity:
public class BusinessPartner
{
public string CardCode { get; set; }
public string CardName { get; set; }
public string CardType { get; set; }
public string EmailAddress { get; set; }
public int GroupCode { get; set; }
// (...) just add all the properties you need, making sure the name and type matches the metadata
}
—
Reply to this email directly, view it on GitHub<#26 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AM6HGSGVK6PDHFDGJWS7BKTWHE4D5ANCNFSM6AAAAAARZMLV4I>.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
You're welcome. I'll be closing the issue as your doubt seems to be cleared. |
Thanks for such a great library. I want to use it in a project, but I am new to SAP Business One and I am not sure what would I need to do or research in order to create the SAP B1 model classes. What would you recommend? Thanks!
The text was updated successfully, but these errors were encountered: