cancel
Showing results for 
Search instead for 
Did you mean: 

Custom Button on Opportunity appearing in disable mode

Former Member
0 Kudos

Hello Experts,

1. I have created one custom button on the extension of Opportunity BO.

2. Added the Custom button to the TI in the UI Designer.

3. The button is now Visible on the C4C screen but its not coming as enabled.

    I have checked on the properties of the button its maintained Visibility as : True and Enabled as True .

Have I missed anything to be taken care ?

Accepted Solutions (1)

Accepted Solutions (1)

ambuja_prabhudessai
Participant
0 Kudos

Hello,

Have you created the script file for your action? Also, you need to bind the action to the Root node when you configured it in the UI designer.

Hope this helps.

Regards,

Ambuja

HorstSchaude
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hello Papps,

If the action is not bound the UI cannot determine what to execute.

As consequence the action is inactive.

Follow sugesstions.

Bye,

     Horst

Former Member
0 Kudos

Hi Ambuja,

Inside Opportunity Extn BO, the problem is if I am declaring any custom action at root level then , while binding it at the UI Designer the action is not available, if am putting inside ITEM node, then I can see the Action. Even if am binding the instance to the root node still the button is appearing disabled.

Any particular reason, why the action is not getting displayed if am declaring at the root node level  for Opportunity BO?

I have checked for another standard BO extension, its working fine. whatever action am declaring at the node level I can see those actions at root level and while binding also its available at UI designer . and output also appearing correctly .

ambuja_prabhudessai
Participant
0 Kudos

Hi Papps,

Initially even I was not able to see the custom action defined at Opportunity XBO root level in the UI designer. But then I restarted my UI designer and I was able to see it.

Please check that both, your action and XBO are activated properly and then restart the UI designer and open the Opportunity TI. This should work.

Regards,

Ambuja

Former Member
0 Kudos

Hi Ambuja,

Thanks for your reply, The button is now visible. As you suggested The binding solved the problem.

I am facing another issue in the same requirement , the button needs to be disabled when the account assigned to the opportunity is a prospect, What I though the way to do is , I have created a new element on the XBO and setting the element to true or false based on condition.

And bind this element to the action visibility option. though  I am able to do all the operations ,

But when am trying to set the element value which is of type Indicator , inside the script its displaying a message value can not be assigned as its a read only field .

Can you guide me why the simple element which  I created under XBO and just trying to set the value

is displaying the message as read only field ? 

ambuja_prabhudessai
Participant
0 Kudos

Hi Papps,

In which script are you trying to assign the value to the indicator field? The error which you get is at runtime or does it occur when you are writing the script?

Regards,

Ambuja

Former Member
0 Kudos

Hi Ambuja,

Its not run time, its at the time of writing the Script for the event Validation-OnSave.absl for the root.

basically when am trying to access the custom fields declared at the XBO Level all are appearing with a lock on top of that . which means they are read only .

Here I have placed the code

import AP.Common.GDT;

import AP.CRM.Global;

[Extension] businessobject AP.CRM.Global:Opportunity raises MsgNegativeValues, MsgInvalidDates{

message MsgNegativeValues text "Bonus Rate must not be negative";

message MsgInvalidDates text "The End Date must be greater than the Start Date";

      [Label("Risk Category")] element RiskCategory3:RiskCategCode;

   [Label("Risk Category")] element RiskCategory2:RiskCategCode;

   action fscmchk;

   element risk:ID;

   element RiskCatVis:Indicator;

Now on the event when am trying to assign value to the identifier field am getting the error .

ambuja_prabhudessai
Participant
0 Kudos

Hi Papps,

You cannot change the value of a field in a validation script. You can only read the data. This is the reason why all fields appear as read-only in a validation script file.

You should try setting the indicator value in beforeSave event.

Regards,

Ambuja

Former Member
0 Kudos

Hi Ambuja,

Thanks for letting me know that, but in that case how will I set my variable value to true , before the screen appears ?

Basically my question is which event gets triggered where I can set the variable value and control the visibility of the button based on the value of custom field .

Because the event Before Save does not get loaded initially when the component is loaded .

Can you guide how to do that ?

ambuja_prabhudessai
Participant
0 Kudos

Hi Papps,

There is no action as of now in C4C which can be called on load of the TI screen for an XBO.

May be you can try adding this button on an EC and add the EC in the Overview page of Opportunity.

At the time of your EC inport firing, you can call a custom action where you can assign value to your indicator field. This action will be called when your Overview tab of Opportunity TI loads.

Regards,

Ambuja

Former Member
0 Kudos

Hi Ambuja,

Thanks for your valuable inputs. Though am very new in C4C and have never created one EC still I got your point .

The client are bit reluctant to have the button beside the Save and cancel Buttons, also the requirement is like we need to make another custom field as input disabled and this button to disable based on Prospect flag value which is present in account tab set or not .

Anyways I will discuss the  option you suggested with the Functional team, and update you on the Same. I really appreciate your effort and guidance.

Answers (2)

Answers (2)

Former Member
0 Kudos

when the Button is correctly bound to a BO Action then the only reason for being inactive is that there isn't an instance of the BO available for it to call the Action for it.

hope this could help!

Former Member
0 Kudos

Thanks Bahjat for the reply.

Former Member
0 Kudos

Hi Experts,

Any way to achieve  the functionality ?