tag:blogger.com,1999:blog-4889748320010274206.post520172382039444325..comments2024-03-20T00:45:30.946-04:00Comments on AX WONDERS: Create Product / Product Masters AX 2012AxWondershttp://www.blogger.com/profile/01901411966215366187noreply@blogger.comBlogger8125tag:blogger.com,1999:blog-4889748320010274206.post-6002533254648006942014-05-20T09:21:06.699-04:002014-05-20T09:21:06.699-04:00That is a good question. I have never done it, but...That is a good question. I have never done it, but you could do it by (1) creating a query service, (2) a service class that gets a product ID as parameter, and (3) that returns a data set to C#. <br /><br />As far as I know, the only service that will allow you to do this is a query service because it can be translated as a data set in C#. I hope this helps. It would be great if you could post your code here for us to learn ... <br /><br />Thanks for reading my blog!AxWondershttps://www.blogger.com/profile/01901411966215366187noreply@blogger.comtag:blogger.com,1999:blog-4889748320010274206.post-16646079917099614242014-05-20T03:38:28.162-04:002014-05-20T03:38:28.162-04:00How can I retrieve the product details(color, attr...How can I retrieve the product details(color, attribute, price) using c#?Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-4889748320010274206.post-40619088745449103352013-01-21T10:28:45.035-05:002013-01-21T10:28:45.035-05:00Thanks for sharing the answer to your problem. And...Thanks for sharing the answer to your problem. And I'm glad you got it!AxWondershttps://www.blogger.com/profile/01901411966215366187noreply@blogger.comtag:blogger.com,1999:blog-4889748320010274206.post-5653470092766965312013-01-21T10:26:55.394-05:002013-01-21T10:26:55.394-05:00Finally figured it out. Since the number sequence...Finally figured it out. Since the number sequence was setup as Continuous, I apparently have to put a ttsbegin/ttscommit statement around my number generation code.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-4889748320010274206.post-29391113081110902292013-01-17T13:15:01.191-05:002013-01-17T13:15:01.191-05:00First, where are you calling this service from? Is...First, where are you calling this service from? Is it a C# application? <br /><br />Second, you said that the user you are using inherits the Sys Admin role, but have you tested this by you login in as admin and see what happens?<br /><br />Third, the service will have to go through the AOS to authenticate you, if you exists as an user in AX can you double check that your user is admin?<br /><br />ThanksAxWondershttps://www.blogger.com/profile/01901411966215366187noreply@blogger.comtag:blogger.com,1999:blog-4889748320010274206.post-87211341198198881692013-01-17T12:10:09.573-05:002013-01-17T12:10:09.573-05:00Thanks for the quick response! I verified that &q...Thanks for the quick response! I verified that "Manual" is unchecked for my product sequence, but I'm not sure how to verify the permissions that my service has.<br /><br />My understanding is that if I'm not using a trusted intermediary and passing a context into my service call, the service will run in the context of the Windows user that makes the service call (please correct if I'm wrong). The user I'm currently using to make the service call is in the "System administrator" role, so my assumption is that I would have rights to do everything. Is there a specific permission that I would need to set in order to generate product numbers through code?<br /><br />Thanks again for your help. I've been working on this on and off for several days and was very happy to find your blog and see that you're doing exactly what I need to do.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-4889748320010274206.post-70134494876486127892013-01-17T10:57:17.588-05:002013-01-17T10:57:17.588-05:00Your code looks ok.
Two things:
1- Is your Prod...Your code looks ok. <br /><br />Two things:<br /><br />1- Is your Product Sequence Number set correctly, you can check if the "Manual" check box is checked. If it is, uncheck it.<br /><br />2- Does the service has enough rights to do this?<br /><br />I hope this helps.AxWondershttps://www.blogger.com/profile/01901411966215366187noreply@blogger.comtag:blogger.com,1999:blog-4889748320010274206.post-6586803555683042762013-01-17T10:48:10.812-05:002013-01-17T10:48:10.812-05:00Thanks for the great information! I need to use a...Thanks for the great information! I need to use a subset of this functionality -- basically I just need to retrieve the next product number from the number sequence and then return that number via an AIF service. I've got the service setup correctly, but whenever I call the service I get an AIFFault with the message "Number selection is canceled". Here is my code (mostly copied from yours):<br /><br />[SysEntryPointAttribute(true)]<br />public EcoResProductNumber getNextProductNumber()<br />{<br /> EcoResProductNumber nextNumber;<br /> NumberSequenceTable numberSequenceTable;<br /><br /> numberSequenceTable = EcoResProductParameters::numRefProductNumber().numberSequenceTable();<br /> nextNumber = NumberSeq::newGetNumFromId(numberSequenceTable.RecId).num();<br /> <br /> return nextNumber;<br />}Anonymousnoreply@blogger.com