Issuing Material to a Job from C#

Thank you for the code! I am having some issues with the “PartInfo” callout at the top of the function. Is there something that I need to do for this? getting a missing assembly reference error.

@niva5171 No that’s just a custom class I made. You could just as well change the IssuePart to use (PartNum, MtlSeq, etc) instead of a class. If I have to pass several related items, I tend to make a class to encapsulate them in.

In this case you just add:

class PartInfo
{
string PartNum;
int MtlSeq;

}

then create it and stuff some data into it:

PartInfo myPart = new PartInfo();
myPart.PartNum = "APartNum";
myPart.MtlSeq = 10;


IssuePart(myPart, 10);

Note that MtlSeq is from the BOM itself. That’s a whole different chunk of code.

Okay, that makes more sense! I am self taught in c# (coding in general), so there a lot of things I haven’t picked up on. I finally got it up and working! thank you so much Chris. You are the man!

1 Like

sorry to jump in, is this done with mes? is it possible to get a copy of xml export customization

Sorry, that was a lifetime ago. I no longer have access to the file. You can use this code from either the client or MES.

Obviously there are other bits of info you have to provide, like adding assembly’s and using statements.

1 Like