Setting an ID type property value from workflow in FileNet - filenet-p8

Is it possible to set value for an ID type property from a workflow?
We have a workflow to create a date wise record folder everyday when first mail for that day is ingested in the system (IBM IER). For this we are using createRMFolder method from RM_Operations component which is OOTB component for IER.
We can set the properties for the new folder by passing them as a string array to the operation. But the issue is we need to set value for an ID type property for the newly created record date folder.
Please suggest if there is way of achieving this.

You can use the bundled CE_Operations component. Specifically, you need to use the setObjectProperty method passing it the Id object.

Related

How to autogenerate Primary Name field in custom Common Data Service Entity?

Primary Name field is by default "Required". How to fill this field by GUID or random number on save?
Codeless solution: You can mark that field as not a Business Required, so you will be unblocked. You can use a codeless UI workflow to populate the Primary Name field with some fixed text. This WF can be triggered on post-create.
Code solution: Plugin can be triggered on pre-create & custom C# code can be used to pre-populate some autonumber/text in this field.
Pro tip: Model driven app is nothing but classic Dynamics CRM, so while searching for solutions use that keyword :)
There is a GUID() function in PowerApps that generates a random GUID. By default, its result is a GUID type of data (text, value, date, etc.).
Primary Name is a text field. To coerce the result of the GUID function to be a text string, wrap Text() around it:
Text(GUID())
So in your Patch statement or in the Update property of the field for PrimaryName, you can use the expression above to put in a GUID as a string.

Filenet - Copy value from a workitem to document Property

I am new to Filenet BPM and I am trying to set a value from a workitem to document Property. Here is my requirement -
I have a Workflow with a document attached which should go to approval process, If it is approved then I have to set a property name 'status' in document property to 'Approved' and if it is rejected then I have to set it as 'rejected'. At first I thought it should be easy but I do not find any way to achieve this. Please help.
If you already have the document as an attachment, use the default, out of the box CE_Operations queue to update the property. See the screenshot for a small sample.
Dependant on the outcome of the activity, you call the an operation and use the 'setStringProperty' operation. As attributes it takes the attached document, the property to update and the value to set.

Servicenow - Service Catalog Reference Field - Insert different column than the display value

Let me describe my problem:
I have a table for all my IT-Services. I reference to this table more than once, for different purposes. Most of the time I need to reference to the name of the service. That's why I keep the name as displayed value.
One Column of that table is a service_id (custom field) which is for example "Service_004". Now in a catalog request Item the User has to fill in the service_id in a reference field.
But since I have the name as displayed value, and I need it in other forms, I am unable to reference to the service_id.
Using the variable attributes field I managed to let the service be found using the autocomplete function. But in the reference field I still get the servicename. I know that I can change the display value in the dictionary, but this breaks other functions. So what I need is to change the display value just for one reference field.
Also I tried to create a new table called IT-Services2 with reference to my table IT-Services. Then I switched the display to true in the new table for my service_id, but this will even change it in the parent table.
Perhaps an onChange client script utilizing g_form.setLabelOf() ?
http://wiki.servicenow.com/index.php?title=GlideForm_(g_form)#setLabelOf
Maybe I'm not fully understanding your question...
I ran into this issue before, what you can do is create select box variable and use an on load client script to populate the list with the service_id(s) from the table you are referencing.
I would write a script include to pull the data from the table and call it from the client script via GlideAjax.

CRM 4 Add Picklist Value

I would like to create a possible value for a specific picklist on CRM4.
I can see that the possible values are located in the stringmap table. My question is about how to properly add another record. The objecttypecode (10063) and attributename (assessmenttype) already exist - I simply need to add a new option to the picklist.
Of course, not wanting to void our support, I cannot just add the record to the table.
I have exported the xml configuration of this entity, and I can see the picklist values in this file under the "options" node of the picklist attribute node. I have imported this customization but it clearly is not all that needs to be done - my new values are neither in the stringmap table or visible on the form. what else needs to be done?
You need to use the metadata web service to make these updates. Check out http://technet.microsoft.com/en-us/library/dd904037.aspx for a walkthrough of how to create picklists. You'll also want to look at the UpdateAttributeRequest class.

MS CRM - getting the field that caused a form save

I have a MS CRM 4 form where when certain fields are changed, I need those fields to be written to an excel sheet.
So, I edited the form field onchange event to call crmform.save() which triggers a plugin to run that writes the field value to a named range (1 cell) of an excel sheet.
However, I don't know which field caused the save. Is there a way to get that information? (Not all fields on the form need to go to the excel sheet)
If I use this: DynamicEntity target = (DynamicEntity)Context.InputParameters[ParameterName.Target];
I can look at specific fields, but I have no way of knowing which ones changed.
Any suggestions?
It's my experience that only the changed fields will have value (in the DynamicEntity) when you update an entity. So let's say you have an entity with a FirstName and Lastname. If you only change the LastName and save. The LastName will have a value however FirstName with be null (unless you have som javascript code that forces the FirstName to be submitted).
If your plugin is triggered on the Pre-Event of the Update on your entity, you should be able to compare the IPluginExecutionContext.PreEntityImages to your DynamicEntity that you've fetched from the Target.
Or if your plugin is triggered on the Post-Event of the Update, you should be able to compare the IPluginExecutionContext.PreEntityImages with IPluginExecutionContext.PostEntityImages.
Looks like you are already going a different way, but another suggestion is to create a hidden field - "FieldThatChanged." In your field on-change javascript, set that field to the name of the field that changed, then access that in your plugin.
Yep, totally changed the way I approached this. I'm using jquery in an iframe to pass all the exact fields (name/value pairs) I want to a method of an ASPX file running in the ISV folder that takes the neccesary action. Thanks for the suggestions all!
I recommend using the Pre and Post Images as suggested by #Forgotten Semicolon. And in addition set the Filtering Attributes so the Plugin is triggered only on the change of the fields you care about.

Resources