When we Shipped Quote into Dynamics GP From Dynamics CRM Which field changed - dynamics-gp

I want to get quotes that are shipped from Dynamics CRM to Dynamics GP. But I have only database access to get quotes. How can I get these quotes.
If anyone have an idea please share with me.

When a new quote is created in Dynamics GP, a new header record for the quote should be created in the SOP10100 table in that company's database. Try adding a trigger on the SOP10100 table, and look at the SOPTYPE (integer) value - a value of 1 means it's a quote. [In case it matters to you now or later: 1 = Quote, 2 = Order, 3 = Invoice, 4 = Return, and 5 = Backorder.]
Any line items for the quote will be in the SOP10200 table, and you can link the two tables using a combination of SOPTYPE and SOPNUMBE (the document number) - note that document numbers are only unique for a given SOP (Sales Order Processing) document type, so be sure to link the tables using both fields.
Other information related to the quote will be stored in other SOP (and maybe non-SOP) tables. Start by reviewing Victoria Yudin's excellent guide to the SOP tables at http://victoriayudin.com/gp-tables/sop-tables/. You can get more details about any given table from gptablereference.com, e.g. http://www.gptablereference.com/2010/Table/SOP10100.

Related

In Acumatica, using #me inside Relations Section of Generic Inquiry

We want to have a sales order dashboard where we only show orders for certain sales people based on the logged in user. For example, we have sales people BB and CR who share an assistant TP. BB can see his orders on the dashboard. CR can see his orders on the dashboard. TP can see orders for both of them on his dashboard. We also have people outside of sales who need to see all orders. We want to do all of this without having to create a bunch of custom dashboards. We wanted to maintain 2 dashboards - one filtered one for sales people and one unfiltered one for everyone else.
We have gotten close to solution by using a generic inquiry. We created custom fields on the salesperson that point back to a logged in user (UserID1 and UserID2). Multiple custom fields were used because a single sales person could be visible to 2 people. We then joined SOOrder to SalesPerson inside our GI. We then wanted to join the Users table on (SalesPerson.UserID1 = Users.PKID AND SalesPerson.UserID1 = #me) OR (SalesPerson.UserID2 = Users.PKID AND SalesPerson.UserID2 = #me). That would allow us to create a filter where Users.PKID is not null to limit the view for sales people and then not use any filter on the non-sales dashboard.
The problem is that #me is not available on the Relations section. It is only available on the conditions section. We tried to just have the join of SalesPerson.UserID1 = Users.PKID or SalesPerson.UserID2 = Users.PKID and then creating the condition for the #me portion. The issue there is that it only shows records with a match. That won't work for non-sales people.
Is there some way to include #me or an equivalent on the relations tab? Any better way to accomplish this?
Built-in variables like '#me' aren't well documented which raises questions about support of this feature.
Try this instead:
In generic inquiry TABLES tab, add table 'PX.Data.AccessInfo'.
In PARAMETERS tab, add a new parameter (ex: 'P1') and set the Schema Field value to 'Accessinfo.UserID' (use 'Accessinfo' or the alias for that table declared in TABLES tab).
In the RELATIONS tab in the join condition Child Field you can reference the '[P1]' variable.
Accessinfo DAC contains current record of the logged in user and reflects the information you see when you click your profile in the top right of Acumatica pages. If the solution doesn't work right away you can debug it with the Request Profiler page to look up the generated SQL query for the GI.

Table with variable number of rows in MS Office mail merge [duplicate]

I'm creating a compliance mailing for my organization, the mailing will include merge fields that identify the office location, physician, and SiteId. The mailing will also include a table of information that is dependent upon the particular SiteId.
I'd like to use the import table function of MS word and set up a query that references a merged field (SiteId) so that the inserted tables populate the appropriate data for the particular site. I'm unable to do this.
How can I set up this document so that I can import only records from my source (an ms access query) that match the SiteId merge field?
Word's mail merge does not support one-to-many relationships. There are ways to coerce it, but only one of them can yield a table as a result and over the years it has become less and less reliable as Microsoft has not regarded it as important enough to maintain...
What you need to do is set up a query that provides ONLY the information you want displayed in the table, plus the key (SiteId). It's best to sort it so that all the SiteId entries list together, and are in the order the data will come through in the mail merge data source.
On the Insert tab go to Text/Quick Parts/Insert Field and select the Database field from the list in the dialog box. Click "Insert Database" and follow the instructions in the dialog box to link in the data. Be sure to set the Query Options to filter on the first SiteId from the data source. When you "Insert Data" make sure to choose the option to "Insert as a field".
This inserts a DATABASE field in the document which you can see by toggling field codes (Alt+F9). The field code can be edited and what you need to do is substitute the literal SiteId value you entered for the query with its corresponding MergeField.
When you execute the merge to a new document that should generate a table for each data record corresponding to the SiteId for the record. But, as I said, Microsoft hasn't done a great job of maintaining this, so it may require quite a bit of tweaking and experimenting.
If the results are not satisfactory then you should give up the idea of mail merge and use automation code to generate and populate the documents.
You can find more (albeit somewhat out-dated) information on this topic at http://homepage.swissonline.ch/cindymeister/mergfaq1.htm

Finding Lookup item numerical values in MS Dynamics

I have a site powered by ExpressionEngine 2.5.x, using Freeform, integrated to post form data to MS Dynamics CRM 2011. The extension is nicely scalable, I can change the mapping, all that excellent stuff. My problem is how to find mapping values for Lookup fields in MS Dynamics.
I am trying to map form fields from the site forms, into MS Dynamics. Some of the fields are Lookups, in MS Dynamics. Our mapping calls out the numerical value of the Lookup item, rather than its name. (Which is good, because ppl can change the text names in the MS Dynamics console without breaking the mapping.)
My question is: I know how to find the actual back-end field names of form fields within MS Dynamics. But how to I find the numerical values of the picklist items and lookup fields? Say I have a Lookup field, for Lead Source (called campaignid). The items are:
web
online
radio ad
flyer
word of mouth
other
I know that when I edit options in an option set, I can see their numerical value. Where can I edit options in a lookup field? I've tried looking under Settings > Customizations > Customize the System, but didn't see anything called lookup.
Lookups are pointers to entities. They do not have numerical values like regular option sets. So I guess that you will have entity called Campaign (or lead) so you can check which campaigns exist in the crm DB where each entity will have view in the DB.
Let's see if i understand your question. You don't have a Lookup option like Option Set because a lookup is consequence of a relationship 1:N between two entities. So for edit a lookup you need edit a record of a entity. In lookup fields you don't have numerical values, you have guid that represent individually a record, so in a record a lookup is stored in database as a guid. Check this video.
Check here how find this guid with the record open.
A look-up field is, roughly speaking a pointer to en entity (in C# it's referred to as EntityReference instead of Entity) and it consist mainly of a guid and logical name of something.
Usually, in the code, when you have an entity, in order to access the fields of its lookup-connected entity, you'll need to make an extra query for that.
So, if you have a Contact instance and need to see the address of its parent customer, you'll have to get the guid and logical name (in this case it'll be Account) and retrieve the data for it separately.
EDIT:
Suppose that you have created an instance of Contact entity and you'd like to access its lastName field. Then you can simply refer to it as follows.
var value = Xrm.Page.getAttribute(“lastName”).getValue();
On the same form, there's also a field that refers to an Account instance (its name is parentCustomerId. Suppose now that you'd like to get the fullName field of the Account. One could expect the following to work.
var account = Xrm.Page.getAttribute("parentCusomterId").getValue();
var name = account.getAttribute("fullName").getValue();
However, that's not going to work, because the parentCutomerId is a look-up field. It means that it only contains a guid (a pointer, a reference) identifying an other entity. You'll have to use it (the guid) in order to fetch the instance that the look-up is "mentioning". Then you'll be able to check it's properties.

COGNOS report for a simple sub query and join Query

Here is my query. I am new to Cognos and using Cognos 10. And I am having a bit difficulty in developing a report which uses a Sub Query and an Inner Join Query.
1.
SELECT ID, BATCH_DT, LOCIT FROM AOI.TEMP_BRICK
WHERE BATCH_DT < (SELECT MAX(DATE) FROM CALENDAR)
2.
SELECT A.ID, B.SAL FROM TABLE as A LEFT OUTER JOIN TABLE as B
WHERE A.ID=B.ID
First, you must understand that Cognos generates its own SQL. In order for it to do that, you must define relationships between tables in Cognos Framework Manager. Once that is done your report has 3 major parts, The Report Page(s), the Prompt Page(s) and the Query(s).
a.) Setup the CALENDAR and AOI.TEMP_BRICK tables in Cognos. You may want to define a relationship between TEMP_BRICK.BATCH_DT and CALENDAR.DATE (assuming your calendar has date records for every date that may be present in TEMP_BRICK).
b.) Next you would create a new List Report. You would grab your ID, BATCH_DT and DATE fields into the list. (Date would come from the calendar if you decided to link the two tables in step A, otherwise you use the BATCH_DT field in TEMP_BRICK.)
c.) You would open the Query pages and see that Cognos has already created one query, called Query1. You need to create a new query (we will call it qryMaxDate). That query would have one element, 'DATE' from CALENDAR. On the properties of the 'DATE' field in Data Items, you would chagne the 'Agregate Function' from None to 'Maximum'.
d.) Now edit your Query1, add a Filter on the Date from that query. In the Expression Definition, select the Queries tab and drag the 'DATE' field from your qryMaxDate. Should look something like this [Batch Date] = [qryMaxDate].[Date]
e.) You are done! Run the report. in this case, the user running the report is giving no input, so no Prompt page is necessary.
a.) Setup Table A and B in the Framework Manager. You need to define a relationship between Table A and B in Framework Manager via a Star Schema (define A.ID = B.ID and specify 1 to n, or n to 1).
b.) Create a new report and simply drag in elements from table a and table b. Their relationship is already defined in Framework manager, so there is no need to re-define it while writing reports.
Your second example is a great demonstration of the power of BI programs like Cognos. Report Authors dont need to fully understand the ways that two tables are joined... they simply pull out elements from each table and they work, as the relationships are already defined in the Framework.

