Can you create business rules based on child grids?
When creating an Opportunity there is a grid called "Sales Team" and a field called "Identify Sales Team".
I would like to create the following business rules when creating an Opportunity or moving it between stages in the workflow Process.
User must enter at least one row in the Sales Team grid.
The Identify Sales Team value is set to "Mark Complete" when no rows. If one or more rows are added then the Identify Sales Team value is set to "Complete".
How can this be done?
Not using business rules as far as I know.
You can use JavaScript to count the number of records in a sub grid, then set the field conditionally in JavaScript.
var count = Xrm.Page.getControl("sales_team_grid").getGrid().getTotalRecordCount();
if(count > 0) {
... set your field value
}
Related
I have a list of opportunity product lines associated to opportunities that I want to pass to a field within the opportunity table so users can see this within the opportunity table view. The products in the opportunity lines are Number of learners. For projecting onboarding numbers for the month I want to add one field to my opportunity entity.
Total number of learners
This field would be populated by the total quantity of all "learners" products in the opportunity product lines.
I have tried a roll up field, but I can't seem to get it to sum up the quantity of products to appear within the new field created in the opportunity entity.
What features of Dynamics CRM could help me achieve this? MS workflow?
Rollup
Product Line
Rollup field on Form
rollup field should solve your req.
If that does not solve your problem, Then you can create Power autome/ cloud flow.
If not you can create Plugin
If not Javascript.
But my best bet or choice would be rollup and then cloud flow.
I am creating free accounting package in libreoffice-base to compete already available ones your contribution is appreciated. the package include tables:
items
item_groups
order_details
sales_bill_desc
cash
units
companyinfo
bill sales
Customer_ledger
etc.
and created two forms
first to enter items in items table with following fields:
id
List item
particulars
units from units table linked with id gst chooses from
tax table related as id basic price basic stock, barcode, group,
subgroup,
second form is sales bill entry form
it contains a form which relates to order_details table selects customers name from ledger where its state code is also defined e.g. for punjab its 03 basically it is picked from customer's GSTIN number
a subform which is connected to sales_bill_desc table related to order_details table with bill number in both tables.
now in subform when we enter one item, its name is displayed which is same entered in sales_desc table additionally it also need automatically display item units, gst, price(editable field but basic price must be displayed there).but it does not. how to do that i have studied books but am lacking i created same in access 2016 somewhere which worked fine (full working package accounts with inventory).At this time,I am trying to use same database but advanced with features such as barcode. Of course the issue is to be resolved if someone can help. I am loading code of the package.Please rectify and update.
I have a list of opportunity product lines associated to the opportunity. The products in the opportunity lines are labor based, engineering services. For projecting resource requirements I want to add two fields to my opportunity entity.
Total Labor Effort
This field would be populated by the total quantity of all "labor based" products in the opportunity product lines.
Weighted Labor Effort
Same as Total Labor Effort, except the value will be multiplied by the probability of closing the deal. This is a separate custom field in the opportunity.
I have tried a roll up field, but I can't seem to get it to sum up the quantity of the products in the product lines. It will only look at the product lines themselves. Calculated field seem to be more limited even.
What features of Dynamics CRM could help me achieve this?
If I could add my 2 cents,
There is indeed rollup field limitation here.
Now I could sense 2 ways to achive this.
Dynamics-365-Workflow-Tools
Reason been, this is well documented and up to date with latest CRM Version and especially fucntion query Values
If you don't want to add overhead of adding any 3rd party solution may it be free of cost, I would move my logic to Plugins i.e custom c# code to perform operations (server side)
I personally would go for custom code, you have more control of what you want to achieve there.
I recommend using Kaskela Workflow Elements, a free workflow extension that can query the opportunity products and return the number of line items: https://kaskelasolutions.com/current-query-get-results/
After you import Workflow Elements, you will need two workflows:
1. one that is started whenever a product line item is created /modified/deleted and it will update a "trigger" field on the opportunity, such as a "date detail changed"
2. one on the Opportunity that will count the detail lines.
In the 2nd workflow, use the "Query - Get Results" feature
You will need to create a FetchXML query to get the Opportunity Line items - you can use Advanced Find to create the query. This looks a bit strange because you create the query using the child records and link back to the parent opportunity, but this is how Kaskela filters the results to just the Opportunity Lines that are related to the opportunity.
The next step in your workflow is to insert the results into the opportunity record:
Ultimately I solved this using MS Flow to retrieve all the Opportunity Line from an "updated" Opportunity and summing them up before finally writing to the Opportunity field. For weighted value I made a simple calculated field based on the close probability and total labor effort.
MS FLow Screen Shot
I am trying to set up a global search where the user can search by invoice number and it shows the invoice AND related order with OOB solutions.
EDIT
Version: 2015
Unsure of when installed but was updated recently
Global Search works on top of Quick Find view & Find columns specified in particular entities. The searchable entities & its display order can be configured in System settings.
In your scenario, Add the entities Order & Invoice to searchable entities list (move it to top). Then setup the QF view display columns & Find columns (Invoice number) in view of both entities.
Read more
Update:
Order can have multiple Invoices associated (Invoice subgrid). Hence Order is a lookup on Invoice. This will make easy to QF with 'Order number' in both entity by 'Order number' field (text in Order, Lookup in Invoice).
But you need to QF 'Invoice number', which is available in Invoice only. You may need to store all the Invoice numbers in a custom field (comma separated) & use it for QF in Order entity.
How can I build a subgrid that displays related records both of the current record and records above it, and can it contain complex conditions ?
One of my requirements is this:
I want to put a subgrid in Account form showing the related Contacts of the current Account, and also include the Contacts related to Accounts above the current one if a Two Options attribute of the contact is set to Yes.
Specifically, I'm looking at the Company Name on Contact to establish it's related to an Account.
I'm at a loss and start to doubt it's doable.
Not an out of the box solution but if you don’t mind losing the sub grid command bar functionality you can use the following concept that displays a fetchxml inside a sub-grid.
Step 1 - would be to get all related accounts ids using a fetch or odata
Step 2 - construct a fetchxml with OR filter to get all contacts