@@peterramer i subscribed your channel too. I am new to D365 and it really helps me a lot. Also you keep posting such videos so that freshers would gain knowledge. Thanks once again.
I love your COC explain. With years in another environment, I'm learning D365 and X++ and was mystified by COC - why do you use it.? I need this to be explained as if I'm a Fifth-grader with little insights and gotchas - and you did all that in English! Is there any books on this? Queries appear to have a load of parts, forms instead of a dozen basic designs are a load of parts, ... More please!
Unfortunately you can’t insert code in the middle of base Microsoft method. You can use chewing of command or event handlers to add code before or after the base code runs. So, if you want to insert code in the middle of a method you can look to see if a method is called inside of that method and add Chain of Command code to THAT method. Ultimately the trick is to try to choose the thought method. Either go up or down in the call stack if a base Microsoft method is private. Sometimes you may have to let a base method run and then, in special cases, undo some of what the base method did in your Chain of Command method. Of course this must be done with great care, as you do not want to break existing functionality or prevent future Microsoft updates to the base code to cause issues. I could say a lot on this topic depending on the specific scenario.
Hi kanna. 'ret' is actually just the name of the variable I created. It is short for 'return'. It is a variable that will store whatever value is returned from the base method. I then modify the value in the variable 'ret', and add in some more text, and then return that value to the calling problem. I could have called the variable 'myString' or anything I wanted. It is just common to see the variable named 'ret' used for this purpose in other places of the base Microsoft code.
and for example there is a field , let say for example generates autonumber in specific field, how am I suppose to copy the code of that field so that I do not need to create another class to generate autonumber? or how am I suppose to see that code, and another thing, how can you create a field using chain of command? I mean like textbox, checkbox, combobox, etc.
Hi Kanna, if you need to add a textbox, ect to a form or a table, you need to find the object in the Application Explorer (See the windows on the left side), then right click and select 'create extension'. This just creates an 'extension', it does not use Chain of Command. Chain of Command really just refers to when we need to extend code, not objects. If you want to see the base code for an object, you can find the object in the Application Explorer and then right click on it, and select 'view code'. Usually fields that have an autonumber generated use a numbersequence in the 'initValue' of the table object. But I don't know that I fully understood your question on that part.
@@peterramer lets say I extend certain form then I add field on that, how can I add value lets say a number sequence on that field automatically, how do you exactly code that? for example I click a button then this form appear then I want to have a number sequence value on that field in the form that I extend.
Thank you so very much, Peter!
You are very welcome
Well Explained, thank you. please keep making videos
Thank you! Will do!
Very well Explained.
It was a great explanation. I would be needing of these videos. Thanks
Hey, useful video Peter.
Glad it was helpful!
@@peterramer i subscribed your channel too. I am new to D365 and it really helps me a lot. Also you keep posting such videos so that freshers would gain knowledge. Thanks once again.
@@StockTheBuilder Thanks again Kishor. I appreciate the support. I will keep posting videos that I think you will find helpful.
I love your COC explain. With years in another environment, I'm learning D365 and X++ and was mystified by COC - why do you use it.? I need this to be explained as if I'm a Fifth-grader with little insights and gotchas - and you did all that in English!
Is there any books on this? Queries appear to have a load of parts, forms instead of a dozen basic designs are a load of parts, ...
More please!
Thanks Sommer for the wonderful comments. I really appreciate them. I will keep releasing more videos. Thanks for the topic ideas.
What if the method is Private or protected? what will be the approach
How to insert the code in the middle of a standard class of the D365 system?I still do not understand
Unfortunately you can’t insert code in the middle of base Microsoft method. You can use chewing of command or event handlers to add code before or after the base code runs. So, if you want to insert code in the middle of a method you can look to see if a method is called inside of that method and add Chain of Command code to THAT method.
Ultimately the trick is to try to choose the thought method. Either go up or down in the call stack if a base Microsoft method is private. Sometimes you may have to let a base method run and then, in special cases, undo some of what the base method did in your Chain of Command method. Of course this must be done with great care, as you do not want to break existing functionality or prevent future Microsoft updates to the base code to cause issues. I could say a lot on this topic depending on the specific scenario.
I'm actually new when it comes to d365, may I know what ret means?
Hi kanna. 'ret' is actually just the name of the variable I created. It is short for 'return'. It is a variable that will store whatever value is returned from the base method. I then modify the value in the variable 'ret', and add in some more text, and then return that value to the calling problem. I could have called the variable 'myString' or anything I wanted. It is just common to see the variable named 'ret' used for this purpose in other places of the base Microsoft code.
and for example there is a field , let say for example generates autonumber in specific field, how am I suppose to copy the code of that field so that I do not need to create another class to generate autonumber? or how am I suppose to see that code,
and another thing, how can you create a field using chain of command? I mean like textbox, checkbox, combobox, etc.
Hi Kanna, if you need to add a textbox, ect to a form or a table, you need to find the object in the Application Explorer (See the windows on the left side), then right click and select 'create extension'. This just creates an 'extension', it does not use Chain of Command. Chain of Command really just refers to when we need to extend code, not objects.
If you want to see the base code for an object, you can find the object in the Application Explorer and then right click on it, and select 'view code'. Usually fields that have an autonumber generated use a numbersequence in the 'initValue' of the table object. But I don't know that I fully understood your question on that part.
@@peterramer lets say I extend certain form then I add field on that, how can I add value lets say a number sequence on that field automatically, how do you exactly code that? for example I click a button then this form appear then I want to have a number sequence value on that field in the form that I extend.