"Not in" view for 1:N relationships

Assume we have an entity A which has a 1:N relationship with entity B. I want to create a view, that shows only records of A which has no entity B. A good example is, I want to view Quotes without Order.
Any solution with any complexity would be appreciated, such as plugin, script, silverlight...!
You would have to tackle it indirectly one way or another:
use a SSRS report and embed that where it would be needed (eg in a dashboard). This would have to use SQL rather than FetchXML, so this could only be a solution for CRM On-Premise, not Online
Use a workflow or plugin on create of record B1, or update of B1's parent lookup to entity A, which updates parent record "A1" with some arbitrary field (eg "date of first Order" or "Is converted to Order"). Now just build a standard advanced find query for new_field contains data, (or = 1 if it is a bit field). Depending on the exact scenario, you might need to actually use an integer count if records of entity B could be routinely deleted, or reparented to a different parent A2, so that you can increment / decrement as appropriate (so a reparent would inc the new one and dec the old).
Edit: Note that in CRM 2013 ("orion"), the FetchXML implementation does support this kind of construction for a view, but the Advanced Find tool (for example) does not provide a UI for it. See the answer to this question for more information:
View Showing Accounts that don't have contact
Use the Advanced Find and Select Quotes, then for the criteria select the Order lookup field
and choose the operator to be Does Not Contain Data. By this way, you'll get all records for entity B which have no parents of entity A.
Download the FetchXML and use it in your Plugin or Silverlight.
Edit:
I think the best way is to create an N:N relation with manually created intersect table.
And your query has to select target the intersect table.
As you might know, the intersect table links to both Entities A and B.
The criteria will be: selecting Intersect table where there is no reference to Entity B.

Resources