For partners that build or integrate commercially available applications and service solutions with the Oracle Cloud Platform
For partners that provide implementation or managed services around Oracle Cloud Applications
Hello All,
I am in the Actions and Links screen for the Accounts object. I added an Action button and a script that when pressed, changes the value of a certain field. After saving the script in the Edit Object Function screen, I select the list of value Method Name but cannot find the Function name I created.
Is this a bug?
What is the return type of the object function? Could you attach a screenshot of the function?
Hello Reghu,
The return type is String. I attached the screenshots of the work I've done.
The return type should be 'void' inorder to use the method in actions.
I'll change the return type to void. But let me give you a detailed description of the issue I'm facing.
I created a custom field called Email Credentials Sent which is a list of value with two values (Yes and No) the API name is EmailCredentialsSent_c. What The Action button should do is change the value of the read-only custom field to Yes and in return through customizing the Accounts object in the workflow, an email should be sent to the contact. The script I have is:
setAttribute("EmailCredentialsSent_c", "CUSTOM_YES");
It is defined in the Method name I am trying to display.
I made the return type to Void and selected the method name. But the application does not display the Action button that I created. What could be the problem?
So, now you ar eable to select the method, but the action is not appearing in page layouts for exposing?
I displayed the action button. The problem was as you said that it should be void. But may I ask a different question since I have you here?
Ok Glad that I could be of help in resolving the problem.
Yes, plz.
Thank you Reghu. I truly appreciate it.
Ok so in the Workflow object I have the script:
if (isAttributeChanged('EmailCredentialsSent_c') && EmailCredentialsSent_c == 'Yes')
return true;
1- For the API EmailCredentialsSent_c should I write the value Yes or the lookup value?
2- If I let the custom field be read-only and run the script can the application change the value? If not can I have a script that when the value turns to Yes the field becomes read-only?
Sorry for the constant questions but I am new to scripting and have no experience at all in it.
1- For the API EmailCredentialsSent_c should I write the value Yes or the lookup value? Since its Choice list field, you should use lookup code of the field.
2- If I let the custom field be read-only and run the script can the application change the value? If not can I have a script that when the value turns to Yes the field becomes read-only? So, what I understand is, you want to make the field readonly to users, but through script it should be editable. If yes, then change the updateable property of the field to condtional and inside the expression write 'return false'.
Thank you Reghu,
But what I meant in my second question is that when the value of the field becomes Yes. It should become read-only. How can I do this?
Also should the lookup code value be between single quotation or no quotations at all?
The reason why I am asking these questions because the email is not being sent even though the script I have written seems to be correct.
Never mind it worked :) Thank you Reghu. One finnnaaaal tiny question. Can I send an email to a list of contacts using script (mass amount of contacts)?
The return type should be 'void' inorder to use the method in actions.