Let's Reconnect, thank you for making 2022 our best year yet.

Look Back
Add New Entity Record in OPA javascript plugin — Cloud Customer Connect
You're almost there! Please answer a few more questions for access to the Applications content. Complete registration
Interested in joining? Complete your registration by providing Areas of Interest here. Register

Add New Entity Record in OPA javascript plugin

Received Response
13
Views
2
Comments
edited Sep 27, 2017 9:26AM in Intelligent Advisor for Fusion Service 2 comments

Content

Hi ,

 

I have a requirement to to add a new record of entity instance in OPA interview based on certain conditions and this should be done on a custom button click.

In am trying to use the use function "getRows()","getDefaultBlankInstances()" and "addNewRow()".

Could anyone help me how to use these functions(syntax to use these functions).?

 

Thanks,

Sudhir

Version

OPA 12.2.8

Code Snippet

             OraclePolicyAutomation.AddExtension(
{
	customHeader: function(interview) 
	{
		return { 
			mount: function(el) 
			{
				var buttonDom = document.createElement("button");
				buttonDom.innerHTML = "Custom Button";
				buttonDom.setAttribute("type","button");
				buttonDom.onclick = function(event)
				{
				event.preventDefault();
				interview.addNewRow();
			   var sScreen = interview.getStages();
				var rscreen = interview.getScreens();
				//alert(rscreen);
				for (var i =0;i<= 8 ;i++)
				{
				var rScreen1 = rscreen[i];
				rScreen1 =rScreen1.caption;
			
				if ( rScreen1 == "Notes")
				
				{
						//alert(rScreen1);
					interview.addNewRow
					//var rRows = sRows.caption;
					
					
				}

				}
				//interview.setInputValue("global_input", "Custom Button input");
				//interview.submit();*/
				}
				el.appendChild(buttonDom);
			},
				update: function(el) 
				{
			    }
		}
	}
}); 
        

Howdy, Stranger!

Log In

To view full details, sign in.

Register

Don't have an account? Click here to get started!