Wednesday, July 24, 2013

How to expose a hidden field in Siebel list applet?

This is a very simple requirement that I am talking about today, where on a button click you are required to do a GetFieldValue() of a active BC field, which is NOT exposed on the UI and doesn't have the Force Active property checked. If you try to do that, system prompts an error sayng:

A script failed to get the value for field <field name> because the field was not active.(SBL-EXL-00119)

So the basic solution anybody can tell is, "why don't you expose the field on the applet with HTML Type = Hidden?"

Well, this sounds very simple and works fine also, but ONLY in the form applet. So in a form applet, if you expose a field with HTML Type = "Hidden", then it will not be visible to the user and you can easily do GetFieldValue of that field. But the same thing doesn't work if it is a List Applet, even if HTML Type = Hidden, the list column would be visible.

The only workaround I found was, set the HTML Type = Hidden and instead of exposing the field as the list column, expose it as the control i.e. expose at any empty placeholder where you can expose buttons/labels etc. It works fine.

How to migrate Runtime Events (RTE) from one env to another env?

Runtime Events (RTE) and Data Validation Manager (DVM) are the two highly used features whenever there is a requirement for imposing business rules in the process. Every another project has their own business rules to implement and Siebel developers use RTE and DVM as their first choice (mostly). Problem comes in when you are done with the development and now its time to move the RTE and DVM (Rule Sets) to different Env (QA, UAT etc). So if you have plenty of RTE implmented, it would be cumbersome job to create those RTE again in different env at various stages of the project life cycle.

To ease the job, Siebel has provided the way for taking the export it into a XML file and again import it back into another env. Runtime Events -> Menu -> XML Import/XML Export.

But, the irony is, it doesn't work as you expect. The basic assumption would be, you query your RTE, take the XML export and import the XML file into other env. System should get the new RTE created for you. But the reality is, this way you will end up exporting "ALL" RTE from the source env to destination env (which you never wants).

So, how to get the Runtime migrated?

  1. Navigate to ‘Administration Deployment Manager -> Deployment Projects’. Click ‘New’ and create a project for exporting the RTE. Remember to check ‘Export to File’ flag to ‘Y’.
  2. In the below applet create a new record and pick ‘Data Type Name’ as ‘Personalization – Events’. Save the record.
  3. Expand the ‘Data Type Name’ (by clicking on the + icon)      
  4. Drill down on the ‘Personalization – Events’ and you are navigated to ‘Administration Runtime Events -> Events’
  5. Query for the event you want to export and by using "Query Assistant", save this as PDQ.
  6. Again go back to your deployment project at ‘Administration Deployment Manager -> Deployment Projects’ and in the pick applet for the field ‘Deployment Filter’ against ‘Personalization – Events’ select the name of the PDQ you saved in the above step.
  7. Now Drill down on the ‘Personalization – Action’ and you are navigated to ‘Administration Runtime Events -> Action Sets'
  8. Query for the Action Set associated with your event you want to export and by using "Query Assistant", save this as PDQ.
  9. Again go back to your deployment project at ‘Administration Deployment Manager -> Deployment Projects’ and in the pick applet for the field ‘Deployment Filter’ against ‘Personalization – Actions’ select the name of the PDQ you saved in the above step.
  10. Check your configuration by clicking ‘Validate Filter’ button. If everything is fine click the ‘Enable’ button on the top applet. Status of your deployment project changes to ‘Enabled’ from ‘Draft’.
  11. Now go to ‘Administration Deployment Manager -> Deployment Sessions’. Create a new record and select the project you created in step 1.  Save the record
  12. Press the ‘Deploy’ button on the top applet and give the path on the server (if connected to thin client) or local machine (if connected to thick client) where you want the export file to be generated.
  13. Status changes to ‘Export Completed’ and the field ‘Log’ gives you the name of the xml file generated as a result of your export.
  14. Copy the xml files generated to you local machine (if connected to thin client)
  15. Go to the ‘Administration Data Manager -> Deployment Sessions’ on the server where you want to import your RTE. Click ‘Menu’ and select ‘Deploy From Local File’ and give the path where you have saved the xml files created and press ‘Import'.
  16. Your RTE will be created in the target system.

Special thanks to Manuj Garg for sharing this information.


Sunday, December 23, 2012

How to get the Date difference in Days, Hours, Minutes, Seconds


A one liner solution for requirement to find out the date difference between two different dates in eScript:

function Service_PreInvokeMethod (MethodName, Inputs, Outputs)
var Date1 = new Date("12/22/2012");
var Date2 = new Date("12/23/2012");

TheApplication().RaiseErrorText(
"Date1 =" + Date1 + 
"\n Date2 = " + Date2 + 
"\n Date Difference in Days = " + (Date2.getTime() - Date1.getTime())/(1000*60*60*24) + 
"\n Date Difference in Hours = " + (Date2.getTime() - Date1.getTime())/(1000*60*60) + 
"\n Date Difference in Minutes = " + (Date2.getTime() - Date1.getTime())/(1000*60) + 
"\n Date Difference in Seconds = " + (Date2.getTime() - Date1.getTime())/(1000));

            return (CancelOperation);
}

Here below is the output: