cancel
Showing results for 
Search instead for 
Did you mean: 
Reply

Journal entries apps: need advice

Hello everyone,

 

I want to create an apps like a journal entries, and need some advise or guidance on what do I need and what should I do to achieve that.

 

The apps I want to create is an Stock count journal, which in then end I would like to create journal in Dynamics 365 F&O. So in my mind, this apps will do these steps:

1. 1st screen, I need to select Warehouse, Location, and the journal name

2. 2nd screen, there is a barcode scanner which will scan the item, and this will create data rows like in a list contains the item number and the quantity.

3. All those list will goes or save to CDS.

4. There is another menu, probably in the 1st screen to push those records in CDS to D365 F&O to create inventory journal there.

 

What I did so far are :

1. Create tables Warehouse, location, journal type, and the table to records all the counting result (lets call it CountEntries) in CDS.

2. the 1st screen is created, data source is the CountEntries, so I display the Warehouse, Location, and Journal type which is a lookup.

3. the 2nd screen is created up to Barcode scanner button.

 

and currently I'm confuse on how to bring the Barcode scanner result to a gridlist which is maybe a "Data table" control. Can it create a new record everytime I scan, and the information of warehouse, location, and journal type follows what's in 1st screen ? So when I scan 3 (three) times, the grid / data table control will have 3 rows of item and quantity with in background the row also fill in by warehouse, location and journal type from the 1st screen automatic.

 

The grid and also the CountEntry table which I imagine will be something like this :

image.png

.. and there is also one important thing which I still don't know how to handle it, is on that table has primary key (usually with fieldname "Name") which I don't know what to fill in ? can it be a number sequence, and how to do that ?

 

Anyone know a good reference to it, with the steps needed to create this. Or just some advice what do I need to do to achieve this.

 

Many thanks in advance.

TZ

 

11 REPLIES 11
eka24
Community Champion
Community Champion

For the journal watch the video and work around it

https://youtu.be/vjfrXUa1Juw

------------

If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

v-xida-msft
Community Support
Community Support

Hi @Voltes,

Based on the needs that you mentioned, I think the Collection could achieve your needs.

 

I have made a test on my side, please consider take a try with the following workaround:

1. Within your 2nd screen, add a Text Input box (called "QuantityTextBox") prior the Barcode scanner control to collect the quantity.

2. Set the OnScan property of the Barcode Scanner control in your 2nd screen to following:

Collect(
        TempCollection,
        {
          Id: CountRows(TempCollection) + 1,   // generate a auto-number value to act as Primary Key
          Item: BarcodeScanner1.Value,
          Quantity: QuantityTextBox.Text,
          Warehouse: WarehouseDropdown.Selected.Value,
          Location: LocationDropdown.Selected.Value,
          'Journal type': JournalTypeDropdown.Selected.Value
        }
)

Note: I assume that you add several Dropdown controls/ComboBoxes in your 1st screen to list the available options for Warehouse, Location, and the journal type.

 

Add a Data Table in your 2nd screen, set the Items property to following:

Sort(TempCollection, Id, SortOrder.Descending)

then enable corresponding columns in this Data Table, then you could preview these scanned Item record.

 

