Xrm.Page.ui.getFormType() returns 2 when create order from quote - dynamics-crm-2013

When i am creating an order from quote, in onload Xrm.Page.ui.getFormType() returns me the value 2.
but the form is in create mode, so should return 1.

When you "win" a quote and a Sales Order is generated, there is no Create state presented by the UI - the system creates the new record in the background and then displays it. When you are presented with the new Sales Order through this process, it already has a record ID so Xrm.Page.ui.getFormType() will return 2, which is the Update state.
The only way to get the Create state (1) from Xrm.Page.ui.getFormType() would be to manually create a Sales Order. However, if you do this you will lose much of the convenience the system does automatically for you, such as copying over all fields with the same name (essentially duplicating the Quote data into the the new Sales Order).

Related

How to pass Note from Sale Order Line to Transfer (Detailed Operation Line)?

In Sale Order Line, there is an option to write down some notes in the lines as "note". When the Sale Order is confirmed, the data is sent to stock.picking (Transfers) and the lines from Sale Order Line appear in Detailed Operations in the Transfers page, but without the note.
Where should I look for in order to customize and/or configure it to achieve such goal?
There is no differanciation of line types for stock.picking lines as for sales order lines. In sales order lines it's made by the field display_type.
Trying to imitate this feature for pickings could end in a mess. Personally i would try to get all notes and either copy them to a new notes one2many field or just in one new note text field on the created picking. Or maybe even "easier" is to compute all notes, because every picking line (stock.move) has a connection to the original sales line (sale_line_id) and so indirectly to the sales order or even directly by field stock.picking.sale_id.

Qliksense; dynamic dimensions for table

I'm trying to create a "dynamic" dimensions for a table in Qliksense. In Qlikview, I was able to do this by creating buttons that assign a value(field) to a variable, and then simply use the variable as the dimension in the table. This does not seem to work in Qliksense. As an example: I am trying to create a table that shows the total sales volume, number of transactions, average order value and conversion. I want to be able to toggle between the dimensions merchant country, consumer country and merchant. How can I make this happen?
It should be the same approach as QlikView.
(Using QS June 2020 version)
created a variable called vDimension
created 2 buttons
button 1's action is to Set variable value (vDimension) to [My Field]
button 2's action is to Set variable value to [My other Field]
created a table and for the dimension added =$(vDimension) (and whatever measures)
With this setup whenever one of the buttons is pressed the table's dimension is changed as well

How to provide ID counter starting from 1 for each new user?

I am implementing a multi-users website. They can create "items".
When a new user registers and creates his first item I want it to have an ID of 1, not 2728 (its ID from DB).
So I need some kind of mapping? E.g.
| real_item_id | fake_item_id |
2728 1
So for each Account I will have a table with fake_id starting from 1 and incrementing every time a User creates an item?
Maybe there is another, better approach?
I think you don't need any new table for this. Just add a column fake_id into items table and scope it with user_id for uniqueness.
Also create a custom validation method in model to assign fake_id to Item while creating. Thanks
Simply create a table to track items created by each User and keep on increasing Items count whenever user creates new item and update increased items id into main table(more easier)
or
Another approched will be keep two column on your table one User ID and another one for Items Id which will get increamented id on each new item inserted by particular user by checking last item inserted by particular user.

MS Access manual Auto incrementing field

Im building a system for my company to keep track of internal orders, inbetween our warehouses, we have material that goes out warehouse 1 to warehouse 2 and we kind of lose track of how much of "x" is in warehouse 1 and how much in warehouse 2, so i want to implement this access db where a user fills a form and says: order 1: 500 of "x" order 2: 300 of "y". then another user fills an exit form where he says 1 of "x" going out, so i would need the program to keep track of total order and how much as gone out to fill order 1 and so on...
My idea here is to have both an order number and an id number for each of "x" everytime someoneone assembles 1 "x" they fill the form and print a label directly from the access (i have this part working already) while keeping a record of when it was assembled, who verified and what was verified (it will work as a quality control also).
What i dont know is how to program the db so when it reaches 500 of "x", the id number for "x" starts again from 1
This is the one major issue with my program right now, i'm not experienced in access db's or vba, but im getting there with a tip and a trick from here and there, so, no need to be careful with the technical language, i will google it if i have to :p
EDIT:
The table structure goes as follows:
1 table as the main table where I record the check that is made for every product, where I include the model of the product, the said ID that I want to reset after a number of products checked, and a concatenated field that includes most of this information to generate a qr code.
Then there is a table for the Order Number, which is connected to a form to record each new order with a date/time field, the order number itself and the number of products. This number of products must then be called from the code that will count how many products have been checked to date and keep the order number field updated so we can keep track of the order.
Then there is another minor table just to get values for the form, the product models
Thank you for your answers ;)
See this MSDN Documentation
Unfortunately in Access, you cannot 'reset' an ID field, unless you move the records to a newly created table and use that table for every 500 records.
As for the user control and login form, I'm afraid those are separate questions that must be asked in a different thread.
To get you started:
You can set the RecordSource of a form to a table, and when users make entries, the data will be saved to the table. You can also use a form with controls (text boxes, comboboxes, etc.) and create a button that runs a query to insert these records into a table.
The login piece - you can encrypt the database with a password. That may/may not be sufficient.
I would suggest you change your schema, if possible. Something like the following:
Orders
OrderID (Autonumber)
ProductID (link to your Products table)
QuantityRequested
Deliverables
DeliverableID (Autonumber)
OrderID (link to your Orders table)
SequenceNumber: in the BeforeInsert event set this value equal to:
DCount("*", "Deliverables", "OrderID=" & Me.OrderID) + 1
I'm assuming that your form has a control named OrderID that is bound to the OrderID field of the Deliverables table.
The code uses the DCount() function to get the count of all the other deliverables that have already been created for this order. If this is the first deliverable, DCount() will return 0. It then adds 1 to this count to get the sequence number of the next deliverable.
If the new SequenceNumber is greater than the quantity requested, you could display a message saying that the order has been filled and cancel the creation of the Deliverable record.
This is just one approach and it is not a complete solution. I'm assuming that once assigned a sequence number a deliverable cannot be deleted. You might need to make allowances for deliverables that get lost or damaged. You could incorporate a status field to the Deliverable table to deal with this, but you would still need to make a decision about what to do with the SequenceNumber.

Database Design: Line Items & Additional Items

I am looking for a solution or to be told it simply is not possible/good practice.
I currently have a database whereby I can create new orders and select from a lookup table of products that I offer. This works great for the most part but i would also like to be able to add random miscellaneous items to the order. For instance one invoice may read "End of Tenancy Clean" and the listed product but then have also an entry for "2x Lightbulb" or something to that effect.
I have tried creating another lookup table for these items but the problem is i don't want to have to pre-define every conceivable item before I can make orders. I would much prefer to be able to simply type in the Item and price when it is needed.
Is there any database design or workaround that can achieve this? Any help is greatly appreciated. FYI I am using Lightswitch 2012 if that helps.
One option I've seen in the past is a record in your normal items table labeled something like "Additional Service", and the application code will recognize this item and also require you to enter or edit a description to print with the invoice.
In the ERP system which we have at work, there is a flag in the parts table which allows one to change the description of the part in orders; in other words, one lists the part number in the order and then changes the description. This one off description is stored in a special table (called NONSTANDARD) which basically has two fields - an id field and the description. There is a field in the 'orderlines' table which stores the id of the record in the special table. Normally the value of this field will be 0, which means that the normal description of the part be displayed, but if it's greater than 0, then the description is taken from the appropriate row in the nonstandard table.
You mean something like this?
(only key attributes included, for brevity)