Tag: Dynamics 365 CE

5 Interview Question

5 Interview Question

This post is a continuation of my 5 Interview Questions series. Here, I’m sharing five additional interview questions to help you prepare better.

Question 1: Can Business Rules run on Quick Create forms?

Answer : Yes. Quick create forms have full support for form scripts and business rules (with the usual limitation that rules act on columns present on that form). 

Question 2: What would be the last step before building a Dataverse / Power Platform plug-in

Answer : The common “don’t miss this” answer is still:

Strong-name sign the plug-in assembly (SNK) before you build/release for registration. Also ensure you’re targeting the expected framework and packaging/deployment approach your org uses.

Tip : Interviewers usually want the strong-name signing point.

Question 3: what do you know about the plug-in execution Execute(…) method ?

Answer: A Dataverse plug-in implements IPlugin and the platform calls:

void Execute(IServiceProvider serviceProvider)

Inside Execute, you typically pull:

IPluginExecutionContext (message, stage, depth, input/output parameters, images, user context) IOrganizationService (CRUD/operations) ITracingService (logging)

And you explain the pipeline stages (same concept; updated labels often shown as stage numbers):

PreValidation (10) – earliest validation PreOperation (20) – within transaction; can modify Target PostOperation (40) – after operation; good for follow-up actions (often async if heavy)

Key “latest interview” points:

On Update, Target contains only changed columns → use Pre/Post Images for old values. Guard against recursion using Depth. Use Filtering Attributes on Update steps to reduce executions. Prefer async plug-ins for external calls/long-running work.

Question 4 : Write me a java script to set a Lookup column value (model-driven form)

Answer: A Lookup column expects an array of lookup objects (id, name, entityType). You set it via setValue. 

// Example: Set the primary customer lookup on a form
function setCustomerLookup(executionContext) {
const formContext = executionContext.getFormContext();

const lookup = [
{
id: “a1b2c3d4-e5f6-1111-2222-333344445555”, // GUID (braces optional)
name: “Contoso Ltd”,
entityType: “account” // table logical name
}
];

formContext.getAttribute(“customerid”)?.setValue(lookup);
}

Tip : entityType here is still the table logical name (ex: account, contact).

Question 5: Show a notification with a column value that is not on the form ?

This is tricky question but answer we all know just think a bit deeper inside.

Answer : If a column isn’t on the form, you typically retrieve it from Dataverse using Xrm.WebApi.retrieveRecord(tableLogicalName, id, options) and then show it using formContext.ui.setFormNotification(…).  

async function showHiddenColumnInNotification(executionContext) {
const formContext = executionContext.getFormContext();
const id = formContext.data.entity.getId().replace(/[{}]/g, “”);

try {
// options is the OData query string
const row = await Xrm.WebApi.retrieveRecord(
“account”,
id,
“?$select=new_policyformat”
);

const val = row.new_policyformat ?? “(blank)”;

formContext.ui.setFormNotification(
`Policy format (from server): ${val}`,
“INFO”,
“policyformat_info”
);
} catch (e) {
formContext.ui.setFormNotification(
`Failed to read Policy format: ${e.message}`,
“ERROR”,
“policyformat_err”
);
}
}

Hope it helps. Wishing continued success to reader.