The primary half is to create a brand new undertaking, which requires as one of many fields the title of the account on the undertaking. When the undertaking is saved, the first contact on the account document is robotically added as a Undertaking Member. The Picture under reveals the creation of the brand new undertaking.
When the document is saved, a Cloud Circulation is being known as that retrieves the Main Contact on from the account document, and creates the First Undertaking Member on the Undertaking. It additionally marks the member as Main, in order that it can’t be deleted from the App. The picture under accommodates the steps within the Cloud Circulation.
After the circulate is executed, we will see the undertaking member that was added inside the undertaking document, as proven under.
Subsequent, let’s go forward and take a look at the Canvas App. After we load the Canvas App, we’ve got the flexibility to pick the undertaking that we wish, after which as soon as the undertaking is chosen, we’ll see the Undertaking Members within the gallery (as proven under). You’ll discover that there’s a single member that’s seen, as it is a new undertaking that was created, and the default member was added to the undertaking.
You’ll discover the + button above the gallery. Clicking on the Plus button will enable us so as to add a brand new Undertaking Member. The motion will present a brand new part on the shape which can request a Contact, Date Added and Proportion, as proven under. The Contact discipline is filtered to solely present members that haven’t but been added to the gallery.
As soon as the member is added, I can see the 2 members in my gallery. I additionally see that the Save button is disabled, as a result of the overall membership share isn’t equal to 100%. I’ll add yet another member for the aim of the demo. I now see that I’ve three members with a complete membership share of 160%
To ensure that me to Save this document, I’ll have change the odds in order that they’re equal to 100%. Let’s go forward and try this, after which Save the document to see the outcomes.
Now, let’s return to the canvas app, and take away considered one of these members. You’ll discover that Paul Cannon, which is the Main Member doesn’t have a take away icon, as a result of that’s the main member. All different members, we will delete. Let’s go forward and delete Nancy Anderson, which has a 30% membership. The member is highlighted as eliminated. As a way to save the adjustments once more, we’ve got to replace the odds to match 100%, after which save the adjustments. The picture under reveals the document to be eliminated and the up to date percentages.
Now let’s go forward and save the document, and take a look at the ends in the Mannequin-Pushed app. You’ll discover that I nonetheless see the three Undertaking Members, however that’s as a result of I’m displaying each Lively and Inactive Customers. The member that was faraway from the group is displaying a date worth within the Member Eliminated on, which permits me to maintain observe of the members added and eliminated, and a historical past of such.
Subsequent, let’s go forward and take a look at the implementation. First, when the shape hundreds, we choose a undertaking and click on on the Go button. The OnSelect methodology of the Go button accommodates logic to load the tasks into a set, and cargo contacts into a set eradicating the contacts which are already added to the undertaking.
The plus button, solely units an Motion Sort worth to Add, which in flip shows all the listing of controls which are seen to permit addition of a brand new document. As soon as clicked I can see the Add Undertaking Member, Contact, Date Added, Proportion fields, and the Settle for and Cancel icons.
The Contact Combo Field, has a Filter to solely present Obtainable Contacts, utilizing the next line:
Filter(AvailableContacts, IsAvailable = true)
Clicking on the examine button (Settle for), will add a brand new Undertaking Staff Member into the gathering, and take away that member from the listing of accessible Contacts.
Lastly, for the Save motion, I loop via all of the Undertaking Staff Members, and both create a brand new member (primarily based on the Undertaking Member Id being clean), or replace an current document. The replace patch can both replace the proportion of the undertaking or deactivate the undertaking.
Under additionally, you will discover a video of this weblog and I’ll add the supply code to my github repository as quickly as I can.