Hi
Attachment does not contain a constructor that takes 1 arguments. I am writing thos code using sap b1 Sdk
SAPbobsCOM.Attachment attachment = new SAPbobsCOM.Attachment(@"10.0.1.10\SAP_Attachments\Outgoing Payments_204673_20250314_205951");
message.Attachments.Add(attachment);
Thanks
Jignesh KumarPosted Mar 15, 2025, 9:50 AM
Hello Ramco,
Please use this code to create object and assing attachement,
Eliana BlakePosted Mar 15, 2025, 8:29 AM
It seems like you are encountering an issue regarding the constructor for the Attachment class in SAP Business One SDK where you are trying to use a constructor that doesn't match the available constructors in the SDK.
The error "Attachment does not contain a constructor that takes 1 argument" typically means that the Attachment class does not have a constructor that accepts a single argument, in this case, a string representing the file path.
In your code snippet, you are attempting to create an Attachment object with a file path passed as an argument. However, to create an Attachment object in SAP Business One SDK, you may need to use the appropriate constructor.
To resolve this issue, you should check the available constructors for the Attachment class in the SDK documentation. Most likely, you need to provide required parameters like attachment type, file path, and potentially other parameters as per the SDK specifications.
Here's a hypothetical example to illustrate how you might create an Attachment object considering potential constructor variations:
By aligning your Attachment object creation with the correct constructor and required properties based on the SDK documentation, you should be able to address the issue and proceed with adding attachments successfully.
If you encounter any further challenges or need additional guidance, feel free to provide more details, and I'll be happy to assist further!