Hey Justin,
Thank you so much for replying. Since you know your way around Alert.JS, I would be so so grateful if you can have a peek at my code. As far as the pop-up is concerned, that all works fine. I am really struggling with where to set values to the field. If I can get the value correct for one field from the prompt, I would replicate for the rest of them (Since the additional fields are needed in the new phone record).
new Dialog({
id: "createphonecall",
height: 500,
width: 600,
title: "Follow-Up Phone Call",
icon: "QUESTION",
message: "This would create a new phone record with the same information",
buttons: [
new Dialog.Button("Create Phone Call", function(responses) {
var createphonecall = responses[4].value;
var crmWindow = new parent.Dialog().getCrmWindow();
crmWindow.Xrm.Page.getAttribute("createphonecall").setValue("amp_createfollowupphonecall")
new Dialog({
title: "Phone Call created Successfully!",
icon: "SUCCESS"
}).show();
}, true),
new Dialog.Button("Not now")
]
}).showPrompt([
new Dialog.OptionSet({ id: "createphonecall", label: "Create Phone Call", value: 3, options: [
{ text: "Yes", value: 4 },
{ text: "No", value: 3 },
] }),
new Dialog.Group ({
label: "New Phone Call Details",
fields: [
new Dialog.Input({ id: "scheduledend", label: "Due Date", type: "date", value: new Date() }),
new Dialog.OptionSet({ id: "amp_meetingcategory", label: "Meeting Category", value: 0, options: [
{ text: "", value: 0 },
{ text: "Introduction", value: 1 },
{ text: "Investigate New Business", value: 2 },
{ text: "Investigate Expanded Business", value: 3 },
{ text: "Present Proposal", value: 4 },
{ text: "Negotiation/Review", value: 5 },
{ text: "Resolution of Concerns", value: 6 },
{ text: "Carrier Service Review", value: 7 },
{ text: "Investigate Lost Business", value: 8 },
] }),
new Dialog.MultiLine({ id: "amp_meetingobjectives", label: "Meeting Objectives" })
]
})
]);
For this line in the code: crmWindow.Xrm.Page.getAttribute("createphonecall").setValue("amp_createfollowupphonecall"); createphonecall is the label name in the pop-up, and amp_createfollowupphonecall is the schema name of the field i want to change to Yes when the button is clicked.
I know I am super close to getting this done, I have scoured the documentation and tried all kinds of ways, but to no avail. I think the problem may be with the variables, but I am not sure.
Thank you in advance.