Add a Button (called "Patch") in your 2nd screen, set the OnSelect property to following (press it to save your above TempCollection back to your CDS Entity😞

ForAll(
       Filter(TempCollection, Not(Id in 'Your CDS Entity'.ItemID)),
       Patch(
            'Your CDS Entity',
            Defaults('Your CDS Entity'),
            {
              ItemID: Id,
              Warehouse_Entity: Warehouse,
              Location_Entity: Location,
              JournalType_Entity: 'Journal type',
              Item_Entity: Item,
              Quantity_Entity: Quantity
            }
       )
)

Note: The ItemID represents the Number type column in your CDS Entity, which is used to store the Id column value from above TempCollection table. The Warehouse_Entity, Location_Entity, ... are all columns in your CDS Entity, please replace them with actual column name from your CDS Entity

 

Set the OnVisible property of the 2nd Screen to following:

Clear(TempCollection);
ForAll(
       'Your CDS Entity',
       Collect(
               TempCollection,
               {
                    Id: ItemID,
                    Warehouse: Warehouse_Entity,
                    Location: Location_Entity,
                    'Journal type': JournalType_Entity,
                    Item: Item_Entity,
                    Quantity: Quantity_Entity
               }
       )
)

 

Please consider take a try with above solution, then check if it could help in your scenario.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi Kris,

 

Actually yes, I'm in the middle of creating the same, with collection also. Mind to tell me that dropdown -  "WarehouseDropdown.Selected.Value," what control is that, I'm using a DataCard that attached to my Data source, which is correctly displayed as combo box, but as I tried to refer to that DataCardValue, it does not give me an option of Value. 

 

So if for example my dropdown control name is DataCardValue3, I can only type until "DataCardValue3.Selected" 

 

Thanks,

Hi @Voltes ,

The "WarehouseDropdown" that I mentioned is actually the DataCardValue3 that you mentioned. If you want to reference the selected value from the ComboBox, please use the following formula:

DataCardValue3.Selected.Value

Note: I assume that the DataCardValue3 connected to an Option Set type column in your CDS Entity.

 

When you patch data from your collection back to your CDS Entity, there is something you need to know -- when assign data to the Option Type field, you could not provide a String value for it directly, instead, you need to provided available option under this Option Type field:

ForAll(
       Filter(TempCollection, Not(Id in 'Your CDS Entity'.ItemID)),
       Patch(
            'Your CDS Entity',
            Defaults('Your CDS Entity'),
            {
              ItemID: Id,
              Warehouse_Entity: If(
                                   Warehouse = "Option1",
                                   Warehouse_Entity.Option1,
                                   Warehouse = "Option2",
                                   Warehouse_Entity.Option2,
                                   ...
                                ),
             ...
            }
       )
)

Note: I assume that the Warehouse_Entity represents the Option Set type column in your Entity, please replace it with actual column name

 

If the solution I provided above is helpful in your scenario, please consider go ahead to click "Accept as Solution" to identify this thread has been solved.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi Kris,

 

No, my DataCardValue3 is a data type Lookup, because I set a Relationship to my other entity which is the master data of Sites. Same as the other : Warehouse and Journal type. Is that why there is no suggestion of "Value" when I type DataCardValue3.Selected ?

 

Thanks

Hi,

I've managed to retrieved the value. So it turns out I need to use the field name instead ".value" at behind.

So the code is like this :

Collect(colEntry,

{ Site : DataCardValue3.Selected.Site,

Warehouse : DataCardValue4.Selected.Warehouse,

JournalType : DataCardValue5.Selected.'Inventory Journal',

Item : GalleryProducts.Selected.Name,

Qty : 1 })

 

But there are some problem, number 1 is the returned value is the GUID not the text / id / name. like below:

image.png

Is it because it is a relationship that I set to its master entity ? How to have the text / name ?

With GUID like that, I cannot insert into my CDS transaction table, right?

 

Another one is, as I'm using Gallery of products to connect with the Barcode scanner result, the behavior that I'm planning is, after Barcode scanner send back the scan result, it will search and filter my Gallery of products. This is working perfectly, but to make it "selected" as in my Collect's code "Item : GalleryProducts.Selected.Name,", we should touch/select the gallery first (although it is only contain 1 (one) row). Can we make it as it is selected already ? or what is the code to retrieved the filtered Gallery ?

 

I'm so sorry, this has 2 questions in this topic.

 

Many thanks in advance.

 

 

 

 

Hi @Voltes ,

For your first question, based on the screenshot that you mentioned, I think the Site, Warehouse, JournalType column are all LookUp type columns in your CDS Entity, which references record value from other Entities, is it right?

 

According to the formula that you mentioned, I think the DataCardValue3.Selected.SiteDataCardValue4.Selected.Warehouse and DataCardValue5.Selected.'Inventory Journal' formula all reference the Unique Identifier column value (GUID value) from related Entities.

Your thought is right, with these GUID value, you could not insert it to your Main Entity properly. As an fixed solution, please modify your formula as below:

Collect(
       colEntry,
      {
        Site : DataCardValue3.Selected,      // Reference the record directly from the corresponding ComboBox
        Warehouse : DataCardValue4.Selected,  // Reference the record directly from the corresponding ComboBox
        JournalType : DataCardValue5.Selected, // Reference the record directly from the corresponding ComboBox
        Item : GalleryProducts.Selected.Name,
        Qty : 1
      }
)

then you could save your colEntry data back to your Main Entity.

 

For your second question, based on the needs that you mentioned, I think you could consider set a Default value within your Gallery based on the scanned barcode result. Please set the Default property of the Gallery to following:

LookUp('Products Table', FilteredColumn = BarcodeScanner1.Value)

Note: Above LookUp function is used to find the specific record based on the scanned barcode result.

 

Actually, if there is only single one record in your Gallery against the scanned barcode result, the single one record would be selected automatically without selecting it manually.

Note: In default, the first item in the Gallery would be selected automatically

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi Kris,

 

Sorry to inform you, the last suggestion is still not working. 

Collect(
       colEntry,
      {
        Site : DataCardValue3.Selected,      // Reference the record directly from the corresponding ComboBox
        Warehouse : DataCardValue4.Selected,  // Reference the record directly from the corresponding ComboBox
        JournalType : DataCardValue5.Selected, // Reference the record directly from the corresponding ComboBox
        Item : GalleryProducts.Selected.Name,
        Qty : 1
      }
)

Unless I'm wrong, but u suggested to type until ".Selected" only, right ? Actually it give me error like below:

 

errorerror

Btw, "For your first question, based on the screenshot that you mentioned, I think the Site, Warehouse, JournalType column are all LookUp type columns in your CDS Entity, which references record value from other Entities, is it right?"

--> Yes, it is. Actually I mentioned it in this previous conversation. 😅

 

Anymore suggestion what I should used in that Collect statement ?

 

Thanks,

 

 

Hi @Voltes ,

If these Site, Warehouse, JournalType column are all LookUp type columns, you could reference the Primary Name column in those related Entities through these LookUp field.

 

For example, the Warehouse LookUp field reference record value from the 'Warehouse Entity', and the Primary Name column in your  'Warehouse Entity' is called "Warehouse Name" (stores "WH1", "WH2",  ...). Then you could reference the "Warehouse Name" column value from the 'Warehouse Entity' through the Warehouse LookUp field using the following formula:

DataCardValue4.Selected.'Warehouse Name'

Note: I assume that the DataCardValue4 (ComboBox) is connected to the Warehouse LookUp field

 

So on your side, you need to modify your Collect formula as below:

Collect(
       colEntry,
      {
        Site : DataCardValue3.Selected.PrimaryNameColumn_SiteEntity,      
        Warehouse : DataCardValue4.Selected.PrimaryNameColumn_WarehouseEntity,  
        JournalType : DataCardValue5.Selected.PrimaryNameColumn_JournalTypeEntity,
        Item : GalleryProducts.Selected.Name,
        Qty : 1
      }
)

Note: The PrimaryNameColumn_SiteEntity, PrimaryNameColumn_WarehouseEntity, ... represents the corresponding Primary Name Column in these Related Entities.

 

Please try above formula, then check if the issue is solved.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements

Community will be READ ONLY July 16th, 5p PDT -July 22nd

Dear Community Members,   We'd like to let you know of an upcoming change to the community platform: starting July 16th, the platform will transition to a READ ONLY mode until July 22nd.   During this period, members will not be able to Kudo, Comment, or Reply to any posts.   On July 22nd, please be on the lookout for a message sent to the email address registered on your community profile. This email is crucial as it will contain your unique code and link to register for the new platform encompassing all of the communities.   What to Expect in the New Community: A more unified experience where all products, including Power Apps, Power Automate, Copilot Studio, and Power Pages, will be accessible from one community.Community Blogs that you can syndicate and link to for automatic updates. We appreciate your understanding and cooperation during this transition. Stay tuned for the exciting new features and a seamless community experience ahead!

Summer of Solutions | Week 4 Results | Winners will be posted on July 24th

We are excited to announce the Summer of Solutions Challenge!   This challenge is kicking off on Monday, June 17th and will run for (4) weeks.  The challenge is open to all Power Platform (Power Apps, Power Automate, Copilot Studio & Power Pages) community members. We invite you to participate in a quest to provide solutions in the Forums to as many questions as you can. Answers can be provided in all the communities.    Entry Period: This Challenge will consist of four weekly Entry Periods as follows (each an “Entry Period”)   - 12:00 a.m. PT on June 17, 2024 – 11:59 p.m. PT on June 23, 2024 - 12:00 a.m. PT on June 24, 2024 – 11:59 p.m. PT on June 30, 2024 - 12:00 a.m. PT on July 1, 2024 – 11:59 p.m. PT on July 7, 2024 - 12:00 a.m. PT on July 8, 2024 – 11:59 p.m. PT on July 14, 2024   Entries will be eligible for the Entry Period in which they are received and will not carryover to subsequent weekly entry periods.  You must enter into each weekly Entry Period separately.   How to Enter: We invite you to participate in a quest to provide "Accepted Solutions" to as many questions as you can. Answers can be provided in all the communities. Users must provide a solution which can be an “Accepted Solution” in the Forums in all of the communities and there are no limits to the number of “Accepted Solutions” that a member can provide for entries in this challenge, but each entry must be substantially unique and different.    Winner Selection and Prizes: At the end of each week, we will list the top ten (10) Community users which will consist of: 5 Community Members & 5 Super Users and they will advance to the final drawing. We will post each week in the News & Announcements the top 10 Solution providers.  At the end of the challenge, we will add all of the top 10 weekly names and enter them into a random drawing.  Then we will randomly select ten (10) winners (5 Community Members & 5 Super Users) from among all eligible entrants received across all weekly Entry Periods to receive the prize listed below. If a winner declines, we will draw again at random for the next winner.  A user will only be able to win once overall. If they are drawn multiple times, another user will be drawn at random.  Individuals will be contacted before the announcement with the opportunity to claim or deny the prize.  Once all of the winners have been notified, we will post in the News & Announcements of each community with the list of winners.   Each winner will receive one (1) Pass to the Power Platform Conference in Las Vegas, Sep. 18-20, 2024 ($1800 value). NOTE: Prize is for conference attendance only and any other costs such as airfare, lodging, transportation, and food are the sole responsibility of the winner. Tickets are not transferable to any other party or to next year’s event.   ** PLEASE SEE THE ATTACHED RULES for this CHALLENGE**   Week 1 Results: Congratulations to the Week 1 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge. Community MembersNumber of SolutionsSuper UsersNumber of Solutions @anandm08  23 @WarrenBelz  31 @DBO_DV  10 @Amik  19 AmínAA 6 @mmbr1606  12 @rzuber  4 @happyume  7 @Giraldoj  3@ANB 6 (tie)   @SpongYe  6 (tie)     Week 2 Results: Congratulations to the Week 2 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge. Community MembersSolutionsSuper UsersSolutions @anandm08  10@WarrenBelz 25 @DBO_DV  6@mmbr1606 14 @AmínAA 4 @Amik  12 @royg  3 @ANB  10 @AllanDeCastro  2 @SunilPashikanti  5 @Michaelfp  2 @FLMike  5 @eduardo_izzo  2   Meekou 2   @rzuber  2   @Velegandla  2     @PowerPlatform-P  2   @Micaiah  2     Week 3 Results: Congratulations to the Week 3 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge.   Week 3:Community MembersSolutionsSuper UsersSolutionsPower Apps anandm0861WarrenBelz86DBO_DV25Amik66Michaelfp13mmbr160647Giraldoj13FLMike31AmínAA13SpongYe27     Week 4 Results: Congratulations to the Week 4 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge.   Week 4:Community MembersSolutionsSuper UsersSolutionsPower Apps DBO-DV21WarranBelz26Giraldoj7mmbr160618Muzammmil_0695067Amik14samfawzi_acml6FLMike12tzuber6ANB8   SunilPashikanti8

Check Out | 2024 Release Wave 2 Plans for Microsoft Dynamics 365 and Microsoft Power Platform

On July 16, 2024, we published the 2024 release wave 2 plans for Microsoft Dynamics 365 and Microsoft Power Platform. These plans are a compilation of the new capabilities planned to be released between October 2024 to March 2025. This release introduces a wealth of new features designed to enhance customer understanding and improve overall user experience, showcasing our dedication to driving digital transformation for our customers and partners.    The upcoming wave is centered around utilizing advanced AI and Microsoft Copilot technologies to enhance user productivity and streamline operations across diverse business applications. These enhancements include intelligent automation, AI-powered insights, and immersive user experiences that are designed to break down barriers between data, insights, and individuals. Watch a summary of the release highlights.    Discover the latest features that empower organizations to operate more efficiently and adaptively. From AI-driven sales insights and customer service enhancements to predictive analytics in supply chain management and autonomous financial processes, the new capabilities enable businesses to proactively address challenges and capitalize on opportunities.    

Updates to Transitions in the Power Platform Communities

We're embarking on a journey to enhance your experience by transitioning to a new community platform. Our team has been diligently working to create a fresh community site, leveraging the very Dynamics 365 and Power Platform tools our community advocates for.  We started this journey with transitioning Copilot Studio forums and blogs in June. The move marks the beginning of a new chapter, and we're eager for you to be a part of it. The rest of the Power Platform product sites will be moving over this summer.   Stay tuned for more updates as we get closer to the launch. We can't wait to welcome you to our new community space, designed with you in mind. Let's connect, learn, and grow together.   Here's to new beginnings and endless possibilities!   If you have any questions, observations or concerns throughout this process please go to https://aka.ms/PPCommSupport.   To stay up to date on the latest details of this migration and other important Community updates subscribe to our News and Announcements forums: Copilot Studio, Power Apps, Power Automate, Power Pages