kflorian
asked on
Update a custom field in MS CRM 4.0
I am running MS CRM 4.0 Online version. I want to get the unique id for each instance of the various entities but these are not displayed or accessible in the default interface. It is acceptable to me to create a new "shadow" field that will hold the GUID for, say, a specific lead record.
Ideally, I could achieve two things.
1. This value would be set at the time the record is created
2. I could find a way to set this value for already extant contacts (accounts etc).
What options do I have and what is wrong with the code below?
Ideally, I could achieve two things.
1. This value would be set at the time the record is created
2. I could find a way to set this value for already extant contacts (accounts etc).
What options do I have and what is wrong with the code below?
// my custom field is called aginity_extractedid, where the word "aginity" is the prefix that gets
// added automatically by crm 4.0. I've tried to set the value of this field in the OnSave event. While
// I am able to access the ObjectId, per the code below, my custom field does not update
crmForm.ExtractedId = crmForm.ObjectId;
ASKER
This is a step in the right direction. Thank you.
It doesn't matter if the user sees it. What I ultimately need is to export the value by placing it in a regular CRM view.
Now that I have it working at the onsave level, is there any way to batch update all records of a given entity type? Again, I am working in an online version so I do not have direct access to the sql tables.
It doesn't matter if the user sees it. What I ultimately need is to export the value by placing it in a regular CRM view.
Now that I have it working at the onsave level, is there any way to batch update all records of a given entity type? Again, I am working in an online version so I do not have direct access to the sql tables.
Sorry, but to be clear - your ultimate aim is to export the data from CRM along with the Guid? Is this to be a one-off or regular? Also is ongoing maintenance of the view you mentioned a key requirement or just a means to an end?
ASKER
Ultimate aim is to have access to the unique ID for whatever entity for permanent access in view(s) I will use the id as the linkage between two or more entities in excel tables....to generate reports that one can't get out of the stock CRM system.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
You asked the right question. Excellent diagnostics in helping me focus on the solution rather than the implementation.
Well done.
WIth thanks,
Ken
Well done.
WIth thanks,
Ken
ASKER
Not sure if this will get seen but...I may have spoken too fast...when I perform the actions shown in the beatnik post, I don't get the GUID.
I don't know if this makes any difference but I get the web query version of the data query....it doesn't automatically bring back any additional fields, nor do I see a way to add them.
I don't know if this makes any difference but I get the web query version of the data query....it doesn't automatically bring back any additional fields, nor do I see a way to add them.
ASKER
screen
screen.png
screen.png
From *memory*, I think one or both of the following is true:
- if you click OK after merely viewing the query definition, the Guid field becomes available at the end of the columnset
- the Guid column is by default hidden in Excel and needs to be made visible by selecting the columns either side, right-cliking the column headers and selecting "unhide"
ASKER
Greg,
Thanks for responding again...sorry for closing this out if that was the wrong thing to do. I tried what you said but I don't get any hidden columns. The only thing that comes back is whatever was in the underlying CRM view. I am something of an excel "expert" so I know I'm not overlooking a hidden column in excel at this point.
Perhaps we are dealing with the difference between using the online version of CRM? The query window shown in the beatnik example is the full ms query that one normally sees in excel. As far as I can tell, I cannot get access to that because the live excel file created by CRM is a "Web Query".....speculation on my part, however.
Thanks for responding again...sorry for closing this out if that was the wrong thing to do. I tried what you said but I don't get any hidden columns. The only thing that comes back is whatever was in the underlying CRM view. I am something of an excel "expert" so I know I'm not overlooking a hidden column in excel at this point.
Perhaps we are dealing with the difference between using the online version of CRM? The query window shown in the beatnik example is the full ms query that one normally sees in excel. As far as I can tell, I cannot get access to that because the live excel file created by CRM is a "Web Query".....speculation on my part, however.
I thought it would still be accessible from Excel despite being web query - but i have no experience to back this up since I've never used the CRM Online (Microsoft hosted) version. The organisation I work for resells the hosted solution, but from our own platform which has some differences with the Microsoft hosted version. This may be one of those differences...
The XLS file you download is, I think, an XML file with an XLS suffix. Open it in your favourite text editor and see if you can see any underlying SQL in there - if it is simply mapping columns from an HTML table via a webpage (this seems plausible on the grounds of needing less security administration), then you may have been right to go with your initial approach. That said, the XML may still be manipulable or contain data that is useful to you. If you SQL in there though, then great - that can be tweaked..
Let me know how you get on!
The XLS file you download is, I think, an XML file with an XLS suffix. Open it in your favourite text editor and see if you can see any underlying SQL in there - if it is simply mapping columns from an HTML table via a webpage (this seems plausible on the grounds of needing less security administration), then you may have been right to go with your initial approach. That said, the XML may still be manipulable or contain data that is useful to you. If you SQL in there though, then great - that can be tweaked..
Let me know how you get on!
ASKER
Greg,
I see this in the xml...the "contactid" is there but manually altering the xml to return it as a column...currently beyond my skillset but we'll see how it goes.
<WebPostString>name%3d%22e mailaddres s1%22%2f%3 e%3cattrib ute%20name %3d%22modi fiedon%22% 2f%3e%3cat tribute%20 name%3d%22 jobtitle%2 2%2f%3e%3c attribute% 20name%3d% 22contacti d%22%2f%3e %3c%2fenti ty%3e%3c%2 ffetch%3e% 0d%0a& lay</WebPo stString>
I see this in the xml...the "contactid" is there but manually altering the xml to return it as a column...currently beyond my skillset but we'll see how it goes.
<WebPostString>name%3d%22e
What are trying to achieve - simply to display the record Guid to the end user of the form?
Open in new window