Personalized Community is here!
Quickly customize your community to find the content you seek.
Choose your path Increase your proficiency with the Dynamics 365 applications that you already use and learn more about the apps that interest you. Up your game with a learning path tailored to today's Dynamics 365 masterminds and designed to prepare you for industry-recognized Microsoft certifications.
Visit Microsoft Learn
2020 Release Wave 2Discover the latest updates and new features to Dynamics 365 planned through March 2021.
Release overview guides and videos Release Plan | Preview 2020 Release Wave 2 TimelineWatch the 2020 Release Wave 1 virtual launch event
The FastTrack program is designed to help you accelerate your Dynamics 365 deployment with confidence.
FastTrack Program | Finance TechTalks | Customer Engagement TechTalks | Upcoming TechTalks
public container test()
int i ;
boolean dataInCont = true;
costGroupId += 'Variable cost';
costGroupId += 'Total cost';
costGroupId += 'Est.price';
}how to keep these 3 highlighted field in the container.
Do you meet any issues when using container?
You can just initialized the container with data as you do in the post. You can also insert one or more elements into a container using conIns funcation or the insert operator ""+=", which will return a new container that contains the inserted elements.
This following links contain some of the most common container functions with examples:
Hi Rai, unfortunately you forgot to explain your problem. The code above doesn't do anything useful (it merely returns an empty container), but we can't help you to fix it unless you tell us what you're trying to achieve.
@Martin my fields arent stored in field. it stored in the GroupId. So that's why this is kinda hard to do
I'm sorry, but I still have no idea what you're trying to achieve. Please start from the beginning and explain your scenario.
You're forgetting that we don't know anything about your problem except of what you tell us. If you don't tell us enough, we can't help you, so it's in your best interest to do better job in describing your requirement and the problem you have with it.
@Martin alright for my requirement I had already posted on community over more than 4 times and nobody can solve it. And now i explain to you here
So, basically how all those fields print out on the report i highlighted, is based on these CostGroupID. If lets say u delete the //Total cost portion so u wouldnt see on the report
So far can get my idea? Mr.Drab
All right, we're slowly getting something.
You said you want to print out some fields. Fine, what prevents your from printing them? What's the problem you need our help with?
Note that I don't see any highlighted fields in your pictures. Also, I have no idea where your code is used, because you forgot to tell us anything about it. Again, don't be surprised that you're not getting answers if you don't provide a good description of your problem.
By the way, why is the title "How to use container to store value in class?" if your goal is to print some fields in a report? I don't see any relation between your question and your actual problem.
I need to explain how my report print out 1st. only that u guys have the concept then easy for me to go through.I have highlighted the fields on the very top question. i circled it
I have a hard time decrypting what you're saying and you keep ignoring my requests to explain your scenario.
Does "I need to explain how my report print out 1st" means that you need some introduction to report development?
And if I return to your original question, what do you mean by "keeping field in the container"?
Again, if you don't explain properly what you want, nobody can help you. It looks like if I was more interested in solving your problem than you are. Note that I have my own work, therefore I can't keep interrogating your for hours.
@Mr.Drab alright. Now I have 3 portion that contain calculation (//variable cost, //total cost, //est.sales price) to store in the container. below code isnt working. im gonna store (myTable.costGroupId = 'variable cost', myTable.costGroupId = 'totalcost', myTable.costGroupId = 'Est.price') in the container. but my code isnt working
public container calcTotal()
costGroupId1 += 'Variable cost';
costGroupId2 += 'Total cost';
costGroupId3 += 'Est.Price';
return costGroupId1, costGroupId2, costGroupId3;
Unfortunately you forgot to tell us what you want your code to do.
If you want to return a container of three containers, each with a single value, change the return value to a container:
If you want to return a single container with those three strings, you can do something like this:
public container calcTotal()
costGroups += 'Variable cost';
costGroups += 'Total cost';
costGroups += 'Est.Price';
But why do you use containers in the first place? I avoid them unless absolutely necessary, because they're difficult to use. Why thinking about something like "container element 3" if you can use a named method or field?
@Mr Drab I must use container to store each looping. As i shown on the above comment those 3 looping (//variable cost, //total cost, //Est.Sales Price). because they are using same fields to declare the value.So that, I can retrieve the value 1 by 1 to do calculation. Otherwise, If I do not use container. u can see the below code //net Profit Amount, try to imaging what is the output. it become like variableCost = productionCost = totalCostnetProfitAmount = salesPrice - totalCost - variableCost
You seem to be claiming that container is the only data structure capable of holding more than a single value, which is clearly not true. For example, tables and lists are usually a much better choice.
@Mr.Drab so what method should i use now? to hold data.
Business Applications communities